/* AvniFruits — design system (RTL, Hebrew-first, light/dark). Brand: chameleon green + lime. */
:root {
  --primary: #297d59;
  --primary-600: #1f6045;
  --primary-100: #d9ece3;
  --primary-050: #eff7f3;
  --lime: #d2dd41;
  --lime-600: #a9b62c;
  --accent: #0ea5e9;
  --warn: #f59e0b;
  --danger: #dc2626;
  --danger-100: #fee2e2;
  --warn-100: #fef3c7;
  --info-100: #e0f2fe;

  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --border: #e4e8e6;
  --text: #17221b;
  --text-2: #5b6b61;
  --text-3: #93a29a;
  --shadow: 0 1px 3px rgba(23, 34, 27, .07), 0 4px 16px rgba(23, 34, 27, .05);
  --shadow-lg: 0 8px 30px rgba(23, 34, 27, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --nav-w: 236px;
  --font: 'Segoe UI', system-ui, -apple-system, 'Heebo', sans-serif;
}
html[data-theme="dark"] {
  --bg: #0e1512;
  --surface: #16201b;
  --surface-2: #1c2822;
  --border: #26332c;
  --text: #e8efe9;
  --text-2: #9fb2a6;
  --text-3: #64756b;
  --primary-600: #4caf80;
  --primary-100: #163a2a;
  --primary-050: #0f281e;
  --danger-100: #3d1414;
  --warn-100: #3a2b0a;
  --info-100: #0d2b3b;
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary-600); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }

/* ---------- Layout ---------- */
#app { display: flex; min-height: 100vh; }
nav.sidebar {
  width: var(--nav-w); flex-shrink: 0; background: var(--surface);
  border-left: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), #4ade80); display: grid; place-items: center; color: #fff; font-size: 20px; font-weight: 800; }
.brand .logo-img { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; background: #fff; padding: 3px; box-shadow: var(--shadow); flex-shrink: 0; }
.brand b { font-size: 1.02rem; display: block; letter-spacing: -.01em; }
.brand small { color: var(--text-3); font-size: .72rem; }
.nav-items { padding: 6px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 2px 0;
  border-radius: var(--radius-sm); color: var(--text-2); cursor: pointer; font-weight: 500;
  transition: background .15s;
}
.nav-item .ico { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-100); color: var(--primary-600); font-weight: 700; }
.nav-sep { margin: 10px 14px 4px; font-size: .7rem; color: var(--text-3); letter-spacing: .5px; }
.nav-footer { padding: 12px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-3); }

main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
header.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar .search { flex: 1; max-width: 420px; position: relative; }
.topbar .search input { width: 100%; padding: 9px 38px 9px 12px; }
.topbar .search .ico { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-height: 340px; overflow: auto; z-index: 60;
}
.search-results .sr-item { padding: 9px 13px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.search-results .sr-item:hover { background: var(--surface-2); }
.search-results .sr-group { padding: 6px 13px 2px; font-size: .7rem; color: var(--text-3); font-weight: 700; }
.topbar .spacer { flex: 1; }
.icon-btn {
  border: none; background: transparent; font-size: 1.15rem; cursor: pointer; color: var(--text-2);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; position: relative;
}
.icon-btn:hover { background: var(--surface-2); }
.badge-dot {
  position: absolute; top: 5px; left: 5px; background: var(--danger); color: #fff;
  font-size: .62rem; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 3px;
}
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 10px; border-radius: 20px; }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

#view { padding: 22px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .val { font-size: 1.55rem; font-weight: 800; margin: 2px 0; }
.kpi .lbl { color: var(--text-2); font-size: .8rem; }
.kpi .sub { color: var(--text-3); font-size: .74rem; }
.kpi.alert .val { color: var(--danger); }
.kpi.good .val { color: var(--primary-600); }
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.chart-card canvas { max-height: 230px; }
.dash-bottom-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
@media (max-width: 860px) { .dash-bottom-row { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: right; padding: 11px 14px; color: var(--text-2); font-size: .74rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.no-link { cursor: default; }

/* ---------- Badges / pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.pill.green { background: var(--primary-100); color: var(--primary-600); }
.pill.red { background: var(--danger-100); color: var(--danger); }
.pill.amber { background: var(--warn-100); color: #b45309; }
.pill.blue { background: var(--info-100); color: #0369a1; }
.pill.gray { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: var(--radius-sm); padding: 10px 18px; font-size: .92rem;
  font-weight: 700; cursor: pointer; font-family: inherit; transition: filter .15s, background .15s;
  background: var(--primary); color: #fff; min-height: 42px;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--primary-600); }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: .8rem; }
.btn.lg { padding: 14px 26px; font-size: 1.05rem; }

/* ---------- Forms ---------- */
input, select, textarea {
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; outline: none; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-2); margin: 0 0 5px; }
.field { margin-bottom: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: .75rem; color: var(--text-3); margin-top: 3px; }
.computed { background: var(--primary-050); border-color: var(--primary-100); font-weight: 800; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(10, 20, 14, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .15s;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; padding: 22px;
  animation: slideUp .18s;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 18px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(14px); opacity: 0; } }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; right: 50%; transform: translateX(50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 24px;
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: .9rem; animation: slideUp .2s;
  max-width: 90vw;
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--primary-600); color: #fff; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(160deg, var(--primary-050), var(--bg) 60%); padding: 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; padding: 0 0 18px; flex-direction: column; text-align: center; }
.login-card .brand .logo { width: 62px; height: 62px; font-size: 30px; border-radius: 16px; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-logo img { width: 100%; max-width: 300px; height: auto; }
.login-logo small { color: var(--text-3); font-size: .78rem; letter-spacing: .01em; }
html[data-theme="dark"] .login-logo img { padding: 14px 16px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }

/* ---------- Timeline (trace) ---------- */
.timeline { position: relative; padding-right: 24px; }
.timeline::before { content: ''; position: absolute; right: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 22px 20px 0; }
.tl-item::before {
  content: ''; position: absolute; right: 1.5px; top: 5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.tl-item .tl-time { font-size: .74rem; color: var(--text-3); }
.tl-item .tl-title { font-weight: 700; }

/* ---------- Cold room grid ---------- */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.room-card .room-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.room-card .occ-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.room-card .occ-bar > div { height: 100%; background: var(--primary); border-radius: 4px; }
.pallet-chip {
  display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; margin: 5px 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .8rem; cursor: pointer;
}
.pallet-chip.aging { border-color: var(--danger); background: var(--danger-100); }

/* ---------- Shipment pipeline ---------- */
.pipeline { display: flex; gap: 4px; margin: 6px 0 14px; flex-wrap: wrap; }
.pipe-step { flex: 1; min-width: 74px; text-align: center; font-size: .72rem; padding: 7px 4px; background: var(--surface-2); color: var(--text-3); position: relative; font-weight: 600; border-radius: 4px; }
.pipe-step.done { background: var(--primary-100); color: var(--primary-600); }
.pipe-step.current { background: var(--primary); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tab.active { color: var(--primary-600); border-color: var(--primary); }

/* ---------- Floor app ---------- */
.floor-home { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 0; }
.floor-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 18px;
  padding: 30px 10px; font-size: 1.05rem; font-weight: 800; cursor: pointer; color: var(--text);
  box-shadow: var(--shadow); min-height: 130px; transition: transform .1s;
}
.floor-btn:active { transform: scale(.97); }
.floor-btn .ico { font-size: 2.3rem; }
.floor-btn.full { grid-column: 1 / -1; }
.offline-banner {
  background: var(--warn); color: #442c00; padding: 9px 16px; text-align: center; font-weight: 700;
  position: sticky; top: 0; z-index: 50; font-size: .85rem;
}
.big-num input { font-size: 1.6rem; font-weight: 800; text-align: center; padding: 14px; }
#scanner-box { border-radius: var(--radius); overflow: hidden; background: #000; }
#scanner-box video { width: 100%; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty .ico { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius-sm); height: 18px; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-3); font-size: .8rem; }
.mono { font-family: Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 130px; }
.qty-chip { font-size: 1.05rem; font-weight: 800; }
.profit-pos { color: var(--primary-600); font-weight: 800; }
.profit-neg { color: var(--danger); font-weight: 800; }
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.photo-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-grid img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; }

/* ---------- Deal finder ---------- */
.pipe-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.pipe-cell { flex: 1; min-width: 86px; text-align: center; padding: 10px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.pipe-cell:hover { background: var(--primary-100); }
.pipe-n { font-size: 1.4rem; font-weight: 800; }
.pipe-l { font-size: .74rem; color: var(--text-2); font-weight: 600; }
.wh-card.active-wh { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); }
.hot-row { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 6px 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.hot-row:hover { border-color: var(--primary); }
.hot-banner { border: 2px solid var(--warn); background: var(--warn-100); }
.outbox-row { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; flex-wrap: wrap; }
.ob-info { flex: 1; min-width: 220px; }
.ob-msg { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 8px; font-size: .82rem; color: var(--text-2); white-space: pre-wrap; }
.ob-actions { display: flex; flex-direction: column; gap: 8px; }
.wa-btn { background: #25d366; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border: 1.5px solid var(--border); border-radius: 20px; font-size: .82rem; cursor: pointer; background: var(--surface); user-select: none; }
.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-100); color: var(--primary-600); font-weight: 700; }
.chip input { width: auto; margin: 0; accent-color: var(--primary); }

/* ---------- Mobile ---------- */
.mobile-tabs { display: none; }
/* z-index ladder (mobile): header/search-results 20/60 < mobile-tabs 40 < nav-backdrop 85
   < nav.sidebar 90 < modal-back 100. Kept comfortably apart so no accidental ties. */
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 85; }
.nav-backdrop.show { display: block; }
@media (max-width: 860px) {
  /* Sidebar becomes an off-canvas drawer (slides in from the right for RTL) opened by ☰,
     closed by the ✕ in its header, tapping the backdrop, or picking a nav item. */
  nav.sidebar {
    position: fixed; top: 0; right: -270px; bottom: 0; height: 100%;
    width: 250px; max-width: 82vw;
    transition: right .22s ease;
    z-index: 90; box-shadow: var(--shadow-lg);
  }
  nav.sidebar.open { right: 0; }
  .brand { padding-top: calc(18px + env(safe-area-inset-top)); }
  .nav-close-btn { flex-shrink: 0; }
  #view { padding: 14px 12px 90px; }
  /* padding-top reserves the notch/status-bar area when installed as a standalone PWA
     (viewport-fit=cover); without it the topbar renders partly under the OS status bar. */
  header.topbar { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .topbar .search { max-width: none; }
  .mobile-tabs {
    display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
  }
  .mtab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; font-size: .62rem; color: var(--text-3); cursor: pointer; border-radius: 8px; font-weight: 600; }
  .mtab .ico { font-size: 1.25rem; }
  .mtab.active { color: var(--primary-600); }
  .modal { max-height: 88vh; }
  .floor-home { grid-template-columns: 1fr 1fr; }
  th, td { padding: 9px 9px; font-size: .8rem; }
}

/* ---------- Tasks module (✅ משימות) ---------- */
.task-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.task-tab { padding: 8px 14px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.task-tab.active { background: var(--primary-100); color: var(--primary-600); border-color: var(--primary); }

.quick-add { padding: 12px 14px; margin-bottom: 12px; }
.qa-row { display: flex; gap: 8px; }
.qa-row input { flex: 1; }

.myday-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.mdt { padding: 8px 16px; border: none; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
.mdt.active { color: var(--primary-600); border-bottom-color: var(--primary); }

.task-rows { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.task-row.overdue { border-inline-start: 4px solid var(--danger); }
.task-row.done { opacity: .6; }
.task-row.done .task-title { text-decoration: line-through; }
.task-main { flex: 1; cursor: pointer; min-width: 0; }
.task-title { font-weight: 700; font-size: .98rem; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 5px; }

.task-check {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: .95rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.task-check:active { transform: scale(.9); }
.task-check.on { background: var(--primary); border-color: var(--primary); }
.task-check.sm { width: 22px; height: 22px; font-size: .72rem; }

.t-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.t-avatar.none { background: var(--surface-2); color: var(--text-3); border: 1px dashed var(--border); }

.due-chip { font-size: .74rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 2px 8px; border-radius: 12px; border: 1px solid var(--border); }
.due-chip.red { background: var(--danger-100); color: var(--danger); border-color: var(--danger); }
.chk-count { font-size: .74rem; color: var(--text-2); font-weight: 600; }
.task-list-tag { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--c, var(--border)); color: var(--c, var(--text-2)); }
.task-label { font-size: .68rem; font-weight: 700; color: #fff; padding: 2px 7px; border-radius: 10px; }
.task-src { cursor: pointer; }
.strike { text-decoration: line-through; color: var(--text-2); }

/* Kanban board */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kan-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.kan-head { font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.kan-n { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 8px; font-size: .78rem; color: var(--text-2); }
.kan-body { min-height: 60px; display: flex; flex-direction: column; gap: 8px; border-radius: var(--radius-sm); padding: 4px; }
.kan-body.drop-hot { background: var(--primary-100); outline: 2px dashed var(--primary); }
.kan-empty { color: var(--text-3); text-align: center; padding: 12px; font-size: .8rem; }
.kan-card { background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--text-3); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px; cursor: grab; }
.kan-card.dragging { opacity: .5; }
.kan-card.pri-urgent { border-inline-start-color: var(--danger); }
.kan-card.pri-high { border-inline-start-color: var(--warn); }
.kan-card.pri-normal { border-inline-start-color: var(--accent); }
.kan-card.pri-low { border-inline-start-color: var(--text-3); }
.kc-title { font-weight: 700; margin-bottom: 6px; cursor: pointer; }
.kc-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.kc-assignee { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem; color: var(--text-2); }

/* Lists */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--c, var(--primary)); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.lc-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.lc-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--primary)); }
.lc-count { color: var(--text-2); margin: 8px 0; font-size: .85rem; }
.lc-actions { display: flex; gap: 6px; }

/* Automation */
.role-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rm-row label { margin-bottom: 4px; }
.auto-rule { margin-bottom: 12px; }
.auto-rule.off { opacity: .6; }
.ar-head { display: flex; align-items: center; gap: 12px; }
.ar-ico { font-size: 1.6rem; }
.ar-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 26px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; height: 20px; width: 20px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(-20px); }

/* Task detail modal */
.status-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.td-section { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.td-section h3 { margin: 0 0 8px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border); }
.progress-bar { height: 100%; background: var(--primary); transition: width .3s; }
.chk-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.chk-item.done .chk-text { text-decoration: line-through; color: var(--text-2); }
.chk-text { flex: 1; }
.chk-del { border: none; background: transparent; color: var(--text-3); cursor: pointer; font-size: .9rem; }

.tasks-widget .tw-overdue { color: var(--danger); font-weight: 700; }

@media (max-width: 860px) {
  .kanban { grid-template-columns: 1fr; }
  .ar-grid { grid-template-columns: 1fr; }
  .task-check { width: 34px; height: 34px; }
}
@media (min-width: 861px) { .only-mobile { display: none; } }

/* Calendar & meetings */
.cal-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal-month-label { margin: 0; min-width: 160px; text-align: center; }
.cal-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-wd-row { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-wd { padding: 8px; text-align: center; font-size: .78rem; color: var(--text-2); font-weight: 700; }
.cal-cells { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 96px; border-bottom: 1px solid var(--border); border-inline-start: 1px solid var(--border); padding: 6px; cursor: pointer; transition: background .12s; }
.cal-cell:nth-child(7n+1) { border-inline-start: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { opacity: .4; }
.cal-cell.today .cal-daynum { background: var(--primary); color: #fff; border-radius: 50%; }
.cal-daynum { font-size: .82rem; font-weight: 700; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.cal-events { display: flex; flex-direction: column; gap: 3px; }
.cal-event { background: var(--primary-100); color: var(--primary-600); font-size: .72rem; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: .7rem; color: var(--text-3); padding: 0 6px; }
@media (max-width: 860px) {
  .cal-cell { min-height: 64px; }
  .cal-event { font-size: .66rem; }
}
