/* Zedak CRM — design system (RTL-first, no build step) */
:root {
  --brand: #0E7C66;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --brand-line: color-mix(in srgb, var(--brand) 28%, white);
  --ink: #0f1c24;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e3e8ee;
  --line-2: #eef2f6;
  --bg: #f3f5f7;
  --card: #ffffff;
  --side: #0c1d26;
  --side-2: #12303b;
  --side-ink: #c7d6dc;
  --ok: #15803d; --ok-soft: #e7f6ec;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #c2410c; --bad-soft: #fdece4;
  --danger: #dc2626; --danger-soft: #fdecec;
  --info: #0369a1; --info-soft: #e5f2fa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 28, 36, .05), 0 1px 1px rgba(15, 28, 36, .03);
  --shadow-lg: 0 18px 40px -12px rgba(15, 28, 36, .28);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --side-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 .6em; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] .num:not(td):not(th):not(div):not(input) { display: inline-block; }
[dir=rtl] div.num { text-align: right; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--side); color: var(--side-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40;
}
.side .brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; }
.side .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 17px; overflow: hidden; }
.side .brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.side .brand .name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.side .brand .sub { font-size: 11px; color: #7e98a3; letter-spacing: .3px; }
.side nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.side .nav-label { font-size: 11px; color: #67818c; padding: 14px 10px 6px; letter-spacing: .4px; }
.side a.nav {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--side-ink);
  font-size: 14px; margin-bottom: 2px; transition: background .12s;
}
.side a.nav:hover { background: rgba(255,255,255,.05); color: #fff; }
.side a.nav.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
[dir=rtl] .side a.nav.active { box-shadow: inset -3px 0 0 var(--brand); }
.side a.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side a.nav .count { margin-inline-start: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; min-width: 20px; text-align: center; }
.side .foot { padding: 14px 20px; font-size: 11.5px; color: #67818c; border-top: 1px solid rgba(255,255,255,.06); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center;
  gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.top .search-trigger {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; min-width: 300px; border: 1px solid var(--line);
  border-radius: 9px; color: var(--muted); background: var(--bg); cursor: pointer;
}
.top .search-trigger kbd { margin-inline-start: auto; font-family: var(--mono); font-size: 11px; background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.top .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: none;
  cursor: pointer; color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 3px; inset-inline-end: 2px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; min-width: 17px; padding: 0 4px; border-radius: 999px; border: 2px solid #fff; font-weight: 600; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.page-head .crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.menu-toggle { display: none; }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { flex: 1; }
.card-b { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sep { height: 1px; background: var(--line-2); margin: 14px 0; }

/* stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.stat { display: block; padding: 16px 18px 14px; position: relative; overflow: hidden; transition: border-color .12s, transform .12s; }
.stat:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--c, var(--brand)); }
.stat .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 600; margin: 6px 0 4px; letter-spacing: -.5px; }
.stat .trend { font-size: 11.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.trend .up { color: var(--ok); font-weight: 600; } .trend .down { color: var(--bad); font-weight: 600; } .trend .flat { color: var(--muted); font-weight: 600; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.danger { color: var(--danger); border-color: #f3c6c6; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--bg); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.wa { color: #128C4A; } .btn.call { color: var(--info); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field .req { color: var(--danger); }
.input, select.input, textarea.input {
  height: 38px; width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  transition: border-color .12s, box-shadow .12s; outline: none;
}
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; }
select.input { padding-inline-end: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; }
[dir=ltr] select.input { background-position: right 10px center; }
select.input[multiple] { height: auto; min-height: 38px; padding: 4px; background-image: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.input.sm { height: 32px; font-size: 13px; }
.input.error, .field.has-error .input { border-color: #f0a3a3; }
.err { color: var(--danger); font-size: 12px; }
.help { color: var(--muted); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.input-group { display: flex; gap: 6px; }
.input-group .input { flex: 1; }

/* ---------- badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stage-pill { color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--danger-soft); color: var(--danger); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line-2); font-size: 12px; color: var(--ink-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 18%, #e9eef2); color: var(--brand); display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; overflow: hidden; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; font-weight: 500; color: var(--muted); border: 0; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .n { background: var(--line-2); color: var(--ink-2); font-size: 11.5px; border-radius: 999px; padding: 0 7px; font-weight: 600; }
.tabs .active .n { background: var(--brand-soft); color: var(--brand); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; font-size: 13px; cursor: pointer; }
.chip .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.active .n { color: #b8c7cd; }
.chip.alert .n { color: var(--danger); }
.chip.active.alert .n { color: #ffb4b4; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; position: sticky; top: 0; }
.t th a { display: inline-flex; gap: 4px; align-items: center; }
.t th a:hover { color: var(--ink); }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fafcfc; }
.t tr.selected td { background: var(--brand-soft); }
.t .lead-name { font-weight: 600; color: var(--ink); }
.t .lead-name:hover { color: var(--brand); }
.t .row-actions { display: flex; gap: 4px; opacity: .55; transition: opacity .12s; }
.t tr:hover .row-actions { opacity: 1; }
.t .cmt { max-width: 240px; color: var(--ink-2); }
.t .when { font-size: 12px; color: var(--muted); display: block; }
.when.overdue { color: var(--danger); font-weight: 600; }
.when.today { color: var(--warn); font-weight: 600; }
.t td.num, .t th.num { text-align: end; }
.t.compact td { padding: 8px 12px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 8px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.pager .grow { flex: 1; }
.pager a, .pager span.pg { min-width: 32px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); font-size: 13px; }
.pager a:hover { background: var(--bg); }
.pager .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .disabled { opacity: .4; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.bulkbar .input { height: 32px; width: auto; min-width: 160px; color: var(--ink); }

/* ---------- filters panel ---------- */
.filters { display: none; padding: 16px 18px; border-bottom: 1px solid var(--line-2); background: #fbfcfd; }
.filters.open { display: block; }
.filters .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.filters .field > label { font-size: 12px; }
.range { display: flex; gap: 6px; }
.range .input { min-width: 0; }

/* ---------- alerts / toast ---------- */
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert.ok { background: var(--ok-soft); color: #14532d; border-color: #c4e7cf; }
.alert.bad { background: var(--danger-soft); color: #7f1d1d; border-color: #f5c7c7; }
.alert.warn { background: var(--warn-soft); color: #78350f; border-color: #f4dcb2; }
.alert.info { background: var(--info-soft); color: #0c4a6e; border-color: #c4e1f3; }
.alert ul { margin: 4px 0 0; padding-inline-start: 18px; }
.toasts { position: fixed; bottom: 18px; inset-inline-start: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { background: var(--ink); color: #fff; border-radius: 11px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; animation: toastIn .2s ease-out; cursor: pointer; }
.toast .t1 { font-weight: 600; font-size: 13.5px; } .toast .t2 { font-size: 12.5px; color: #b8c7cd; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

/* ---------- dropdown / popover ---------- */
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; display: none; z-index: 60; }
.dd.open .dd-menu { display: block; }
.dd-menu a, .dd-menu button { display: flex; width: 100%; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 7px; border: 0; background: none; cursor: pointer; text-align: start; font-size: 13.5px; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--bg); }
.dd-menu .sep { margin: 5px 0; }
.notif-panel { width: 380px; padding: 0; }
.notif-panel .nh { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.notif-panel .nh strong { flex: 1; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.notif:hover { background: #fafbfc; }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, white); }
.notif .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--ink-2); }
.notif.unread .ic { background: var(--brand-soft); color: var(--brand); }
.notif .ic svg { width: 16px; height: 16px; }
.notif .nt { font-weight: 600; font-size: 13px; } .notif .nb { font-size: 12.5px; color: var(--muted); } .notif .nw { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ---------- drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 29, 38, .38); z-index: 90; display: none; }
.overlay.show { display: block; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100vw); background: #fff; z-index: 100; box-shadow: var(--shadow-lg); transform: translateX(-105%); transition: transform .2s ease; display: flex; flex-direction: column; }
[dir=ltr] .drawer { transform: translateX(105%); }
.drawer.show { transform: none !important; }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer .dh h2 { flex: 1; }
.drawer .db { padding: 20px; overflow-y: auto; flex: 1; }
.drawer .df { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal { position: fixed; inset: 0; z-index: 110; display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal.show { display: flex; }
.modal .box { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; }
.modal .box.wide { max-width: 760px; }
.modal .mh { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal .mh h2 { flex: 1; }
.modal .mb { padding: 20px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }

/* command palette */
.palette .box { max-width: 640px; }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.palette .pin input { border: 0; outline: 0; flex: 1; font-size: 16px; }
.palette .res { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette .r { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; }
.palette .r.sel, .palette .r:hover { background: var(--bg); }
.palette .r .nm { font-weight: 600; } .palette .r .meta { font-size: 12px; color: var(--muted); }
.palette .hint { padding: 10px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line-2); }

/* ---------- lead profile ---------- */
.lead-head { display: flex; gap: 16px; align-items: flex-start; padding: 20px; flex-wrap: wrap; }
.lead-head .avatar { width: 52px; height: 52px; font-size: 18px; }
.lead-head h1 { font-size: 21px; }
.lead-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; min-width: 0; }
.stars { display: inline-flex; gap: 1px; direction: ltr; }
.stars button { border: 0; background: none; padding: 0 1px; cursor: pointer; color: #d6dde3; font-size: 17px; line-height: 1; }
.stars button.on { color: #f5a524; }
.timeline { position: relative; }
.tl { display: flex; gap: 12px; padding: 12px 0; position: relative; }
.tl:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 44px; bottom: -4px; width: 2px; background: var(--line-2); }
.tl .ti { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); flex: none; z-index: 1; }
.tl .ti svg { width: 15px; height: 15px; }
.tl.comment .ti { background: var(--info-soft); color: var(--info); }
.tl.stage .ti { background: var(--brand-soft); color: var(--brand); }
.tl.call .ti, .tl.whatsapp .ti { background: var(--ok-soft); color: var(--ok); }
.tl.assign .ti { background: var(--warn-soft); color: var(--warn); }
.tl .tb { flex: 1; min-width: 0; }
.tl .th { font-size: 13px; } .tl .th b { font-weight: 600; }
.tl .tw { font-size: 11.5px; color: var(--faint); }
.tl .tc { margin-top: 6px; background: var(--bg); border-radius: 9px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.mention { color: var(--brand); font-weight: 600; }
.dup-box { border: 1px solid #f4dcb2; background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.dup-box a { text-decoration: underline; }
.task-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.task-row:last-child { border-bottom: 0; }
.task-row .tt { flex: 1; min-width: 0; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 70vh; }
.kcol { flex: 0 0 272px; background: #eaeef1; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 190px); }
.kcol .kh { padding: 11px 12px; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.kcol .kh .d { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.kcol .kh .n { margin-inline-start: auto; font-size: 12px; color: var(--muted); background: #fff; border-radius: 999px; padding: 0 8px; }
.kcol .kb { padding: 0 8px 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.kcol.drag-over { outline: 2px dashed var(--brand); outline-offset: -3px; }
.kcard { background: #fff; border-radius: 9px; padding: 10px 11px; margin-bottom: 8px; box-shadow: var(--shadow); border: 1px solid var(--line-2); cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .kn { font-weight: 600; font-size: 13.5px; }
.kcard .km { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .art { background: var(--side); color: #dce7eb; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%); bottom: -220px; inset-inline-end: -160px; opacity: .55; }
.auth .art h2 { font-size: 30px; color: #fff; line-height: 1.35; max-width: 420px; position: relative; z-index: 1; }
.auth .art p { color: #9fb6be; max-width: 420px; position: relative; z-index: 1; }
.auth .art .points { position: relative; z-index: 1; display: grid; gap: 10px; margin-top: 24px; }
.auth .art .points div { display: flex; gap: 10px; align-items: center; color: #c9d8dd; }
.auth .art .points svg { width: 18px; height: 18px; color: var(--brand); flex: none; filter: brightness(1.5); }
.auth .form { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth .form .in { width: 100%; max-width: 380px; }
.auth .form h1 { font-size: 24px; margin-bottom: 6px; }
.auth .lang { position: absolute; top: 18px; inset-inline-end: 22px; font-size: 13px; }

/* ---------- misc ---------- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: #fff; }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; }
.bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.color-dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: middle; }
.qr { width: 220px; height: 220px; margin: 0 auto; }
.qr svg, .qr img { width: 100%; height: 100%; }
.settings-tile { display: flex; gap: 14px; padding: 18px; align-items: flex-start; transition: border-color .12s; }
.settings-tile:hover { border-color: var(--brand-line); }
.settings-tile .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.settings-tile .ic svg { width: 20px; height: 20px; }
.banner { padding: 10px 24px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; }
.banner.warn { background: var(--warn-soft); color: #78350f; border-bottom: 1px solid #f4dcb2; }
.banner.bad { background: var(--danger-soft); color: #7f1d1d; border-bottom: 1px solid #f5c7c7; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .filters .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side { position: fixed; inset-inline-start: 0; transform: translateX(105%); transition: transform .2s; }
  [dir=ltr] .side { transform: translateX(-105%); }
  .side.open { transform: none !important; }
  .menu-toggle { display: grid; }
  .top { padding: 0 14px; }
  .top { gap: 6px; }
  .top .search-trigger { min-width: 38px; flex: 0 0 auto; padding: 0 10px; }
  .top .search-trigger span, .top .search-trigger kbd, .top .lbl, .hide-sm { display: none !important; }
  .content { padding: 16px; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .filters .grid { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 23px; }
  .filters .grid { grid-template-columns: 1fr; }
  .notif-panel { width: calc(100vw - 24px); }
}
@media print {
  .side, .top, .no-print { display: none !important; }
  .content { padding: 0; }
}
