@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/static/fonts/rubik-hebrew-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/static/fonts/rubik-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cfd6e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --success: #059669; --success-50: #ecfdf5;
  --warning: #b45309; --warning-50: #fffbeb;
  --danger: #dc2626; --danger-50: #fef2f2;
  --info: #0369a1; --info-50: #f0f9ff;
  --sidebar: #0b1220;
  --sidebar-2: #111a2e;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .07), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .18);
  --focus: 0 0 0 3px rgba(79, 70, 229, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 .8em; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em; direction: ltr; unicode-bidi: embed; }
.ltr { direction: ltr; unicode-bidi: embed; text-align: left; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: left; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 16px; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }

.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.9; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }
.icon.xl { width: 30px; height: 30px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; background: linear-gradient(to left, #0b1220 0 252px, var(--bg) 252px); }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #c7d0e0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-left: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 6px 16px rgba(99,102,241,.4); color: #fff;
}
.brand small { display: block; font-weight: 400; font-size: 11px; color: #8b97ad; }
.nav { padding: 6px 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7891; padding: 16px 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; color: #c7d0e0; padding: 8px 10px; border-radius: 8px; margin: 1px 0;
  font-weight: 450; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(99,102,241,.18); color: #fff; }
.nav a.active::before { content: ''; position: absolute; right: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px 0 0 3px; background: #818cf8; }
.nav a .icon { opacity: .85; }
.nav .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; margin-inline: 4px 5px; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.sec-chip { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; background: rgba(255,255,255,.04); font-size: 12px; color: #aab5c8; }
.sec-chip.ok .icon { color: #34d399; } .sec-chip.warn .icon { color: #fbbf24; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: rgba(255,255,255,.85); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumbs { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.topbar .crumbs a { color: var(--muted); } .topbar .crumbs a:hover { color: var(--text); }
.topbar .crumbs .current { color: var(--text); font-weight: 500; }
.btn.menu-toggle { display: none; }
.content { padding: 26px 28px 60px; max-width: 1440px; width: 100%; }

/* user menu */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; left: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--text-2);
  background: none; border: 0; font: inherit; cursor: pointer; text-align: right;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 5px 0; }
.dropdown-menu .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 9px; font: inherit; color: var(--text); }
.user-btn:hover { background: var(--surface-2); }
.user-btn .meta { text-align: right; line-height: 1.2; }
.user-btn .meta small { color: var(--muted); font-size: 11.5px; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s; text-decoration: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--primary-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #b9c2d1; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(15,23,42,.05); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-danger-soft { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.btn-danger-soft:hover { background: #fee2e2; color: #b91c1c; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-provider { background: #fff; border: 1px solid var(--border-strong); color: var(--text); height: 42px; font-weight: 500; }
.btn-provider:hover { background: var(--surface-2); color: var(--text); }
.btn-provider .pmark { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-foot { padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: 8px; justify-content: flex-start; align-items: center; }
.card.danger-zone { border-color: #fecaca; }
.card.danger-zone .card-head { background: var(--danger-50); border-color: #fecaca; border-radius: var(--radius) var(--radius) 0 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.grid-side { grid-template-columns: 260px minmax(0,1fr); }

.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .val { font-size: 24px; font-weight: 650; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 12.5px; }
.ic-primary { background: var(--primary-50); color: var(--primary); }
.ic-success { background: var(--success-50); color: var(--success); }
.ic-warning { background: var(--warning-50); color: var(--warning); }
.ic-danger { background: var(--danger-50); color: var(--danger); }
.ic-info { background: var(--info-50); color: var(--info); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: right; font-weight: 550; color: var(--muted); font-size: 12px; text-transform: none; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfe; }
.table .row-link { color: inherit; }
.table td.actions { text-align: left; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #f1f5f9; color: #475569; border: 1px solid transparent; white-space: nowrap; line-height: 1.6; }
.badge .icon { width: 13px; height: 13px; }
.badge-success { background: var(--success-50); color: var(--success); border-color: #a7f3d0; }
.badge-warning { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.badge-danger { background: var(--danger-50); color: var(--danger); border-color: #fecaca; }
.badge-info { background: var(--info-50); color: var(--info); border-color: #bae6fd; }
.badge-primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.badge-outline { background: #fff; border-color: var(--border-strong); }
.role-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; background: #f8fafc; border: 1px solid var(--border); color: var(--text-2); }
.role-badge i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* ---------- Avatar ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 12.5px; display: inline-grid; place-items: center; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.user-cell { display: flex; align-items: center; gap: 11px; }
.user-cell .n { font-weight: 550; color: var(--text); }
.user-cell .e { color: var(--muted); font-size: 12.5px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label, .label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
.req::after { content: ' *'; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], select, textarea {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[type=color] { width: 44px; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 3px; background: #fff; cursor: pointer; }
input[type=email], input[type=password], input.ltr, input[name=code] { direction: ltr; text-align: left; }
input[type=email]::placeholder, input[type=password]::placeholder { text-align: right; direction: rtl; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-right: 36px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; cursor: pointer; margin: 0; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 16px; height: 16px; flex: none; }
.check strong { font-weight: 550; display: block; color: var(--text); }
.otp-input { font-size: 26px !important; letter-spacing: .45em; text-align: center !important; height: 54px !important; font-family: ui-monospace, Menlo, monospace; font-weight: 600; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 400; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; background: #cbd5e1; border-radius: 22px; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(-16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.switch input:disabled + .track { opacity: .5; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .t { font-weight: 550; }
.setting-row .d { color: var(--muted); font-size: 12.5px; }

.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; font-weight: 400; margin: 0; transition: border-color .15s, background .15s; }
.radio-card:hover { border-color: #a5b4fc; }
.radio-card input { accent-color: var(--primary); margin-top: 3px; }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 1px var(--primary) inset; }
.radio-card strong { display: block; font-weight: 550; }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--success-50); border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: var(--danger-50); border-color: #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-50); border-color: #fde68a; color: #92400e; }
.alert-info { background: var(--info-50); border-color: #bae6fd; color: #075985; }
.toasts { position: fixed; bottom: 22px; left: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.toast { display: flex; gap: 10px; align-items: flex-start; background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); animation: slidein .25s ease-out; font-size: 13.5px; }
.toast.success .icon { color: #34d399; } .toast.danger .icon { color: #f87171; } .toast.warning .icon { color: #fbbf24; } .toast.info .icon { color: #38bdf8; }
.toast button { background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 0; margin-inline-start: auto; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs .count { background: #eef2f7; color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }

/* ---------- Filters / pagination ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1; min-width: 220px; max-width: 360px; }
.toolbar select, .toolbar input[type=date] { width: auto; min-width: 140px; height: 34px; }
.toolbar input[type=search] { height: 34px; }
.pagination { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border); color: var(--text-2); padding: 0 8px; }
.pagination a:hover { background: var(--surface-2); }
.pagination span.cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ic { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 14px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- Key/value list ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { min-width: 0; }
.list .title { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 11px; padding: 10px 18px; position: relative; font-size: 13px; }
.timeline li .tdot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.timeline li .tdot .icon { width: 14px; height: 14px; }
.sev-warning .tdot { background: var(--warning-50); color: var(--warning); border-color: #fde68a; }
.sev-notice .tdot { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }

/* ---------- Progress ---------- */
.progress { height: 6px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; color: inherit; }
.project-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); color: inherit; transform: translateY(-1px); }
.project-card .pc-top { padding: 18px; flex: 1; }
.project-card .pc-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; }
.p-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; letter-spacing: .02em; }
.p-key { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0 6px; direction: ltr; display: inline-block; }

.board-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.board-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.board-filters select, .board-filters input { height: 34px; width: auto; min-width: 130px; }
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: calc(100vh - 250px); }
.kcol { background: #eef1f6; border-radius: 12px; width: 296px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 220px); border: 1px solid #e3e7ef; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-weight: 600; font-size: 13px; }
.kcol-head .cdot { width: 10px; height: 10px; border-radius: 3px; }
.kcol-head .cnt { background: rgba(15,23,42,.07); color: var(--muted); font-size: 11.5px; border-radius: 999px; padding: 0 8px; font-weight: 500; }
.kcol-body { padding: 4px 8px 8px; overflow-y: auto; flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.kcol-body.drag-over { background: rgba(79,70,229,.06); border-radius: 8px; outline: 2px dashed rgba(79,70,229,.35); outline-offset: -4px; }
.kcard { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 11px 12px; box-shadow: var(--shadow-sm); cursor: grab; display: block; color: inherit; transition: box-shadow .15s, border-color .15s; }
.kcard:hover { border-color: #c7d2fe; box-shadow: var(--shadow); color: inherit; }
.kcard.dragging { opacity: .45; transform: rotate(1deg); }
.kcard .kt { font-weight: 500; margin: 4px 0 9px; color: var(--text); line-height: 1.4; }
.kcard .km { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--muted); font-size: 12px; }
.kcard .km .l { display: flex; align-items: center; gap: 8px; }
.kadd { margin: 0 8px 8px; }
.kadd summary { list-style: none; cursor: pointer; color: var(--muted); padding: 7px 8px; border-radius: 7px; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.kadd summary::-webkit-details-marker { display: none; }
.kadd summary:hover { background: rgba(15,23,42,.05); color: var(--text); }
.kadd form { background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 9px; margin-top: 4px; }
.kadd input { height: 34px; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; padding: 1px 7px; border-radius: 5px; }
.p-urgent { background: #fee2e2; color: #b91c1c; } .p-high { background: #ffedd5; color: #c2410c; } .p-medium { background: #e0f2fe; color: #0369a1; } .p-low { background: #f1f5f9; color: #64748b; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due.overdue { color: var(--danger); font-weight: 500; } .due.today { color: var(--warning); font-weight: 500; }

.task-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 20px; align-items: start; }
.task-title-input { font-size: 20px !important; font-weight: 600; height: 46px !important; border-color: transparent !important; padding: 0 8px !important; margin-inline-start: -9px; background: transparent !important; }
.task-title-input:hover { border-color: var(--border-strong) !important; }
.task-title-input:focus { border-color: var(--primary) !important; background: #fff !important; }
.comment { display: flex; gap: 11px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.comment .body { white-space: pre-wrap; word-break: break-word; margin-top: 3px; }

/* ---------- Permission matrix ---------- */
.perm-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.perm-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.perm-item:last-child { border-bottom: 0; }
.perm-item .k { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); direction: ltr; }
.matrix th.role { writing-mode: horizontal-tb; text-align: center; min-width: 96px; }
.matrix td.c { text-align: center; }
.matrix .yes { color: var(--success); } .matrix .no { color: #cbd5e1; }
.matrix tr.group td { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--text-2); }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #fff; }
.auth-panel {
  background: radial-gradient(1200px 600px at 100% 0%, #312e81 0%, transparent 60%), radial-gradient(900px 500px at 0% 100%, #1e1b4b 0%, transparent 55%), linear-gradient(160deg, #0b1220, #111a2e);
  color: #e2e8f0; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-panel::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); pointer-events: none; }
.auth-panel > * { position: relative; z-index: 1; }
.auth-panel h2 { font-size: 30px; line-height: 1.25; color: #fff; font-weight: 650; margin-bottom: 14px; max-width: 460px; }
.auth-panel p.lead { color: #a5b0c6; font-size: 15px; max-width: 440px; }
.auth-features { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 14px; max-width: 440px; }
.auth-features li { display: flex; gap: 12px; align-items: flex-start; }
.auth-features .fi { width: 34px; height: 34px; border-radius: 9px; background: rgba(129,140,248,.14); border: 1px solid rgba(129,140,248,.25); color: #a5b4fc; display: grid; place-items: center; flex: none; }
.auth-features strong { color: #fff; display: block; font-weight: 550; }
.auth-features span { color: #93a0b8; font-size: 13px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 410px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 26px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.providers { display: grid; gap: 10px; }
.auth-foot { margin-top: 28px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.auth-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--primary-100); }
.auth-wide .auth-box { max-width: 520px; }

.qr-wrap { display: flex; gap: 20px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 18px; }
.qr-wrap img { width: 168px; height: 168px; border-radius: 8px; background: #fff; padding: 6px; border: 1px solid var(--border); flex: none; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 13px; background: #fff; border: 1px dashed var(--border-strong); border-radius: 7px; padding: 8px 10px; direction: ltr; text-align: center; word-break: break-all; letter-spacing: .05em; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 11px; align-items: flex-start; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; border: 1px solid var(--primary-100); }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.codes code { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px; text-align: center; font-size: 14px; letter-spacing: .06em; font-weight: 550; }

.link-box { display: flex; gap: 8px; }
.link-box input { direction: ltr; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); }

/* dialogs */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(500px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(2px); }
dialog.modal .m-head { padding: 18px 20px 6px; display: flex; gap: 12px; align-items: flex-start; }
dialog.modal .m-body { padding: 8px 20px 18px; color: var(--text-2); }
dialog.modal .m-foot { padding: 13px 20px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-start; }

.error-page { text-align: center; padding: 60px 20px; }
.error-page .code { font-size: 64px; font-weight: 700; color: var(--primary); line-height: 1; letter-spacing: -.03em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-main, .task-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; right: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .btn.menu-toggle { display: inline-flex; }
  .shell { background: var(--bg); }
  .content { padding: 18px 16px 50px; }
  .auth { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .grid-2, .grid-3, .grid-side, .form-row { grid-template-columns: 1fr; }
  .user-btn .meta { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
}
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } .qr-wrap { flex-direction: column; } }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .shell { display: block; } }

/* ---------- Stage tiles (v1.1) ---------- */
.stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stage-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; color: inherit; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.stage-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,23,42,.12); border-color: var(--border-strong); color: inherit; }
.stage-tile:focus-visible { outline: none; box-shadow: var(--focus); }
.stage-art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.stage-art svg { display: block; width: 100%; height: 100%; transition: transform .35s; }
.stage-tile:hover .stage-art svg { transform: scale(1.05); }
.stage-step { position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--text); font-weight: 650; font-size: 12.5px; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.stage-done { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); color: var(--success); font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; display: inline-flex; align-items: center; gap: 4px; }
.stage-info { padding: 14px 16px 16px; }
.stage-info h3 { font-size: 16px; }
.stage-count { min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; color: #fff; font-weight: 650; font-size: 13px; display: inline-grid; place-items: center; }
.stage-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.stage-meta span { display: inline-flex; align-items: center; gap: 4px; }
.t-danger { color: var(--danger) !important; font-weight: 500; } .t-warning { color: var(--warning) !important; font-weight: 500; }
.stage-add { border-style: dashed; border-width: 2px; background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 200px; color: var(--muted); }
.stage-add .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.stage-add strong { color: var(--text); }

.stage-head { display: flex; gap: 18px; align-items: center; padding: 14px; margin-bottom: 16px; }
.stage-thumb { width: 168px; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; flex: none; }
.stage-thumb svg { width: 100%; height: 100%; display: block; }
.stage-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip span { color: var(--muted); font-size: 11.5px; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); font-weight: 550; }

.quick-add { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.quick-add > .icon { color: var(--muted); }
.quick-add input[type=text] { flex: 1; min-width: 220px; height: 36px; }
.quick-add select, .quick-add input[type=date] { width: auto; height: 36px; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); transition: background .15s, opacity .3s; }
.task-list li:last-child { border-bottom: 0; }
.task-list li:hover { background: #fafbfe; }
.task-list li.leaving { opacity: 0; }
.tl-main { min-width: 0; color: inherit; display: flex; flex-direction: column; }
.tl-main:hover .title { color: var(--primary); }
.tl-main .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.tl-move { width: auto; height: 30px; font-size: 12.5px; padding: 0 8px; color: var(--text-2); }
.empty-art { width: 220px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; margin: 0 auto 16px; opacity: .9; }
.empty-art svg { width: 100%; height: 100%; display: block; }

@media (max-width: 1200px) { .stage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .stage-thumb { width: 110px; } .tl-meta .due, .tl-meta [title="תגובות"] { display: none; } }
@media (max-width: 480px) { .stage-info { padding: 10px 12px 12px; } .stage-info h3 { font-size: 14px; } .stage-head { flex-direction: column; align-items: stretch; } .stage-thumb { width: 100%; } }

/* ---------- System updates (v1.2) ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 34px 20px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; margin: 0; font-weight: 400; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-50); }
.dropzone.busy { pointer-events: none; opacity: .85; }
.dropzone .dz-ic { width: 60px; height: 60px; border-radius: 16px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; color: var(--primary); margin-bottom: 6px; }
.dz-progress { width: 60%; height: 6px; background: #e2e8f0; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.dz-progress i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.dz-checks li { padding: 8px 0; border: 0; color: var(--text-2); }
.dz-checks .icon { color: var(--success); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress > i { transition: width .4s; }

/* ---------- Database console (v1.3) ---------- */
.sql-editor { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; background: #0f172a !important; color: #e2e8f0 !important; border-color: #1e293b !important; text-align: left; direction: ltr; min-height: 170px; }
.sql-editor:focus { box-shadow: var(--focus); }
form.write-mode .sql-editor { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.db-grid td, .db-grid th { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; padding: 8px 12px; text-align: start; }
.db-grid td { unicode-bidi: plaintext; }
.db-grid td.null { color: #94a3b8; font-style: italic; }
.db-grid td.masked { color: var(--warning); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-align: left; font-family: ui-monospace, Menlo, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
