/* ============================================================
   مسارات (Masars) — Brand Stylesheet v1.0
   Professional Blue / Slate — Enterprise Grade
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── MASARS BRAND TOKENS ────────────────────────────────────── */
:root {
  /* Brand Blues */
  --m-blue-900:  #0D1F3C;
  --m-blue-800:  #1B3564;
  --m-blue-700:  #1E3D72;
  --m-blue-600:  #2451A3;
  --m-blue-500:  #2B64B5;
  --m-blue-400:  #4A85C4;
  --m-blue-300:  #6BA3D6;
  --m-blue-100:  #DBEAFE;
  --m-blue-50:   #EFF6FF;

  /* Brand Slate */
  --m-slate-900: #1A2340;
  --m-slate-800: #2D3B55;
  --m-slate-700: #3D4B5C;
  --m-slate-600: #4A5568;
  --m-slate-500: #6B7A8D;
  --m-slate-400: #8E9BB0;
  --m-slate-200: #CBD5E1;
  --m-slate-100: #E2E8F0;
  --m-slate-50:  #F1F5F9;

  /* Semantic */
  --m-bg:        #F4F6FA;
  --m-surface:   #FFFFFF;
  --m-border:    #E2E8F0;
  --m-text:      #1A2340;
  --m-text-2:    #3D4B5C;
  --m-text-3:    #6B7A8D;

  /* Status */
  --m-success:   #0D7754;
  --m-success-bg:#ECFDF5;
  --m-warning:   #B45309;
  --m-warning-bg:#FFFBEB;
  --m-danger:    #B91C1C;
  --m-danger-bg: #FEF2F2;
  --m-info:      #1D4ED8;
  --m-info-bg:   #EFF6FF;

  /* Layout */
  --sidebar-w:   268px;
  --header-h:    60px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   5px;

  /* Shadows */
  --shadow-xs:   0 1px 3px rgba(26,35,64,.06), 0 1px 2px rgba(26,35,64,.04);
  --shadow-sm:   0 2px 8px rgba(26,35,64,.07), 0 1px 3px rgba(26,35,64,.05);
  --shadow-md:   0 4px 16px rgba(26,35,64,.09), 0 2px 6px rgba(26,35,64,.06);
  --shadow-lg:   0 10px 36px rgba(26,35,64,.12), 0 4px 12px rgba(26,35,64,.08);

  --transition: all .16s cubic-bezier(.4,0,.2,1);
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--m-bg);
  color: var(--m-text);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.ltr { direction: ltr; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--m-slate-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--m-slate-400); }

/* ============================================================
   MASARS SVG ICON SYSTEM
   ============================================================ */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon svg { display: block; }
.icon-16 svg { width: 16px; height: 16px; }
.icon-18 svg { width: 18px; height: 18px; }
.icon-20 svg { width: 20px; height: 20px; }
.icon-24 svg { width: 24px; height: 24px; }

/* ─── MASARS LOGO MARK (SVG Inline) ──────────────────────────── */
.masars-mark {
  display: inline-flex; align-items: center; justify-content: center;
}
.masars-mark svg { display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--m-blue-800);
  display: flex;
  flex-direction: column;
  height: 100vh;
  flex-shrink: 0;
  z-index: 100;
  transition: width .2s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 60px; }

/* Sidebar Header */
.sidebar-header {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

.masars-logo-wrap {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.masars-logo-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.masars-logo-text {
  display: flex; flex-direction: column; min-width: 0;
}
.masars-logo-text .name {
  font-size: 17px; font-weight: 800; color: #fff;
  letter-spacing: -.3px; line-height: 1;
  font-family: 'Cairo', sans-serif;
}
.masars-logo-text .sub {
  font-size: 9.5px; color: rgba(255,255,255,.38);
  font-weight: 400; letter-spacing: .4px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar.collapsed .masars-logo-text { display: none; }

.sidebar-toggle {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,.06);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.45);
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-toggle svg { width: 16px; height: 16px; }

/* Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 8px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 2px; }

.nav-section {
  padding: 10px 14px 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 1.4px;
  color: rgba(255,255,255,.22); text-transform: uppercase;
  white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .nav-section { opacity: 0; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px;
  margin: 1px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
  color: rgba(255,255,255,.55);
  font-size: 13px; font-weight: 500;
  position: relative; white-space: nowrap;
  user-select: none; border: 1px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
}
.nav-item.active {
  background: rgba(75,133,196,.2);
  border-color: rgba(75,133,196,.3);
  color: #fff;
}
.nav-item.active .nav-icon-wrap svg { color: var(--m-blue-300); }
.nav-item .nav-icon-wrap {
  width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-item .nav-icon-wrap svg { width: 16px; height: 16px; }
.nav-item .nav-label { flex: 1; }
.sidebar.collapsed .nav-label { display: none; }

.nav-badge {
  background: var(--m-danger);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}
.nav-badge.blue { background: var(--m-blue-500); }

/* Sub menu */
.nav-sub { display: none; padding: 2px 0 3px; }
.nav-item.has-sub.open + .nav-sub { display: block; }
.nav-sub-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px 7px 26px;
  margin: 1px 8px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,.45);
  font-size: 12.5px;
  transition: var(--transition);
}
.nav-sub-item:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.8); }
.nav-sub-item.active { color: var(--m-blue-300); }
.nav-sub-item .nav-icon-wrap { width: 16px; display: flex; align-items: center; justify-content: center; }
.nav-sub-item .nav-icon-wrap svg { width: 13px; height: 13px; }
.nav-arrow { font-size: 12px; transition: transform .18s; opacity: .5; margin-right: auto; }
.nav-item.open .nav-arrow { transform: rotate(90deg); }

/* Sidebar Footer */
.sidebar-footer {
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.user-card {
  display: flex; align-items: center; gap: 9px;
  padding: 9px;
  border-radius: 9px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  transition: var(--transition);
}
.user-card:hover { background: rgba(255,255,255,.08); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--m-blue-500), var(--m-blue-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info h4 { color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.user-info p  { color: rgba(255,255,255,.38); font-size: 11px; margin-top: 1px; }
.sidebar.collapsed .user-info { display: none; }

/* ─── MAIN AREA ──────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ─── HEADER ─────────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--m-surface);
  border-bottom: 1px solid var(--m-border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(26,35,64,.04);
}
.header-title { font-size: 17px; font-weight: 700; color: var(--m-blue-800); }
.header-bread { font-size: 11px; color: var(--m-text-3); margin-top: 1px; }
.header-spacer { flex: 1; }
.header-search {
  display: flex; align-items: center;
  background: var(--m-slate-50); border: 1px solid var(--m-border);
  border-radius: 9px; padding: 7px 12px; gap: 7px;
  width: 210px; transition: var(--transition);
}
.header-search:focus-within { border-color: var(--m-blue-500); box-shadow: 0 0 0 3px rgba(43,100,181,.07); }
.header-search input { background: none; border: none; outline: none; font-size: 13px; color: var(--m-text); width: 100%; }
.header-search input::placeholder { color: var(--m-text-3); }
.header-search svg { width: 15px; height: 15px; color: var(--m-text-3); flex-shrink: 0; }

.header-action {
  width: 36px; height: 36px;
  border-radius: 9px; border: 1px solid var(--m-border);
  background: var(--m-slate-50);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  position: relative;
}
.header-action:hover { background: var(--m-slate-100); border-color: var(--m-slate-200); }
.header-action svg { width: 17px; height: 17px; color: var(--m-slate-600); }
.header-action .dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--m-danger); border-radius: 50%;
  border: 2px solid var(--m-surface);
}
.header-action.ai-btn { background: var(--m-blue-50); border-color: rgba(43,100,181,.2); }
.header-action.ai-btn svg { color: var(--m-blue-600); }

/* ─── CONTENT ────────────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 22px; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ─── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--m-surface);
  border-radius: var(--radius);
  border: 1px solid var(--m-border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-sm { padding: 14px; }
.card-hover { transition: var(--transition); cursor: pointer; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* ─── GRID ───────────────────────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g2  { grid-template-columns: repeat(2, 1fr); }
.g3  { grid-template-columns: repeat(3, 1fr); }
.g4  { grid-template-columns: repeat(4, 1fr); }
@media(max-width:1200px) { .g4 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:768px)  { .g2,.g3,.g4 { grid-template-columns: 1fr; } }

/* ─── STAT CARDS ─────────────────────────────────────────────── */
.stat-card {
  background: var(--m-surface);
  border-radius: var(--radius);
  border: 1px solid var(--m-border);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-val { font-size: 28px; font-weight: 800; color: var(--m-blue-800); line-height: 1; }
.stat-label { font-size: 13px; color: var(--m-text-2); margin-top: 5px; font-weight: 500; }
.stat-change { font-size: 11.5px; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up      { color: var(--m-success); }
.stat-change.down    { color: var(--m-danger); }
.stat-change.neutral { color: var(--m-text-3); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 1px solid transparent; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--m-blue-700);
  color: #fff; border-color: var(--m-blue-700);
  box-shadow: 0 2px 8px rgba(27,53,100,.25);
}
.btn-primary:hover:not(:disabled) { background: var(--m-blue-800); box-shadow: 0 4px 14px rgba(27,53,100,.32); transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--m-blue-700);
  border-color: var(--m-blue-400);
}
.btn-outline:hover:not(:disabled) { background: var(--m-blue-50); }

.btn-ghost { background: var(--m-slate-50); color: var(--m-text-2); border-color: var(--m-border); }
.btn-ghost:hover:not(:disabled) { background: var(--m-slate-100); }

.btn-danger { background: var(--m-danger); color: #fff; border-color: var(--m-danger); }
.btn-success { background: var(--m-success); color: #fff; border-color: var(--m-success); }

.btn-sm  { padding: 6px 13px; font-size: 12px; }
.btn-xs  { padding: 4px 10px; font-size: 11px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 8px; }

/* ─── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--m-success-bg); color: #065F46; }
.badge-warning { background: var(--m-warning-bg); color: #92400E; }
.badge-danger  { background: var(--m-danger-bg);  color: #991B1B; }
.badge-info    { background: var(--m-info-bg);    color: #1E40AF; }
.badge-blue    { background: var(--m-blue-50);    color: var(--m-blue-700); }
.badge-slate   { background: var(--m-slate-100);  color: var(--m-slate-700); }

/* ─── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--m-text-2); margin-bottom: 7px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--m-border);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px; color: var(--m-text);
  background: var(--m-surface); outline: none;
  transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--m-blue-500);
  box-shadow: 0 0 0 3px rgba(43,100,181,.08);
}
.form-textarea { resize: vertical; min-height: 85px; }
.form-hint  { font-size: 11px; color: var(--m-text-3); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--m-danger);  margin-top: 4px; }

/* ─── TABLE ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--m-border); }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--m-slate-50); padding: 11px 15px;
  font-size: 11.5px; font-weight: 700; color: var(--m-text-2);
  text-align: right; border-bottom: 1px solid var(--m-border);
  white-space: nowrap;
}
td { padding: 12px 15px; font-size: 13px; color: var(--m-text); border-bottom: 1px solid var(--m-slate-50); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--m-slate-50); }

/* ─── SECTION HEADER ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.section-title { font-size: 16px; font-weight: 700; color: var(--m-blue-800); }
.section-sub   { font-size: 12px; color: var(--m-text-3); margin-top: 3px; }

/* ─── TABS ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--m-border); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--m-text-3); cursor: pointer;
  background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--m-blue-700); }
.tab-btn.active { color: var(--m-blue-700); border-bottom-color: var(--m-blue-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,40,.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--m-surface); border-radius: 16px;
  padding: 26px; width: 520px; max-width: 94vw;
  box-shadow: var(--shadow-lg);
  transform: translateY(14px); transition: transform .2s;
  max-height: 88vh; overflow-y: auto;
  border: 1px solid var(--m-border);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title  { font-size: 17px; font-weight: 800; color: var(--m-blue-800); }
.modal-close  {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--m-slate-50); border: 1px solid var(--m-border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--m-text-2); transition: var(--transition);
}
.modal-close:hover { background: var(--m-slate-100); }
.modal-close svg { width: 14px; height: 14px; }

/* ─── NOTIFICATIONS PANEL ────────────────────────────────────── */
.notif-panel {
  position: fixed; top: var(--header-h); left: 0;
  width: 350px; max-height: calc(100vh - var(--header-h));
  background: var(--m-surface); border-left: 1px solid var(--m-border);
  box-shadow: -6px 0 28px rgba(26,35,64,.1);
  z-index: 200; overflow-y: auto;
  transform: translateX(-100%); transition: transform .22s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-item {
  display: flex; gap: 11px; padding: 13px 15px;
  border-bottom: 1px solid var(--m-slate-50);
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--m-slate-50); }
.notif-item.unread { border-right: 3px solid var(--m-blue-500); background: var(--m-blue-50); }
.notif-item.urgent { border-right-color: var(--m-danger); }
.notif-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 17px; height: 17px; }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--m-text); }
.notif-sub   { font-size: 11px; color: var(--m-text-3); margin-top: 2px; }
.notif-time  { font-size: 10.5px; color: var(--m-text-3); white-space: nowrap; }

/* ─── AI CHAT PANEL ──────────────────────────────────────────── */
.ai-panel {
  position: fixed; bottom: 0; left: 0;
  width: 390px; height: 510px;
  background: var(--m-surface);
  border: 1px solid var(--m-border);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow-lg);
  z-index: 300; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .22s ease;
}
.ai-panel.open { transform: translateY(0); }
.ai-panel-header {
  padding: 13px 15px;
  border-bottom: 1px solid var(--m-border);
  display: flex; align-items: center; gap: 10px;
}
.ai-panel-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--m-blue-50);
  display: flex; align-items: center; justify-content: center;
}
.ai-panel-logo svg { width: 18px; height: 18px; }
.ai-panel-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg {
  max-width: 84%; padding: 10px 13px;
  border-radius: 12px; font-size: 13px; line-height: 1.6;
}
.ai-msg.user {
  background: var(--m-blue-700); color: #fff;
  border-radius: 12px 12px 3px 12px; align-self: flex-end;
}
.ai-msg.assistant {
  background: var(--m-slate-50);
  border: 1px solid var(--m-border);
  border-radius: 12px 12px 12px 3px; align-self: flex-start;
}
.ai-typing {
  display: flex; align-items: center; gap: 5px;
  padding: 10px 13px;
  background: var(--m-slate-50); border-radius: 12px;
  align-self: flex-start;
}
.ai-typing .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--m-blue-500); animation: blink 1.2s infinite; }
.ai-typing .dot:nth-child(2) { animation-delay: .2s; }
.ai-typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.2} 40%{opacity:1} }
.ai-input-area { padding: 11px; border-top: 1px solid var(--m-border); display: flex; gap: 8px; }
.ai-input {
  flex: 1; padding: 9px 12px;
  border: 1px solid var(--m-border); border-radius: 9px;
  font-family: inherit; font-size: 13px; outline: none;
  background: var(--m-slate-50); transition: var(--transition);
}
.ai-input:focus { border-color: var(--m-blue-500); background: var(--m-surface); }

/* ─── PROGRESS ───────────────────────────────────────────────── */
.progress { height: 5px; background: var(--m-slate-100); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; transition: width .4s ease; background: var(--m-blue-600); }

/* ─── TIMELINE ───────────────────────────────────────────────── */
.timeline-item {
  display: flex; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid var(--m-slate-50); align-items: flex-start;
}
.timeline-item:last-child { border-bottom: none; }
.tl-dot {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tl-dot svg { width: 14px; height: 14px; }
.tl-body { flex: 1; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--m-text); }
.tl-sub   { font-size: 11.5px; color: var(--m-text-3); margin-top: 2px; }
.tl-time  { font-size: 11px; color: var(--m-text-3); white-space: nowrap; }

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 42px 20px; text-align: center;
}
.empty-state .empty-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--m-slate-50); border: 1px solid var(--m-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty-state .empty-icon svg { width: 24px; height: 24px; color: var(--m-slate-400); }
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--m-blue-800); margin-bottom: 5px; }
.empty-state p  { font-size: 13px; color: var(--m-text-3); max-width: 260px; }

/* ─── SPINNER ────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--m-border);
  border-top-color: var(--m-blue-600);
  animation: spin .65s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── TOAST ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; left: 20px;
  z-index: 9999; display: flex; flex-direction: column; gap: 7px;
}
.toast {
  padding: 11px 16px;
  border-radius: 9px; font-size: 13px; font-weight: 500; color: #fff;
  box-shadow: var(--shadow-lg); animation: slideUp .22s ease;
  max-width: 300px; display: flex; align-items: center; gap: 9px;
}
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes slideUp { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.toast.success { background: var(--m-success); }
.toast.error   { background: var(--m-danger); }
.toast.info    { background: var(--m-blue-700); }
.toast.warning { background: var(--m-warning); }

/* ─── WELCOME BANNER ─────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--m-blue-800) 0%, var(--m-blue-600) 100%);
  border-radius: var(--radius); padding: 22px 26px;
  color: #fff; position: relative; overflow: hidden;
  margin-bottom: 20px;
}
.welcome-banner::after {
  content: '';
  position: absolute; left: -20px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.welcome-banner h2 { font-size: 20px; font-weight: 800; margin-bottom: 3px; }
.welcome-banner p  { color: rgba(255,255,255,.55); font-size: 13px; }
.welcome-date .day   { font-size: 40px; font-weight: 900; color: #fff; line-height: 1; }
.welcome-date .month { font-size: 12px; color: rgba(255,255,255,.5); }

/* ─── LOGIN PAGE ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--m-blue-900) 0%, var(--m-blue-800) 45%, var(--m-blue-700) 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(43,100,181,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(43,100,181,.10) 0%, transparent 50%);
  pointer-events: none;
}
.login-grid-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.login-grid-bg svg { width: 100%; height: 100%; opacity: .04; }

.login-box {
  position: relative; z-index: 2;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; padding: 44px 40px;
  width: 400px; max-width: 94vw;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  animation: fadeUp .5s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo-mark {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.login-logo-mark svg { width: 40px; height: 40px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.login-logo .tagline { color: rgba(255,255,255,.4); font-size: 12.5px; margin-top: 3px; }

.login-form label {
  display: block; color: rgba(255,255,255,.6);
  font-size: 12px; font-weight: 600; margin-bottom: 7px;
}
.login-input {
  width: 100%; padding: 12px 15px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px; color: #fff;
  font-family: inherit; font-size: 13.5px; outline: none;
  transition: var(--transition); margin-bottom: 16px;
}
.login-input:focus { border-color: var(--m-blue-300); background: rgba(255,255,255,.1); }
.login-input::placeholder { color: rgba(255,255,255,.25); }
.login-submit {
  width: 100%; padding: 13px;
  background: var(--m-blue-500);
  border: none; border-radius: 9px;
  color: #fff; font-family: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 16px rgba(43,100,181,.45);
}
.login-submit:hover { background: var(--m-blue-600); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(43,100,181,.5); }
.login-error {
  background: rgba(185,28,28,.15); border: 1px solid rgba(185,28,28,.3);
  color: #FCA5A5; padding: 10px 13px;
  border-radius: 8px; font-size: 13px;
  margin-bottom: 15px; display: none;
}

/* ─── QUICK ACCESS BUTTONS ───────────────────────────────────── */
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--m-border); background: var(--m-surface);
  cursor: pointer; transition: var(--transition); min-width: 88px;
}
.qa-btn:hover { border-color: var(--m-blue-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.qa-btn .qa-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.qa-btn .qa-icon svg { width: 18px; height: 18px; }
.qa-btn span { font-size: 12px; font-weight: 600; color: var(--m-text-2); text-align: center; }
.qa-btn.add-new { border-style: dashed; border-color: var(--m-blue-300); background: var(--m-blue-50); }
.qa-btn.add-new span { color: var(--m-blue-600); }
.qa-btn.add-new .qa-icon { background: var(--m-blue-100); }
.qa-btn.add-new .qa-icon svg { color: var(--m-blue-600); }

/* ─── UTILITIES ──────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.items-center  { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--m-text-3); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.hidden { display: none !important; }
.pointer { cursor: pointer; }
.w-full { width: 100%; }
.view { display: none; animation: viewIn .2s ease; }
.view.active { display: block; }
@keyframes viewIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media(max-width: 900px) {
  .sidebar { position: fixed; right: calc(-1 * var(--sidebar-w)); }
  .sidebar.mobile-open { right: 0; }
  .header-search { display: none; }
}
