/* ============================================================
   Capital Agro — Requests & Development Tracker
   Hand-rolled design system · glassmorphism · RTL-aware
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg0: #06120D;
  --bg1: #0A1F18;
  --bg2: #0D2B1F;
  --glass: rgba(255, 255, 255, .065);
  --glass-2: rgba(255, 255, 255, .10);
  --line: rgba(255, 255, 255, .14);
  --line-soft: rgba(255, 255, 255, .09);
  --text: #EAF4EE;
  --text-dim: #A9C6B8;
  --text-faint: #7E9C8E;
  --gold: #E8B84B;
  --gold-2: #D89A2A;
  --gold-soft: rgba(232, 184, 75, .16);
  --green: #2FBF71;
  --green-soft: rgba(47, 191, 113, .14);
  --red: #E76F51;
  --red-soft: rgba(231, 111, 81, .14);
  --blue: #4DA8DA;
  --blue-soft: rgba(77, 168, 218, .14);
  --purple: #A78BFA;
  --purple-soft: rgba(167, 139, 250, .14);
  --amber: #E8B84B;
  --amber-soft: rgba(232, 184, 75, .14);
  --teal: #45C4B0;
  --teal-soft: rgba(69, 196, 176, .14);
  --slate: #8CA3A6;
  --slate-soft: rgba(140, 163, 166, .14);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow: 0 18px 44px rgba(0, 0, 0, .38);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .28);
  --sidebar-w: 268px;
  --topbar-h: 66px;
  --font: 'Manrope', 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Manrope', ui-monospace, 'Cascadia Mono', monospace;
  --ease: cubic-bezier(.22, .8, .32, 1);
}
html[dir='rtl'] { --font: 'Cairo', 'Manrope', system-ui, sans-serif; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(18, 120, 76, .35), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(232, 184, 75, .10), transparent 55%),
    linear-gradient(160deg, var(--bg2), var(--bg1) 45%, var(--bg0));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { flex: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic-svg { display: inline-block; vertical-align: -3px; }
button { font-family: inherit; }
::selection { background: rgba(232, 184, 75, .35); }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Animated background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; animation: drift 26s var(--ease) infinite alternate; }
.b1 { width: 480px; height: 480px; background: rgba(18, 120, 76, .5); top: -160px; inset-inline-end: -80px; }
.b2 { width: 420px; height: 420px; background: rgba(232, 184, 75, .16); bottom: -140px; inset-inline-start: -120px; animation-delay: -8s; }
.b3 { width: 320px; height: 320px; background: rgba(77, 168, 218, .18); top: 42%; inset-inline-end: -140px; animation-delay: -16s; }
.b4 { width: 260px; height: 260px; background: rgba(47, 191, 113, .2); top: 8%; inset-inline-start: 30%; animation-delay: -4s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-40px, 40px, 0) scale(1.15); }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  background: linear-gradient(180deg, rgba(10, 31, 24, .82), rgba(8, 23, 17, .9));
  backdrop-filter: blur(22px) saturate(140%);
  border-inline-end: 1px solid var(--line-soft);
  z-index: 40;
  transition: transform .28s var(--ease);
}
.sidebar-brand { padding: 4px 8px 18px; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; }
.brand-logo { height: 58px; width: auto; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-label {
  font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-faint); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text-dim); font-weight: 600; font-size: 14.5px;
  cursor: pointer; border: 1px solid transparent; user-select: none;
  transition: background .18s, color .18s, border-color .18s;
  position: relative;
}
.nav-item svg { opacity: .85; }
.nav-item:hover { background: var(--glass); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--gold-soft); color: var(--gold); border-color: rgba(232, 184, 75, .25); }
.nav-item.active::before {
  content: ''; position: absolute; inset-inline-start: -14px; inset-block: 8px; width: 3px;
  background: linear-gradient(var(--gold), var(--gold-2));
  border-start-end-radius: 3px; border-end-end-radius: 3px;
}
.nav-count {
  margin-inline-start: auto; min-width: 22px; text-align: center;
  background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800;
  padding: 1px 7px; border-radius: 999px;
}
.sidebar-foot { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.sidebar-user .su-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.sidebar-user .su-role { font-size: 12px; color: var(--text-faint); }
.sidebar-scrim {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(3, 10, 7, .55); backdrop-filter: blur(3px);
  animation: fadeIn .2s ease;
}

.app-wrap { margin-inline-start: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 26px;
  background: rgba(10, 31, 24, .55);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.menu-btn { display: none; }
.topbar-title { font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; position: relative; }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line); background: var(--glass);
  color: var(--text-dim); cursor: pointer; position: relative;
  transition: background .18s, color .18s, transform .12s;
}
.icon-btn:hover { background: var(--glass-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.bell-btn .badge-dot {
  position: absolute; top: 8px; inset-inline-end: 9px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--bg1);
}
.avatar-btn { border: none; background: none; padding: 0; cursor: pointer; }

/* ---------- Dropdown panels ---------- */
.bell-panel, .user-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60;
  width: 350px; max-height: 480px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  animation: popIn .2s var(--ease);
}
.user-menu { width: 230px; padding: 8px; }
@media (max-width: 640px) { .bell-panel { width: min(92vw, 350px); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.glass-card {
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* Dropdown panels: near-opaque dark fill so content stays readable over page blobs */
.bell-panel.glass-card, .user-menu.glass-card {
  background: linear-gradient(170deg, rgba(14, 40, 29, .95), rgba(7, 20, 14, .97));
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: var(--shadow);
}

.bp-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.bp-head h3 { margin: 0; font-size: 15px; flex: 1; }
.bp-body { max-height: 360px; overflow-y: auto; }
.bp-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .15s; }
.bp-item:hover { background: var(--glass); }
.bp-item.unread { background: var(--gold-soft); }
.bp-item .bp-t { font-weight: 700; font-size: 13.5px; }
.bp-item .bp-s { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.bp-item .bp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-top: 6px; flex: none; }
.bp-item.read .bp-dot { background: transparent; }
.bp-empty { padding: 30px 16px; text-align: center; color: var(--text-faint); font-size: 13.5px; }
.bp-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); text-align: center; }

.um-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); border: none; background: none;
  color: var(--text-dim); font-size: 14px; font-weight: 600; cursor: pointer; text-align: start;
}
.um-item:hover { background: var(--glass); color: var(--text); }
.um-item.danger:hover { color: var(--red); }
.um-item svg { opacity: .8; }
.um-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.um-user { padding: 6px 12px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.um-user .um-n { font-weight: 800; font-size: 14.5px; }
.um-user .um-r { font-size: 12.5px; color: var(--text-faint); }

/* ---------- Main / page headers ---------- */
.main { flex: 1; padding: 24px 28px; max-width: 1600px; width: 100%; margin-inline: auto; animation: fadeIn .25s ease; }
.page-loading { display: flex; justify-content: center; align-items: center; min-height: 55vh; color: var(--text-faint); gap: 10px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: .2px; }
.page-sub { color: var(--text-faint); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; cursor: pointer; color: var(--text);
  background: var(--glass); transition: transform .12s, filter .15s, background .15s, border-color .15s;
  line-height: 1.2; white-space: nowrap;
}
.btn:hover { background: var(--glass-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { flex: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border-color: rgba(232, 184, 75, .5); color: #1a1204;
  box-shadow: 0 8px 22px rgba(216, 154, 42, .28);
}
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--gold), var(--gold-2)); }
.btn-danger { background: var(--red-soft); border-color: rgba(231, 111, 81, .35); color: #FFB4A0; }
.btn-danger:hover { background: rgba(231, 111, 81, .25); }
.btn-success { background: var(--green-soft); border-color: rgba(47, 191, 113, .35); color: #9CE6BC; }
.btn-success:hover { background: rgba(47, 191, 113, .25); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-outline:hover { color: var(--text); border-color: var(--text-faint); background: var(--glass); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-subtle { background: none; border-color: transparent; color: var(--text-dim); }
.btn-subtle:hover { color: var(--text); background: var(--glass); }

/* ---------- Cards & stats ---------- */
.card {
  background: linear-gradient(160deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { font-size: 15px; font-weight: 800; margin: 0; }
.card-title small { color: var(--text-faint); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold); flex: none;
}
.stat-card .stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; font-family: var(--font-num); }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.tone-green  .stat-icon { background: var(--green-soft);  color: var(--green); }
.tone-red    .stat-icon { background: var(--red-soft);    color: var(--red); }
.tone-blue   .stat-icon { background: var(--blue-soft);   color: var(--blue); }
.tone-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }
.tone-teal   .stat-icon { background: var(--teal-soft);   color: var(--teal); }
.tone-amber  .stat-icon { background: var(--amber-soft);  color: var(--amber); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-dim); margin-bottom: 7px; }
.field label .req { color: var(--red); }
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(6, 18, 13, .35);
  color: var(--text); font-size: 14.5px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 44px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: rgba(232, 184, 75, .55); background: rgba(6, 18, 13, .55); box-shadow: 0 0 0 3px rgba(232, 184, 75, .14); }
select.input option { background: var(--bg1); color: var(--text); }
.input[readonly] { opacity: .7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; color: var(--text-dim); user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); }

/* Chips / tag picker */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--glass);
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); cursor: pointer; user-select: none;
  transition: all .15s;
}
.chip:hover { color: var(--text); background: var(--glass-2); }
.chip.sel { background: var(--gold-soft); border-color: rgba(232, 184, 75, .4); color: var(--gold); }
.chip.sel::after { content: '\2713'; font-weight: 800; }
.chip .chip-x { opacity: .7; }
.chip .chip-x:hover { opacity: 1; color: var(--red); }

/* File upload */
.upload-zone {
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  padding: 20px; text-align: center; color: var(--text-faint);
  cursor: pointer; transition: all .15s; font-size: 13.5px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 12px; background: var(--glass); border: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.file-item .fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-item .fi-size { color: var(--text-faint); font-size: 12px; flex: none; }
.file-item .fi-x { color: var(--text-faint); cursor: pointer; background: none; border: none; font-size: 16px; padding: 2px 6px; }
.file-item .fi-x:hover { color: var(--red); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .3px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.st-pending_head, .b-pending_head { color: var(--amber); background: var(--amber-soft); border-color: rgba(232, 184, 75, .3); }
.st-pending_approvers, .b-pending_approvers { color: var(--purple); background: var(--purple-soft); border-color: rgba(167, 139, 250, .3); }
.st-in_backlog, .b-in_backlog { color: var(--slate); background: var(--slate-soft); border-color: rgba(140, 163, 166, .3); }
.st-in_development, .b-in_development { color: var(--blue); background: var(--blue-soft); border-color: rgba(77, 168, 218, .3); }
.st-ready_for_testing, .b-ready_for_testing { color: var(--teal); background: var(--teal-soft); border-color: rgba(69, 196, 176, .3); }
.st-in_testing, .b-in_testing { color: var(--amber); background: var(--amber-soft); border-color: rgba(232, 184, 75, .3); }
.st-completed, .b-completed { color: var(--green); background: var(--green-soft); border-color: rgba(47, 191, 113, .3); }
.st-rejected, .b-rejected { color: var(--red); background: var(--red-soft); border-color: rgba(231, 111, 81, .3); }
.st-cancelled, .b-cancelled { color: var(--text-faint); background: rgba(255,255,255,.06); border-color: var(--line-soft); }
.p-low { color: var(--teal); background: var(--teal-soft); border-color: rgba(69, 196, 176, .3); }
.p-medium { color: var(--blue); background: var(--blue-soft); border-color: rgba(77, 168, 218, .3); }
.p-high { color: var(--amber); background: var(--amber-soft); border-color: rgba(232, 184, 75, .3); }
.p-critical { color: var(--red); background: var(--red-soft); border-color: rgba(231, 111, 81, .3); }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.09); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .5s var(--ease); }
.progress.done .progress-bar { background: linear-gradient(90deg, var(--green), #3FDB8B); }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row .progress { flex: 1; }
.progress-row .pct { font-size: 12.5px; font-weight: 800; font-family: var(--font-num); color: var(--text-dim); min-width: 38px; text-align: end; }

/* ---------- Lists & tables ---------- */
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--glass); }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li-sub .sep { opacity: .5; }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl th {
  text-align: start; padding: 12px 14px; font-size: 11.5px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-faint); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; cursor: pointer; }
.tbl tbody tr:hover { background: var(--glass); }
.tbl .num { font-family: var(--font-num); font-weight: 700; }
.tbl .tcell-main { font-weight: 700; }
.tbl .tcell-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* Toolbar / filters */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(6,18,13,.4); border: 1px solid var(--line-soft); }
.tab {
  padding: 7px 14px; border-radius: 9px; border: none; background: none;
  color: var(--text-faint); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--text-dim); }
.tab.active { background: var(--gold-soft); color: var(--gold); }
.tabs .tab.count::after { content: attr(data-count); margin-inline-start: 5px; background: var(--glass-2); border-radius: 999px; padding: 1px 7px; font-size: 11px; }

/* ---------- Timeline ---------- */
.tl { position: relative; padding-inline-start: 6px; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-2); border: 1px solid var(--line);
  font-size: 11px; font-weight: 800; color: var(--text-dim); z-index: 1;
}
.tl-item::before {
  content: ''; position: absolute; inset-inline-start: 16px; top: 38px; bottom: -4px;
  width: 2px; background: var(--line-soft);
}
.tl-item:last-child::before { display: none; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-who { font-weight: 700; font-size: 13.5px; }
.tl-what { font-size: 12.5px; color: var(--text-dim); }
.tl-when { font-size: 11.5px; color: var(--text-faint); margin-inline-start: auto; white-space: nowrap; }
.tl-note {
  margin-top: 8px; padding: 10px 14px; border-radius: 12px;
  background: rgba(6,18,13,.4); border: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--text-dim);
}
.tl-attach { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { display: flex; flex-direction: column; min-height: 240px; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.kb-head .kb-title { font-size: 13px; font-weight: 800; flex: 1; }
.kb-head .kb-n { font-size: 11.5px; font-weight: 800; background: var(--glass-2); border-radius: 999px; padding: 1px 8px; color: var(--text-dim); }
.kb-body { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.kb-card { padding: 13px; border-radius: var(--r-md); background: rgba(10, 31, 24, .5); border: 1px solid var(--line); cursor: pointer; transition: all .18s; }
.kb-card:hover { border-color: rgba(232, 184, 75, .45); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.kb-card .kb-id { font-size: 11px; font-weight: 800; color: var(--text-faint); font-family: var(--font-num); letter-spacing: .5px; }
.kb-card .kb-t { font-weight: 700; font-size: 13.5px; margin: 5px 0 8px; line-height: 1.4; }
.kb-card .kb-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kb-card .kb-meta .sub { font-size: 11.5px; color: var(--text-faint); }

/* ---------- Avatars ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 800; color: #0A1F18;
  background: linear-gradient(135deg, var(--gold), #F5CE56);
  border: 2px solid rgba(255,255,255,.18);
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; border-width: 1.5px; }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; }
.avatar-2 { background: linear-gradient(135deg, #45C4B0, #2FBF71); }
.avatar-3 { background: linear-gradient(135deg, #4DA8DA, #A78BFA); }
.avatar-4 { background: linear-gradient(135deg, #E76F51, #F5CE56); }
.avatar-row { display: flex; align-items: center; }
.avatar-row .avatar { margin-inline-start: -8px; border-color: var(--bg1); }
.avatar-row .avatar:first-child { margin-inline-start: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 10, 7, .6); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .2s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(165deg, rgba(16, 46, 34, .92), rgba(8, 23, 17, .96));
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow); padding: 24px;
  animation: popIn .22s var(--ease);
}
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.modal-title { font-size: 17px; font-weight: 800; flex: 1; margin: 0; }
.modal-x { background: none; border: none; color: var(--text-faint); font-size: 22px; cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.modal-x:hover { color: var(--text); background: var(--glass); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Toasts ---------- */
#toastRoot { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, 92vw); }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--line); border-inline-start-width: 4px;
  background: linear-gradient(160deg, rgba(16, 46, 34, .95), rgba(8, 23, 17, .97));
  backdrop-filter: blur(18px); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 600; color: var(--text);
  animation: toastIn .25s var(--ease);
}
.toast.ok { border-inline-start-color: var(--green); }
.toast.err { border-inline-start-color: var(--red); }
.toast.info { border-inline-start-color: var(--blue); }
.toast .t-ic { font-size: 16px; line-height: 1.2; }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .3s; }
html[dir='rtl'] .toast.out { transform: translateX(-20px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 46px 20px; color: var(--text-faint); }
.empty-state .es-ic { font-size: 40px; opacity: .6; margin-bottom: 10px; }
.empty-state .es-t { font-weight: 700; font-size: 15px; color: var(--text-dim); }
.empty-state .es-s { font-size: 13px; margin-top: 4px; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 45;
  display: none; align-items: stretch;
  background: linear-gradient(180deg, rgba(10, 31, 24, .92), rgba(6, 18, 13, .96));
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line-soft);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border: none; background: none; color: var(--text-faint);
  font-size: 10.5px; font-weight: 700; cursor: pointer; position: relative;
  border-radius: 10px; transition: color .15s;
}
.bn-item svg { opacity: .85; }
.bn-item.active { color: var(--gold); }
.bn-item .badge-dot {
  position: absolute; top: 2px; inset-inline-end: calc(50% - 16px);
  min-width: 15px; height: 15px; border-radius: 999px; background: var(--red);
  color: #fff; font-size: 9.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* ---------- Login page ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card h2 { text-align: center; }
.auth-card .muted { text-align: center; }
.auth-card {
  width: 100%; max-width: 420px; padding: 34px 32px; border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(16, 46, 34, .88), rgba(8, 23, 17, .95));
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: var(--shadow);
  animation: popIn .3s var(--ease);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand img { height: 64px; }
.auth-title { font-size: 20px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.auth-sub { text-align: center; color: var(--text-faint); font-size: 13px; margin-bottom: 24px; }
.auth-err {
  padding: 10px 14px; border-radius: 12px; margin-bottom: 16px;
  background: var(--red-soft); border: 1px solid rgba(231, 111, 81, .35);
  color: #FFB4A0; font-size: 13.5px; font-weight: 600;
}
.auth-lang { position: fixed; top: 18px; inset-inline-end: 18px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-faint); }

/* ---------- Detail pages ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.detail-side { position: sticky; top: calc(var(--topbar-h) + 18px); }
.kt { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); font-weight: 800; margin: 18px 0 8px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-faint); }
.kv .v { font-weight: 700; text-align: end; }
.att-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line-soft); font-size: 13px; margin-bottom: 6px; }
.att-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Utilities ---------- */
.muted { color: var(--text-faint); }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }
.mono { font-family: var(--font-num); }
.text-end { text-align: end; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }
.anim-in { animation: fadeIn .3s ease; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .kanban { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); }
  html[dir='rtl'] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0) !important; }
  .app-wrap { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .main { padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; }
  .page-title { font-size: 20px; }
  .bottom-nav { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-actions .btn { flex: 1; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { flex: 1; text-align: center; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Work logs (My Doing) ---------- */
.wl-month-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wl-hours { font-family: var(--font-num); font-weight: 800; color: var(--text-dim); font-size: 14px; flex: none; white-space: nowrap; }
.btn-subtle.danger { color: var(--red); }
.btn-subtle.danger:hover { color: #FFB4A0; background: var(--red-soft); }
.b-logged { color: var(--green); background: var(--green-soft); border-color: rgba(47, 191, 113, .3); }
.b-missing { color: var(--red); background: var(--red-soft); border-color: rgba(231, 111, 81, .3); }
.b-request { color: var(--slate); background: var(--slate-soft); border-color: rgba(140, 163, 166, .3); }

