/* Readex Pro (OFL) — self-hosted so the app works without Google Fonts */
@font-face { font-family: "Readex Pro"; font-style: normal; font-display: swap; font-weight: 160 700;
  src: url(../fonts/readex-pro-arabic-wght-normal.woff2) format("woff2-variations"), url(../fonts/readex-pro-arabic-wght-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-display: swap; font-weight: 160 700;
  src: url(../fonts/readex-pro-latin-ext-wght-normal.woff2) format("woff2-variations"), url(../fonts/readex-pro-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Readex Pro"; font-style: normal; font-display: swap; font-weight: 160 700;
  src: url(../fonts/readex-pro-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/readex-pro-latin-wght-normal.woff2) format("woff2");
  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; }

/* EA Team Hub — design system
   Developed by Eslam Abdullah — eslamabdullah.com
   Palette lifted from the EA shield: armour navy + crest crimson. */

:root {
  --navy: #00163C;
  --navy-2: #0A2350;
  --navy-3: #163266;
  --navy-ink: #A9B6D3;
  --crimson: #B11317;
  --crimson-2: #8F0D11;
  --crimson-soft: #FBE9EA;
  --paper: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --ink: #0D1830;
  --muted: #5B6880;
  --faint: #8A95A9;
  --line: #DCE1EA;
  --line-2: #E9EDF3;
  --ok: #0D7A57;     --ok-soft: #E3F4EE;
  --warn: #A86400;   --warn-soft: #FDF1DE;
  --info: #1D5BB8;   --info-soft: #E5EEFB;
  --danger: var(--crimson); --danger-soft: var(--crimson-soft);
  --radius: 10px;
  --radius-lg: 16px;
  --cut: 9px;
  --shadow: 0 1px 2px rgba(0, 22, 60, .06), 0 8px 24px -12px rgba(0, 22, 60, .18);
  --shadow-lg: 0 24px 60px -20px rgba(0, 22, 60, .45);
  --font: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
  --sidebar-w: 252px;
  --topbar-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #060E1F;
  --surface: #0C1830;
  --surface-2: #0F1E3A;
  --ink: #E5EAF4;
  --muted: #95A2BA;
  --faint: #6C7A94;
  --line: #1C2C4C;
  --line-2: #16243F;
  --crimson-soft: #3A0E14;
  --ok-soft: #0B2E26; --warn-soft: #33240A; --info-soft: #0F2547;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
svg.ico { width: 20px; height: 20px; flex: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); direction: ltr; display: inline-block; }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
[dir="ltr"], .ltr { direction: ltr; unicode-bidi: plaintext; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--crimson); color: #fff; }

/* the armour-plate cut: two clipped corners, used only on primary surfaces */
.plate { clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 500; font-size: 14px;
  transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  background: var(--crimson); border-color: var(--crimson); color: #fff; border-radius: 0;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
.btn-primary:hover { background: var(--crimson-2); border-color: var(--crimson-2); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-danger { color: var(--crimson); }
.btn-danger:hover { background: var(--crimson-soft); border-color: var(--crimson); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=datetime-local], input[type=date], input[type=color], input:not([type]), select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 400; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(22, 50, 102, .14); }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus, :root[data-theme="dark"] textarea:focus { border-color: #4C6BA8; box-shadow: 0 0 0 3px rgba(76, 107, 168, .25); }
input[type=color] { padding: 4px; width: 56px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid h3 { font-size: 15px; color: var(--ink); margin-top: 6px; }
.span-2 { grid-column: span 2; }
.field-hint { font-size: 12px; color: var(--faint); font-weight: 400; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink); font-weight: 400; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--crimson); }

/* switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--crimson); }
.switch input:checked + span::after { transform: translateX(-18px); }

/* ---------- alerts, chips ---------- */
.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; border: 1px solid; margin-bottom: 12px; }
.alert-danger { background: var(--crimson-soft); border-color: rgba(177, 19, 23, .3); color: var(--crimson); }
.alert-ok { background: var(--ok-soft); border-color: rgba(13, 122, 87, .3); color: var(--ok); }
.alert-info { background: var(--info-soft); border-color: rgba(29, 91, 184, .25); color: var(--info); }
:root[data-theme="dark"] .alert-danger { color: #FF9EA1; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-2); }
.chip svg { width: 13px; height: 13px; }
.chip-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-low    { color: var(--muted); }
.p-medium { color: var(--info); background: var(--info-soft); border-color: transparent; }
.p-high   { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.p-urgent { color: #fff; background: var(--crimson); border-color: transparent; }
.s-todo { color: var(--muted); }
.s-in_progress { color: var(--info); background: var(--info-soft); border-color: transparent; }
.s-review { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.s-done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.due-overdue { color: #fff; background: var(--crimson); border-color: transparent; }
.due-soon { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.due-done { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--crimson); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.badge:empty, .badge[data-count="0"] { display: none; }

/* ---------- avatar ---------- */
.avatar { position: relative; display: inline-flex; flex: none; border-radius: 50%; }
.avatar img, .avatar > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar > span { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; letter-spacing: 0; }
.presence { position: absolute; bottom: -1px; left: -1px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: var(--faint); }
.presence.is-online { background: #19B47D; }
.presence.is-busy { background: var(--crimson); }
.presence.is-away { background: #E3A008; }
.presence.is-offline { background: #A3ADBF; }
.avatar-stack { display: inline-flex; flex-direction: row; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-inline-start: -8px; }
.avatar-more { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; box-shadow: 0 0 0 2px var(--surface); margin-inline-start: -8px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; z-index: 40;
}
/* the shield tip: the sidebar ends in a point, echoing the logo */
.sidebar::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.sidebar-brand img { width: 34px; height: auto; }
.sidebar-brand b { display: block; font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar-brand small { display: block; font-size: 11.5px; color: var(--navy-ink); font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11.5px; color: #6F80A6; padding: 14px 10px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
  border-radius: 8px; color: #C9D3EA; font-size: 14px; font-weight: 400; transition: background .15s, color .15s;
}
.nav-item svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--navy-3); color: #fff; font-weight: 500; }
.nav-item.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 9px; bottom: 9px; width: 4px; background: var(--crimson); border-radius: 0 3px 3px 0; }
.nav-item .badge { margin-inline-start: auto; }
.sidebar-tip {
  position: relative; margin-top: auto; padding: 18px 20px 54px;
  background: var(--navy-2);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 38px), 50% 100%, 0 calc(100% - 38px));
}
.sidebar-tip::before { content: ""; position: absolute; top: 0; inset-inline: 20px; height: 2px; background: linear-gradient(90deg, transparent, var(--crimson), transparent); }
.credit { display: flex; align-items: center; gap: 10px; color: var(--navy-ink); font-size: 12px; line-height: 1.45; }
.credit img { width: 22px; }
.credit b { color: #fff; font-weight: 500; display: block; }
.credit:hover b { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.topbar h1 { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn.menu-toggle { display: none; }
.search-box { position: relative; width: min(340px, 34vw); }
.search-box input { height: 40px; padding-inline-start: 38px; background: var(--surface); border-color: var(--line-2); }
.search-box svg { position: absolute; inset-inline-start: 12px; top: 11px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search-box kbd { position: absolute; inset-inline-end: 10px; top: 10px; font-family: inherit; font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; height: 20px; line-height: 18px; background: var(--surface-2); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .badge { position: absolute; top: 3px; inset-inline-end: 2px; min-width: 18px; height: 18px; font-size: 10.5px; border: 2px solid var(--paper); }
.bell.ring svg { animation: ring .9s ease; transform-origin: 50% 3px; }
@keyframes ring { 0%,100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-7deg); } 75% { transform: rotate(3deg); } }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); }
.user-chip b { font-size: 13.5px; font-weight: 500; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 24px; flex: 1; min-width: 0; }
.content-narrow { max-width: 880px; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown.open > .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu a, .dropdown-menu button.dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; font-size: 14px;
  border: 0; background: none; text-align: start; color: var(--ink);
}
.dropdown-menu a:hover, .dropdown-menu button.dd-item:hover { background: var(--surface-2); }
.dropdown-menu svg { width: 18px; height: 18px; color: var(--muted); }
.dd-sep { height: 1px; background: var(--line-2); margin: 6px 4px; }
.dd-head { padding: 8px 10px; font-size: 12px; color: var(--faint); }
.status-pick { display: flex; gap: 6px; padding: 4px 6px 8px; }
.status-pick button { flex: 1; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.status-pick button.on { border-color: var(--navy-3); background: var(--surface); }
.status-pick i { width: 8px; height: 8px; border-radius: 50%; }

/* notifications panel */
.notif-panel { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-2); }
.notif-head h3 { font-size: 15px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); position: relative; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--crimson-soft) 45%, var(--surface)); }
.notif-item.unread::after { content: ""; position: absolute; inset-inline-end: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--navy-3); }
:root[data-theme="dark"] .notif-ico { color: #8FA8DA; }
.notif-ico svg { width: 19px; height: 19px; }
.notif-ico.t-alert { background: var(--crimson-soft); color: var(--crimson); }
.notif-ico.t-success { background: var(--ok-soft); color: var(--ok); }
.notif-ico.t-mention { background: var(--warn-soft); color: var(--warn); }
.notif-item b { display: block; font-size: 13.5px; font-weight: 500; padding-inline-end: 14px; }
.notif-item p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item time { font-size: 11.5px; color: var(--faint); }
.notif-foot { display: block; text-align: center; padding: 11px; font-size: 13px; color: var(--crimson); font-weight: 500; }

/* enable-alerts banner */
.alert-banner {
  display: flex; align-items: center; gap: 14px; margin: 16px 24px 0; padding: 12px 16px;
  background: var(--navy); color: #fff; border-radius: 12px; position: relative; overflow: hidden;
}
.alert-banner::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--crimson); }
.alert-banner svg { width: 26px; height: 26px; flex: none; color: #fff; }
.alert-banner p { flex: 1; font-size: 14px; }
.alert-banner small { display: block; color: var(--navy-ink); font-size: 12.5px; }
.alert-banner .btn-primary { height: 36px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.panel-head h2 { font-size: 15.5px; font-weight: 600; }
.panel-head .spacer { flex: 1; }
.panel-head a.link { font-size: 13px; color: var(--crimson); font-weight: 500; }
.panel-body { padding: 16px 18px 18px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .spacer { flex: 1; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line); margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; gap: 2px; }
.segmented button, .segmented a { height: 32px; padding: 0 12px; border: 0; background: none; border-radius: 7px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.segmented button svg, .segmented a svg { width: 16px; height: 16px; }
.segmented .on { background: var(--navy); color: #fff; }

/* ---------- dashboard ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px; margin-bottom: 20px;
  background: var(--navy); color: #fff; display: flex; align-items: center; gap: 24px;
}
.hero::after {
  /* chevron bands from the shield, drawn huge and faint */
  content: ""; position: absolute; inset-inline-end: -40px; top: -60px; width: 360px; height: 360px; opacity: .13;
  background:
    linear-gradient(135deg, transparent 46%, #fff 46%, #fff 50%, transparent 50%) ,
    linear-gradient(225deg, transparent 46%, #fff 46%, #fff 50%, transparent 50%);
  background-size: 100% 100%;
  transform: rotate(180deg);
}
.hero h2 { font-size: 26px; font-weight: 600; }
.hero p { color: var(--navy-ink); margin-top: 6px; max-width: 54ch; }
.hero .hero-actions { margin-inline-start: auto; display: flex; gap: 10px; position: relative; z-index: 1; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.08); }
.hero-date { font-size: 13px; color: var(--navy-ink); margin-bottom: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi {
  position: relative; background: var(--surface); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi strong { font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12.5px; color: var(--faint); }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--navy-3); }
:root[data-theme="dark"] .kpi-ico { color: #8FA8DA; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi.is-alert { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.kpi.is-alert span, .kpi.is-alert small { color: rgba(255,255,255,.82); }
.kpi.is-alert .kpi-ico { background: rgba(255,255,255,.14); color: #fff; }
.kpi-bar { height: 5px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.kpi-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.chart-box { position: relative; height: 250px; }
.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.donut-wrap .chart-box { height: 150px; }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-inline-start: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.deadline-list { display: flex; flex-direction: column; }
.deadline { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.deadline:last-child { border-bottom: 0; }
.deadline-date { width: 46px; flex: none; text-align: center; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; }
.deadline-date b { display: block; font-size: 17px; font-weight: 600; line-height: 1.5; }
.deadline-date small { display: block; font-size: 10.5px; background: var(--navy); color: #fff; line-height: 1.7; }
.deadline-date.is-overdue small { background: var(--crimson); }
.deadline-info { flex: 1; min-width: 0; }
.deadline-info a { font-weight: 500; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-info a:hover { color: var(--crimson); }

.team-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.team-table th { text-align: start; font-weight: 500; color: var(--faint); font-size: 12px; padding: 0 8px 8px; }
.team-table td { padding: 9px 8px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.team-table .who { display: flex; align-items: center; gap: 10px; }
.team-table .who b { font-weight: 500; display: block; }
.rate { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.rate .kpi-bar { flex: 1; margin: 0; }
.rate .kpi-bar i.low { background: var(--crimson); }
.rate .kpi-bar i.mid { background: #D48A00; }

.feed { display: flex; flex-direction: column; gap: 14px; }
.feed-item { display: flex; gap: 10px; font-size: 13.5px; }
.feed-item p { color: var(--muted); }
.feed-item p b { color: var(--ink); font-weight: 500; }
.feed-item time { font-size: 12px; color: var(--faint); }

.announce { padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); position: relative; }
.announce + .announce { margin-top: 10px; }
.announce h3 { font-size: 14.5px; font-weight: 600; padding-inline-end: 28px; }
.announce p { font-size: 13.5px; color: var(--muted); margin-top: 4px; white-space: pre-line; }
.announce .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--faint); }
.announce .del { position: absolute; top: 10px; inset-inline-end: 10px; }
.announce.pinned { border-color: rgba(177,19,23,.35); background: color-mix(in srgb, var(--crimson-soft) 50%, var(--surface)); }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 10px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px;
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2);
}
.toast::after { content: ""; position: absolute; bottom: 0; inset-inline-start: 0; height: 3px; background: var(--crimson); animation: toast-life var(--life, 6s) linear forwards; }
.toast.t-success::after { background: #19B47D; }
.toast .notif-ico { background: rgba(255,255,255,.1); color: #fff; }
.toast b { display: block; font-size: 13.5px; font-weight: 500; }
.toast p { font-size: 13px; color: var(--navy-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast-x { margin-inline-start: auto; background: none; border: 0; color: var(--navy-ink); width: 24px; height: 24px; padding: 0; flex: none; }
.toast-x:hover { color: #fff; }
.toast.leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(-30px); } }
@keyframes toast-life { from { width: 100%; } to { width: 0; } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: rgba(0, 10, 30, .55); backdrop-filter: blur(3px); overflow-y: auto; }
.modal.open { display: flex; animation: fade .15s ease; }
.modal-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.15); }
.modal-box.sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 17px; flex: 1; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* people picker */
.picker { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; background: var(--surface); max-height: 180px; overflow-y: auto; }
.picker label { flex-direction: row; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-weight: 400; font-size: 13px; cursor: pointer; user-select: none; }
.picker label:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.picker input { display: none; }

/* drop zone */
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px; text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone svg { width: 18px; height: 18px; display: inline-block; vertical-align: -4px; margin-inline-end: 4px; }
.dropzone:hover, .dropzone.over { border-color: var(--crimson); background: var(--crimson-soft); color: var(--crimson); }
.file-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; max-width: 240px; }
.file-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pill button { border: 0; background: none; color: var(--faint); padding: 0; width: 18px; height: 18px; flex: none; }
.file-pill button:hover { color: var(--crimson); }
.file-pill img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }

/* ---------- attachments & voice ---------- */
.att-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att-img { display: block; width: 210px; max-width: 100%; aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; border: 1px solid var(--line-2); }
.att-img img { width: 100%; height: 100%; object-fit: cover; }
.att-grid.multi .att-img { width: 140px; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: 320px; min-width: 220px; }
.att-file:hover { border-color: var(--faint); }
.att-file .ext { width: 38px; height: 44px; border-radius: 6px; flex: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; font-size: 10px; font-weight: 700; color: #fff; background: var(--navy-3); text-transform: uppercase; clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); }
.att-file .ext.k-pdf { background: var(--crimson); }
.att-file .ext.k-doc { background: #2559B8; }
.att-file .ext.k-archive { background: #7A5A12; }
.att-file .ext.k-video { background: #6B2FA8; }
.att-file .meta { min-width: 0; flex: 1; }
.att-file > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.att-file b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file small { font-size: 11.5px; color: var(--faint); }
.att-video { max-width: 320px; border-radius: 10px; background: #000; }

.voice { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); width: 280px; max-width: 100%; }
.voice-play { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--crimson); color: #fff; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; }
.voice-play svg { width: 16px; height: 16px; }
.voice-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; direction: ltr; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--line); transition: background .1s; }
.voice-wave i.on { background: var(--crimson); }
.voice-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.voice-speed { border: 0; background: var(--surface-2); border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--muted); height: 22px; padding: 0 6px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 8, 24, .92); display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; box-shadow: var(--shadow-lg); }
.lightbox .lb-bar { position: absolute; top: 16px; inset-inline: 16px; display: flex; justify-content: space-between; color: #fff; font-size: 14px; }
.lightbox .icon-btn { color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255,255,255,.1); border-color: transparent; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--topbar-h)); background: var(--surface); border-top: 0; }
.chat-side { border-inline-end: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.chat-side-head { padding: 14px 14px 10px; display: flex; gap: 8px; }
.chat-side-head input { height: 38px; font-size: 13.5px; }
.conv-groups { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.conv-group-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 6px; font-size: 12px; color: var(--faint); font-weight: 500; }
.conv-group-title button { border: 0; background: none; color: var(--faint); width: 24px; height: 24px; border-radius: 6px; padding: 0; display: flex; align-items: center; justify-content: center; }
.conv-group-title button:hover { background: var(--line-2); color: var(--ink); }
.conv-group-title svg { width: 16px; height: 16px; }
.conv { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; position: relative; }
.conv:hover { background: var(--line-2); }
.conv.active { background: var(--surface); box-shadow: var(--shadow); }
.conv.active::before { content: ""; position: absolute; inset-inline-start: -8px; top: 12px; bottom: 12px; width: 3px; background: var(--crimson); border-radius: 0 3px 3px 0; }
.conv-hash { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex: none; }
.conv-hash.private { background: var(--navy-3); }
.conv-hash svg { width: 16px; height: 16px; }
.conv-info { flex: 1; min-width: 0; }
.conv-info b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-info small { display: block; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .conv-info b { font-weight: 700; }
.conv.unread .conv-info small { color: var(--ink); }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv-meta time { font-size: 11px; color: var(--faint); }
.conv .muted-ico { width: 14px; height: 14px; color: var(--faint); }

.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); min-height: 62px; }
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-info b { display: block; font-size: 15px; font-weight: 600; }
.chat-head-info small { display: block; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 18px 8px; display: flex; flex-direction: column; background: var(--paper); }
.messages .load-more { align-self: center; margin-bottom: 10px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; font-size: 12px; color: var(--faint); }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-sep span { padding: 2px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); }
.msg { display: flex; gap: 10px; padding: 3px 0; position: relative; }
.msg .avatar { margin-top: 2px; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg-body { min-width: 0; max-width: min(640px, 82%); display: flex; flex-direction: column; align-items: flex-start; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-meta b { font-size: 13.5px; font-weight: 600; }
.msg-meta time { font-size: 11.5px; color: var(--faint); }
.msg.cont .msg-meta { display: none; }
.bubble {
  background: var(--surface); border: 1px solid var(--line-2); padding: 8px 12px; border-radius: 4px 14px 14px 14px;
  font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}
.msg.mine { flex-direction: row-reverse; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .msg-meta { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 14px 4px 14px 14px; }
.msg.mine .bubble a { color: #fff; }
.msg.mine .bubble .mention { background: rgba(255,255,255,.16); color: #fff; }
.bubble a { color: var(--info); text-decoration: underline; text-underline-offset: 2px; }
.mention { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 500; }
.mention.me { background: var(--crimson); color: #fff; }
.msg.deleted .bubble { font-style: italic; color: var(--faint); background: transparent; border-style: dashed; }
.msg.mine.deleted .bubble { color: var(--faint); background: transparent; border-color: var(--line); }
.msg-edited { font-size: 11px; color: var(--faint); margin-top: 2px; }
.msg-reply { font-size: 12.5px; border-inline-start: 3px solid var(--crimson); padding: 4px 10px; margin-bottom: 4px; background: var(--surface); border-radius: 6px; color: var(--muted); max-width: 100%; cursor: pointer; }
.msg-reply b { color: var(--ink); font-weight: 500; }
.msg-actions { position: absolute; top: -10px; inset-inline-end: 0; display: none; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); z-index: 2; }
.msg.mine .msg-actions { inset-inline-end: auto; inset-inline-start: 0; }
.msg:hover .msg-actions { display: flex; }
.msg-actions button { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; color: var(--muted); padding: 0; display: flex; align-items: center; justify-content: center; }
.msg-actions button:hover { background: var(--surface-2); color: var(--ink); }
.msg-actions svg { width: 16px; height: 16px; }
.msg.system { justify-content: center; }
.msg.system .bubble { background: transparent; border: 0; color: var(--faint); font-size: 13px; text-align: center; padding: 4px; }
.msg.flash .bubble { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px rgba(177, 19, 23, .35); } }
.read-receipt { font-size: 11px; color: var(--faint); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.read-receipt svg { width: 15px; height: 15px; }
.read-receipt.seen { color: #1D8FE1; }
.typing { height: 22px; padding: 0 18px; font-size: 12.5px; color: var(--muted); background: var(--paper); display: flex; align-items: center; gap: 8px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.jump-new { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); z-index: 5; box-shadow: var(--shadow-lg); }

.composer { padding: 10px 18px 16px; background: var(--paper); }
.composer-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px; transition: border-color .15s, box-shadow .15s; position: relative; }
.composer-box:focus-within { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(22, 50, 102, .1); }
.composer-box.over { border-color: var(--crimson); background: var(--crimson-soft); }
.composer-row { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea { flex: 1; border: 0; min-height: 40px; max-height: 180px; height: 40px; padding: 9px 8px; resize: none; background: transparent; box-shadow: none !important; font-size: 14.5px; }
.composer .icon-btn { width: 38px; height: 38px; flex: none; }
.send-btn { width: 40px; height: 40px; flex: none; border: 0; background: var(--crimson); color: #fff; display: flex; align-items: center; justify-content: center; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.send-btn:hover { background: var(--crimson-2); }
.send-btn svg { width: 19px; height: 19px; transform: scaleX(-1); }
.send-btn:disabled { opacity: .5; }
.mic-btn.recording { background: var(--crimson); color: #fff; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.reply-bar div { flex: 1; min-width: 0; border-inline-start: 3px solid var(--crimson); padding-inline-start: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar b { color: var(--ink); font-weight: 500; }
.rec-bar { display: flex; align-items: center; gap: 12px; padding: 4px 6px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--crimson); animation: pulse 1.2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(177, 19, 23, .6); } 70% { box-shadow: 0 0 0 10px rgba(177, 19, 23, 0); } 100% { box-shadow: 0 0 0 0 rgba(177, 19, 23, 0); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; min-width: 48px; }
.rec-level { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; direction: ltr; overflow: hidden; }
.rec-level i { width: 3px; flex: none; border-radius: 2px; background: var(--crimson); opacity: .8; }
.mention-menu { position: absolute; bottom: calc(100% + 6px); inset-inline-start: 8px; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 10; max-height: 240px; overflow-y: auto; }
.mention-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 8px; text-align: start; font-size: 13.5px; }
.mention-menu button.on, .mention-menu button:hover { background: var(--surface-2); }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; color: var(--muted); padding: 24px; background: var(--paper); }
.chat-empty img { width: 84px; opacity: .9; }
.chat-empty h2 { color: var(--ink); font-size: 20px; }

/* ---------- tasks ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.toolbar select { width: auto; height: 38px; font-size: 13.5px; }
.toolbar .search-box { width: 240px; }
.toolbar .search-box input { height: 38px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 210px); min-height: 200px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.col-head h3 { font-size: 14px; font-weight: 600; }
.col-head .count { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 8px; line-height: 20px; }
.col-head .stripe { width: 10px; height: 10px; border-radius: 3px; }
.col-body { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 80px; transition: background .15s; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.col-body.over { background: color-mix(in srgb, var(--crimson-soft) 60%, transparent); outline: 2px dashed rgba(177,19,23,.4); outline-offset: -6px; }
.col-add { margin: 0 10px 12px; border: 1.5px dashed var(--line); background: none; border-radius: 10px; height: 38px; color: var(--muted); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.col-add:hover { border-color: var(--crimson); color: var(--crimson); }
.col-add svg { width: 16px; height: 16px; }
.tcard {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 12px 10px; cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 22, 60, .05); transition: box-shadow .15s, transform .15s, border-color .15s; position: relative; display: block;
}
.tcard:hover { box-shadow: var(--shadow); border-color: var(--line); }
.tcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.tcard.is-overdue { border-color: rgba(177,19,23,.45); }
.tcard.is-overdue::before { content: ""; position: absolute; inset-inline-start: -1px; top: 12px; bottom: 12px; width: 3px; background: var(--crimson); border-radius: 0 3px 3px 0; }
.tcard-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tcard h4 { font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 4px; }
.tcard p { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.tcard-progress { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin: 6px 0 4px; }
.tcard-progress .kpi-bar { flex: 1; margin: 0; height: 4px; }
.tcard-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--faint); }
.tcard-foot .counts { display: flex; gap: 10px; margin-inline-start: auto; }
.tcard-foot .counts span { display: inline-flex; align-items: center; gap: 3px; }
.tcard-foot svg { width: 14px; height: 14px; }

.task-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.task-table th { text-align: start; padding: 12px 14px; font-size: 12px; color: var(--faint); font-weight: 500; border-bottom: 1px solid var(--line-2); }
.task-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.task-table tr:hover td { background: var(--surface-2); }
.task-table td a.t { font-weight: 500; }
.task-table td a.t:hover { color: var(--crimson); }
.table-wrap { overflow-x: auto; }

.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.task-title { font-size: 24px; font-weight: 600; line-height: 1.35; }
.task-desc { font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.task-desc:empty::before { content: "مافيش وصف."; color: var(--faint); }
.countdown {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--navy); color: #fff;
}
.countdown.is-overdue { background: var(--crimson); }
.countdown.is-done { background: var(--ok); }
.countdown svg { width: 26px; height: 26px; flex: none; }
.countdown b { display: block; font-size: 17px; font-weight: 600; }
.countdown small { color: rgba(255,255,255,.8); font-size: 12.5px; }
.countdown .cd-units { display: flex; gap: 6px; margin-inline-start: auto; direction: rtl; }
.countdown .cd-units div { text-align: center; background: rgba(255,255,255,.12); border-radius: 8px; padding: 4px 8px; min-width: 46px; }
.countdown .cd-units strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.countdown .cd-units span { font-size: 10.5px; color: rgba(255,255,255,.75); }
.side-list { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.side-list dt { color: var(--faint); font-size: 12px; margin-bottom: 4px; }
.side-list dd { margin: 0; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { font-weight: 500; display: block; font-size: 13.5px; }
.person small { color: var(--faint); font-size: 12px; }

.checklist { display: flex; flex-direction: column; gap: 2px; }
.ck { display: flex; flex-direction: row; color: var(--ink); font-weight: 400; cursor: pointer; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.ck:hover { background: var(--surface-2); }
.ck input { width: 18px; height: 18px; accent-color: var(--ok); flex: none; cursor: pointer; }
.ck span { flex: 1; font-size: 14px; }
.ck.done span { text-decoration: line-through; color: var(--faint); }
.ck .del { opacity: 0; }
.ck:hover .del { opacity: 1; }
.ck-add { display: flex; gap: 8px; margin-top: 8px; }
.ck-add input { height: 36px; }

.timeline { display: flex; flex-direction: column; gap: 16px; }
.tl-item { display: flex; gap: 12px; }
.tl-item .tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.tl-head b { font-weight: 600; }
.tl-head time { color: var(--faint); font-size: 12px; }
.tl-text { margin-top: 4px; font-size: 14px; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--line-2); padding: 9px 12px; border-radius: 4px 12px 12px 12px; }
.tl-item.k-submission .tl-text { background: var(--warn-soft); border-color: transparent; }
.tl-item.k-approved .tl-text { background: var(--ok-soft); border-color: transparent; }
.tl-item.k-returned .tl-text { background: var(--crimson-soft); border-color: transparent; }
.tl-item.k-system .tl-text { background: none; border: 0; padding: 0; color: var(--muted); font-size: 13px; }
.tl-tag { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.tl-tag.k-submission { background: var(--warn); color: #fff; }
.tl-tag.k-approved { background: var(--ok); color: #fff; }
.tl-tag.k-returned { background: var(--crimson); color: #fff; }
.comment-box { border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: var(--surface); }
.comment-box textarea { border: 0; box-shadow: none !important; min-height: 70px; }
.comment-tools { display: flex; align-items: center; gap: 4px; padding: 4px; }
.comment-tools .spacer { flex: 1; }

/* ---------- calendar ---------- */
.cal { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.cal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.cal-head h2 { font-size: 18px; flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 10px; font-size: 12px; color: var(--faint); font-weight: 500; text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.cal-day { min-height: 118px; border-inline-start: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day:nth-child(7n+1) { border-inline-start: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-num { color: var(--faint); }
.cal-num { font-size: 13px; font-weight: 500; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--crimson); color: #fff; }
.cal-ev { display: block; font-size: 12px; padding: 3px 7px; border-radius: 6px; background: var(--info-soft); color: var(--info); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-inline-start: 3px solid currentColor; }
.cal-ev.p-high { background: var(--warn-soft); color: var(--warn); }
.cal-ev.p-urgent { background: var(--crimson-soft); color: var(--crimson); }
.cal-ev.p-low { background: var(--surface-2); color: var(--muted); }
.cal-ev.is-done { opacity: .55; text-decoration: line-through; }
.cal-ev.is-overdue { background: var(--crimson); color: #fff; }
.cal-more { font-size: 11.5px; color: var(--muted); padding: 0 6px; }

/* ---------- files ---------- */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.fcard { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.fcard-thumb { aspect-ratio: 4/3; background: var(--surface-2); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; overflow: hidden; }
.fcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fcard-thumb .big-ext { font-size: 22px; font-weight: 700; color: #fff; width: 64px; height: 76px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; background: var(--navy-3); clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); text-transform: uppercase; }
.fcard-thumb .big-ext.k-pdf { background: var(--crimson); } .fcard-thumb .big-ext.k-doc { background: #2559B8; } .fcard-thumb .big-ext.k-archive { background: #7A5A12; } .fcard-thumb .big-ext.k-video { background: #6B2FA8; }
.fcard-thumb .voice { width: calc(100% - 20px); }
.fcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.fcard-body b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-body small { font-size: 11.5px; color: var(--faint); }
.fcard-src { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.fcard-src a:hover { color: var(--crimson); }
.fcard-src > svg { width: 15px; height: 15px; }
.fcard-src .icon-btn svg { width: 17px; height: 17px; }

/* ---------- team ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.member { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); padding: 20px; text-align: center; box-shadow: var(--shadow); position: relative; }
.member.inactive { opacity: .55; }
.member .avatar { margin: 0 auto 10px; }
.member h3 { font-size: 15.5px; }
.member .role { font-size: 12.5px; color: var(--muted); }
.member-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 14px 0; padding: 10px 0; border-block: 1px solid var(--line-2); }
.member-stats b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.member-stats small { font-size: 11.5px; color: var(--faint); }
.member-actions { display: flex; gap: 8px; justify-content: center; }
.role-tag { position: absolute; top: 14px; inset-inline-start: 14px; font-size: 11px; }

/* ---------- search & generic lists ---------- */
.result-group { margin-bottom: 22px; }
.result-group h2 { font-size: 15px; margin-bottom: 10px; color: var(--muted); font-weight: 500; }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; }
.result:hover { border-color: var(--faint); }
.result b { font-weight: 500; }
.result p { font-size: 13px; color: var(--muted); }
mark { background: var(--warn-soft); color: inherit; padding: 0 2px; border-radius: 3px; }

.settings-grid { display: grid; grid-template-columns: 1fr; gap: 20px; max-width: 820px; }
.setting-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .txt { flex: 1; }
.setting-row b { font-weight: 500; display: block; font-size: 14px; }
.setting-row small { color: var(--muted); font-size: 13px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { direction: ltr; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---------- auth ---------- */
.auth-body { background: var(--surface); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(0, 1.15fr); }
.auth-brand {
  position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(135deg, transparent 0 46px, rgba(255,255,255,.03) 46px 48px),
    radial-gradient(600px 400px at 100% 100%, rgba(177,19,23,.35), transparent 70%);
}
.auth-brand > * { position: relative; }
.auth-logo { width: 120px; margin-bottom: 12px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); }
.auth-brand h1 { font-size: 34px; font-weight: 600; line-height: 1.25; max-width: 14ch; }
.auth-brand p { color: var(--navy-ink); font-size: 16px; max-width: 40ch; }
.auth-feats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; font-size: 14px; color: #D7DFF0; }
.auth-feats li { display: flex; align-items: center; gap: 10px; }
.auth-feats svg { width: 18px; height: 18px; color: #fff; padding: 3px; background: var(--crimson); border-radius: 5px; box-sizing: content-box; }
.auth-credit { position: absolute !important; bottom: 24px; inset-inline-start: 48px; font-size: 12.5px; color: var(--navy-ink); }
.auth-credit:hover { color: #fff; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px; max-width: 520px; width: 100%; margin: 0 auto; gap: 16px; }
.auth-panel--wide { max-width: 640px; }
.auth-panel h2 { font-size: 26px; font-weight: 600; }
.auth-panel form { display: flex; flex-direction: column; gap: 14px; }
.auth-panel .form-grid { display: grid; }
.checklist-req { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13.5px; }
.checklist-req li { display: flex; align-items: center; gap: 8px; }
.checklist-req span { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex: none; }
.checklist-req .ok span { background: var(--ok); }
.checklist-req .bad span { background: var(--crimson); }
.checklist-req .bad { color: var(--crimson); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; inset-inline-end: 6px; top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .task-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,10,30,.5); z-index: 35; }
  .icon-btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 8px; }
  .search-box { display: none; }
  .user-chip b { display: none; }
  .user-chip { padding: 3px; }
  .content { padding: 16px; }
  .alert-banner { margin: 12px 16px 0; flex-wrap: wrap; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-conv .chat-side { display: none; }
  .chat:not(.has-conv) .chat-main { display: none; }
  .chat-back { display: inline-flex; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; max-height: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 36px 24px 64px; min-height: auto; }
  .auth-brand h1 { font-size: 26px; }
  .auth-logo { width: 76px; }
  .auth-feats { display: none; }
  .auth-credit { inset-inline-start: 24px; bottom: 18px; }
  .auth-panel { padding: 28px 22px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero::after { display: none; }
  .hero .hero-actions { margin-inline-start: 0; }
}
@media (max-width: 640px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 28px; }
  .form-grid, .checklist-req { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cal-day { min-height: 74px; padding: 3px; }
  .cal-ev { font-size: 10.5px; padding: 1px 4px; }
  .donut-wrap { grid-template-columns: 1fr; }
  .toolbar .search-box { width: 100%; }
  .msg-body { max-width: 88%; }
  .countdown { flex-wrap: wrap; }
  .countdown .cd-units { margin-inline-start: 0; }
  .toasts { inset-inline-start: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
