/* ============================================================
   ODYLABS ERP DASHBOARD — Central Stylesheet
   No glass effects, no gradients. Clean, sharp, enterprise.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* Brand */
  --brand:        #8CC63F;
  --brand-dark:   #6FA832;
  --brand-light:  #EDF7DA;

  /* Neutrals */
  --bg:           #F4F5F7;
  --surface:      #FFFFFF;
  --surface-2:    #F9FAFB;
  --border:       #E2E5EA;
  --border-strong:#CBD0D8;

  /* Text */
  --text-primary: #111827;
  --text-secondary:#6B7280;
  --text-muted:   #9CA3AF;

  /* Sidebar */
  --sidebar-bg:   #0F1117;
  --sidebar-text: #C9CDD4;
  --sidebar-muted:#6B7280;
  --sidebar-hover:#1C2030;
  --sidebar-active:#1E2333;
  --sidebar-w:    260px;

  /* Status */
  --success:      #22C55E;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;

  /* Accent chips */
  --chip-green-bg:#DCFCE7;  --chip-green-text:#15803D;
  --chip-red-bg:  #FEE2E2;  --chip-red-text:  #B91C1C;
  --chip-yellow-bg:#FEF9C3; --chip-yellow-text:#854D0E;
  --chip-blue-bg: #DBEAFE;  --chip-blue-text: #1D4ED8;
  --chip-purple-bg:#EDE9FE; --chip-purple-text:#6D28D9;

  /* Shadow */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.07);
  --shadow:       0 2px 8px rgba(0,0,0,.09);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);

  /* Radius */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  /* Transitions */
  --t: 180ms ease;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

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

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 100;
  transition: width var(--t);
}

.sidebar-logo {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo img {
  height: 28px;
  width: auto;
}

.sidebar-search {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-search-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-sm);
  padding: 7px 10px;
}
.sidebar-search-inner input {
  background: none;
  border: none;
  outline: none;
  color: var(--sidebar-text);
  font-size: .85rem;
  width: 100%;
}
.sidebar-search-inner input::placeholder { color: var(--sidebar-muted); }
.sidebar-search-inner i { color: var(--sidebar-muted); font-size: 13px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}

.nav-section {
  margin-bottom: 4px;
}
.nav-section-title {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 12px 18px 4px;
}

.nav-dept {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  font-size: .88rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  user-select: none;
  position: relative;
}
.nav-dept:hover { background: var(--sidebar-hover); color: #fff; }
.nav-dept.active {
  background: var(--sidebar-active);
  color: #fff;
}
.nav-dept.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.nav-dept i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; color: inherit; opacity: .8; }
.nav-dept span { flex: 1; }
.nav-dept .dept-arrow {
  font-size: 10px;
  transition: transform var(--t);
  opacity: .6;
}
.nav-dept.open .dept-arrow { transform: rotate(90deg); }

.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}
.nav-sub.open { max-height: 500px; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 7px 44px;
  color: var(--sidebar-muted);
  font-size: .84rem;
  cursor: pointer;
  transition: background var(--t), color var(--t);
  border-radius: 0;
}
.nav-sub-item:hover { background: var(--sidebar-hover); color: var(--sidebar-text); }
.nav-sub-item.active {
  color: var(--brand);
  background: rgba(140,198,63,.08);
}
.nav-sub-item .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.nav-sub-item .badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-footer .user-info { flex: 1; min-width: 0; }
.sidebar-footer .user-name {
  font-size: .85rem; font-weight: 600;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-footer .user-role {
  font-size: .75rem; color: var(--sidebar-muted);
}
.sidebar-footer .settings-btn {
  color: var(--sidebar-muted);
  font-size: 15px;
  padding: 4px;
  transition: color var(--t);
}
.sidebar-footer .settings-btn:hover { color: #fff; }

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

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-secondary);
  flex: 1;
}
.topbar-breadcrumb .crumb { transition: color var(--t); cursor: pointer; }
.topbar-breadcrumb .crumb:hover { color: var(--brand); }
.topbar-breadcrumb .sep { color: var(--text-muted); font-size: .75rem; }
.topbar-breadcrumb .crumb.current { color: var(--text-primary); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: background var(--t), color var(--t);
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--text-primary); }
.topbar-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--surface);
}

.topbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

.topbar-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px;
  border-radius: var(--r-sm); transition: background var(--t);
}
.topbar-user:hover { background: var(--bg); }
.topbar-user .avatar-sm {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.topbar-user .name { font-size: .84rem; font-weight: 600; }

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

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-title { font-size: 1.35rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: .84rem; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: .84rem;
  font-weight: 600;
  transition: all var(--t);
  white-space: nowrap;
}
.btn i { font-size: 13px; }
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1.5px solid var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1.5px solid var(--danger);
}
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.stat-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.stat-card-icon.green  { background: var(--chip-green-bg);  color: var(--chip-green-text); }
.stat-card-icon.blue   { background: var(--chip-blue-bg);   color: var(--chip-blue-text); }
.stat-card-icon.yellow { background: var(--chip-yellow-bg); color: var(--chip-yellow-text); }
.stat-card-icon.red    { background: var(--chip-red-bg);    color: var(--chip-red-text); }
.stat-card-icon.purple { background: var(--chip-purple-bg); color: var(--chip-purple-text); }
.stat-card-icon.brand  { background: var(--brand-light);    color: var(--brand-dark); }

.stat-badge {
  font-size: .72rem; font-weight: 600;
  padding: 2px 7px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 3px;
}
.stat-badge.up   { background: var(--chip-green-bg); color: var(--chip-green-text); }
.stat-badge.down { background: var(--chip-red-bg);   color: var(--chip-red-text); }

.stat-value {
  font-size: 1.6rem; font-weight: 700; line-height: 1;
  font-family: 'DM Mono', monospace;
  margin-bottom: 4px;
}
.stat-label { font-size: .78rem; color: var(--text-secondary); }

/* ── CARDS & PANELS ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: .95rem; font-weight: 700; }
.card-actions { display: flex; gap: 6px; align-items: center; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ── GRID LAYOUTS ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-3-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-1-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-secondary);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
}
tbody td {
  padding: 11px 16px;
  font-size: .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ── BADGES / CHIPS ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600;
  padding: 3px 9px; border-radius: 99px;
}
.badge i { font-size: 9px; }
.badge-green  { background: var(--chip-green-bg);  color: var(--chip-green-text); }
.badge-red    { background: var(--chip-red-bg);    color: var(--chip-red-text); }
.badge-yellow { background: var(--chip-yellow-bg); color: var(--chip-yellow-text); }
.badge-blue   { background: var(--chip-blue-bg);   color: var(--chip-blue-text); }
.badge-purple { background: var(--chip-purple-bg); color: var(--chip-purple-text); }
.badge-gray   { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── AVATAR GROUP ───────────────────────────────────────────── */
.avatar-group { display: flex; }
.avatar-group .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  margin-left: -6px;
}
.avatar-group .av:first-child { margin-left: 0; }
.avatar-group .av-more { background: var(--bg); color: var(--text-secondary); border-color: var(--border); }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-wrap { margin-bottom: 12px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: .78rem; margin-bottom: 5px;
}
.progress-label span:last-child { font-weight: 600; }
.progress-track {
  height: 6px; background: var(--bg);
  border-radius: 99px; overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: var(--brand);
  transition: width .6s ease;
}
.progress-fill.blue   { background: var(--info); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red    { background: var(--danger); }

/* ── TABS ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: .84rem; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  cursor: pointer; transition: color var(--t), border-color var(--t);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FORM ELEMENTS ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 5px; color: var(--text-secondary); }
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .85rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color var(--t);
  outline: none;
}
.form-control:focus { border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row { display: flex; gap: 12px; }

/* ── SELECT ─────────────────────────────────────────────────── */
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236B7280'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ── SEARCH BAR ─────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  transition: border-color var(--t);
}
.search-bar:focus-within { border-color: var(--brand); }
.search-bar i { color: var(--text-muted); font-size: 13px; }
.search-bar input { border: none; outline: none; background: none; font-size: .84rem; flex: 1; color: var(--text-primary); }

/* ── MINI CHART SPARKLINE ───────────────────────────────────── */
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.spark-bar {
  flex: 1; border-radius: 2px 2px 0 0;
  background: var(--brand-light);
  transition: background var(--t);
}
.spark-bar.active { background: var(--brand); }
.sparkline:hover .spark-bar { opacity: .6; }
.sparkline:hover .spark-bar.active { opacity: 1; }

/* ── DONUT CHART ────────────────────────────────────────────── */
.donut-wrap {
  position: relative; width: 120px; height: 120px; flex-shrink: 0;
}
.donut-wrap svg { transform: rotate(-90deg); }
.donut-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.donut-val { font-size: 1.2rem; font-weight: 700; font-family: 'DM Mono', monospace; }
.donut-lbl { font-size: .65rem; color: var(--text-muted); }

/* ── TIMELINE ───────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -24px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-light);
}
.timeline-dot.gray  { background: var(--text-muted); box-shadow: 0 0 0 2px var(--border); }
.timeline-dot.red   { background: var(--danger); box-shadow: 0 0 0 2px var(--chip-red-bg); }
.timeline-dot.blue  { background: var(--info); box-shadow: 0 0 0 2px var(--chip-blue-bg); }
.timeline-time { font-size: .72rem; color: var(--text-muted); margin-bottom: 2px; }
.timeline-text { font-size: .82rem; }
.timeline-sub  { font-size: .76rem; color: var(--text-secondary); margin-top: 2px; }

/* ── LIST ITEMS ─────────────────────────────────────────────── */
.item-list {}
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.item-row:last-child { border-bottom: none; }
.item-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: .76rem; color: var(--text-secondary); }
.item-value { font-size: .84rem; font-weight: 700; font-family: 'DM Mono', monospace; text-align: right; flex-shrink: 0; }
.item-sub   { font-size: .72rem; color: var(--text-secondary); text-align: right; }

/* ── DEPARTMENT OVERVIEW CARDS ──────────────────────────────── */
.dept-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.dept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  cursor: pointer;
  transition: all var(--t);
  position: relative;
  overflow: hidden;
}
.dept-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--dept-color, var(--brand));
}
.dept-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.dept-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-left: 8px; }
.dept-card-icon {
  width: 40px; height: 40px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.dept-card-name { font-size: .95rem; font-weight: 700; padding-left: 8px; margin-bottom: 2px; }
.dept-card-sub  { font-size: .76rem; color: var(--text-secondary); padding-left: 8px; }
.dept-card-stats { display: flex; gap: 16px; padding-left: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.dept-stat-item { flex: 1; }
.dept-stat-val  { font-size: .95rem; font-weight: 700; font-family: 'DM Mono', monospace; }
.dept-stat-lbl  { font-size: .7rem; color: var(--text-muted); }

/* ── ALERT / NOTICE STRIPS ──────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-sm);
  font-size: .84rem; margin-bottom: 16px;
}
.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-info   { background: var(--chip-blue-bg); color: var(--chip-blue-text); }
.alert-warn   { background: var(--chip-yellow-bg); color: var(--chip-yellow-text); }
.alert-error  { background: var(--chip-red-bg); color: var(--chip-red-text); }
.alert-success{ background: var(--chip-green-bg); color: var(--chip-green-text); }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 560px; max-width: 95vw; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-md);
  transform: translateY(12px);
  transition: transform var(--t);
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { color: var(--text-muted); font-size: 18px; transition: color var(--t); }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px; border-top: 1px solid var(--border);
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 40px; opacity: .3; display: block; margin-bottom: 12px; }
.empty-state p { font-size: .85rem; }

/* ── TOOLTIP ────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary); color: #fff;
  font-size: .72rem; padding: 4px 8px; border-radius: var(--r-sm);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t);
  z-index: 1000;
}
[data-tip]:hover::after { opacity: 1; }

/* ── CHART BARS (pure CSS) ──────────────────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; }
.bar-chart .bar {
  flex: 1; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--brand-light);
  transition: background var(--t);
  cursor: pointer; position: relative;
}
.bar-chart .bar:hover { background: var(--brand); }
.bar-chart .bar.highlight { background: var(--brand); }
.bar-chart .bar[data-tip]::after { bottom: calc(100% + 4px); }

/* ── KPI TREND LINE (SVG) ───────────────────────────────────── */
.trend-positive { color: var(--success); }
.trend-negative { color: var(--danger); }

/* ── KANBAN ─────────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 240px; max-width: 240px; }
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.kanban-col-title { font-size: .82rem; font-weight: 700; }
.kanban-count {
  background: var(--bg); color: var(--text-secondary);
  font-size: .72rem; font-weight: 600;
  padding: 1px 7px; border-radius: 99px;
  border: 1px solid var(--border);
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--t), transform var(--t);
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card-title { font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; }

/* ── CALENDAR MINI ──────────────────────────────────────────── */
.mini-cal { font-size: .78rem; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 700; }
.cal-header button { color: var(--text-muted); font-size: 14px; transition: color var(--t); }
.cal-header button:hover { color: var(--text-primary); }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; text-align: center; }
.cal-days .day-name { color: var(--text-muted); font-size: .7rem; padding: 4px 0; font-weight: 600; }
.cal-days .day {
  padding: 5px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t);
  color: var(--text-secondary);
}
.cal-days .day:hover { background: var(--bg); }
.cal-days .day.today { background: var(--brand); color: #fff; font-weight: 700; }
.cal-days .day.has-event { position: relative; font-weight: 600; color: var(--text-primary); }
.cal-days .day.has-event::after {
  content: ''; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.cal-days .day.other-month { opacity: .3; }

/* ── NOTIFICATIONS PANEL ────────────────────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.notif-sub   { font-size: .76rem; color: var(--text-secondary); }
.notif-time  { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }
.notif-unread { background: var(--brand-light); border-radius: var(--r-sm); padding: 2px 6px; }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { width: 58px; min-width: 58px; }
  .sidebar .nav-dept span,
  .sidebar .nav-dept .dept-arrow,
  .sidebar .nav-section-title,
  .sidebar-logo img,
  .sidebar-search,
  .sidebar-footer .user-info,
  .nav-sub { display: none; }
  .sidebar-logo { justify-content: center; }
  .nav-dept { padding: 12px; justify-content: center; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .topbar { padding: 0 14px; }
  .topbar-breadcrumb { display: none; }
}

/* ── TRANSITIONS / ANIMATIONS ───────────────────────────────── */
.fade-in {
  animation: fadeIn .25s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content { animation: fadeIn .2s ease; }

/* ── UTILITIES ──────────────────────────────────────────────── */
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm    { font-size: .78rem; }
.text-xs    { font-size: .72rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: 'DM Mono', monospace; }
.font-bold { font-weight: 700; }
.font-600  { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* Stats mini - compact 3-col stat display */
.stats-mini { display:flex; gap:12px; justify-content:space-between; }
.stats-mini > div { text-align:center; }
.stats-mini .font-bold { font-size:1.1rem; }

/* Toggle switch */
.toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; }
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; cursor:pointer; top:0; left:0; right:0; bottom:0; background:#ddd; border-radius:24px; transition:.3s; }
.toggle-slider:before { position:absolute; content:""; height:18px; width:18px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.3s; }
.toggle input:checked + .toggle-slider { background:var(--brand); }
.toggle input:checked + .toggle-slider:before { transform:translateX(20px); }

/* ── VIEW MODAL GLOBAL ───────────────────────────── */
.alert-info  { display:flex;align-items:flex-start;gap:8px;padding:10px 14px;background:var(--chip-blue-bg);color:var(--chip-blue-text);border-radius:8px;font-size:.85rem; }
.alert-warn  { display:flex;align-items:flex-start;gap:8px;padding:10px 14px;background:var(--chip-yellow-bg);color:var(--chip-yellow-text);border-radius:8px;font-size:.85rem; }
.alert-ok    { display:flex;align-items:flex-start;gap:8px;padding:10px 14px;background:var(--chip-green-bg);color:var(--chip-green-text);border-radius:8px;font-size:.85rem; }
.mb-16       { margin-bottom:16px; }
.mb-10       { margin-bottom:10px; }
.section-title { font-weight:700;font-size:.9rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin:20px 0 10px; }
.perm-row    { display:grid;grid-template-columns:1fr auto auto auto;gap:8px;align-items:center;padding:8px 12px;background:var(--bg);border-radius:8px;margin-bottom:6px; }
.perm-row label { display:flex;align-items:center;gap:4px;font-size:.82rem;white-space:nowrap;cursor:pointer; }

/* Settings tabs */
.settings-tabs { display:flex;gap:2px;background:var(--bg);padding:4px;border-radius:10px;flex-wrap:wrap;margin-bottom:24px; }
.settings-tab  { padding:8px 16px;border-radius:8px;cursor:pointer;font-size:.85rem;font-weight:500;border:none;background:transparent;color:var(--text-muted);transition:.2s; }
.settings-tab.active { background:#fff;color:var(--text);box-shadow:0 1px 4px rgba(0,0,0,.08);font-weight:600; }
.settings-section { display:none; }
.settings-section.active { display:block; }

/* User avatar */
.user-avatar { width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:.72rem;font-weight:700;flex-shrink:0; }

/* Notif row */
.notif-row { display:flex;justify-content:space-between;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--border); }
.notif-row:last-child { border-bottom:none; }

/* Brand tab colors */
.brand-tab-cgm  { border-left:3px solid #3B82F6 !important; }
.brand-tab-rbr  { border-left:3px solid var(--brand) !important; }
.brand-tab-vtv  { border-left:3px solid #F59E0B !important; }
