/* ============================================================
   OPS.AME.SO — Digital Operations Dashboard
   Full Stylesheet v2.0 — Vibrant & Productive
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:      #6366F1;
  --primary-d:    #4F46E5;
  --primary-l:    #EEF2FF;
  --brand:        #0B1F33;
  --success:      #10B981;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;
  --purple:       #8B5CF6;
  --teal:         #10B981;
  --rose:         #F43F5E;
  --amber:        #F59E0B;
  --indigo:       #6366F1;

  --bg:           #F1F5F9;
  --card:         #FFFFFF;
  --border:       #E2E8F0;
  --border-l:     #F1F5F9;

  --tx-1:         #0F172A;
  --tx-2:         #475569;
  --tx-3:         #94A3B8;

  --sidebar-w:    220px;
  --topbar-h:     60px;
  --r:            14px;
  --r-sm:         9px;
  --sh-sm:        0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --sh:           0 4px 20px rgba(0,0,0,.08),0 1px 4px rgba(0,0,0,.04);
  --sh-md:        0 8px 32px rgba(0,0,0,.12),0 2px 8px rgba(0,0,0,.06);
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease:         .2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: var(--primary); transition: color var(--ease); }
a:hover { color: var(--primary-d); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--brand);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.brand-name { font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: .04em; }
.brand-sub  { font-size: .65rem; color: rgba(255,255,255,.4); letter-spacing: .03em; margin-top: -1px; }

.sidebar-section-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.28);
  padding: 20px 18px 6px;
  text-transform: uppercase;
}

.sidebar-nav { list-style: none; padding: 0 10px; }

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,.55);
  font-size: .84rem;
  font-weight: 500;
  transition: all var(--ease);
}

.nav-link i { font-size: .95rem; width: 18px; text-align: center; }
.nav-link:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }

.nav-item.active .nav-link {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.35);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.user-avatar {
  width: 34px; height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-name { display: block; font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: block; font-size: .65rem; color: rgba(255,255,255,.35); }

.btn-logout {
  color: rgba(255,255,255,.35);
  font-size: 1rem;
  padding: 6px;
  border-radius: 7px;
  transition: all var(--ease);
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,.12); }

/* ============================================================
   TOPBAR
   ============================================================ */
.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--tx-2);
  align-items: center; justify-content: center;
  transition: background var(--ease);
}
.sidebar-toggle:hover { background: var(--border-l); }

.page-breadcrumb { font-size: .84rem; font-weight: 600; color: var(--tx-2); }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  color: var(--tx-2);
  font-size: 1rem;
  transition: all var(--ease);
}
.topbar-icon-btn:hover { background: var(--border-l); color: var(--primary); }

.topbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px; }
.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}
.topbar-user span { font-size: .84rem; font-weight: 600; color: var(--tx-1); }

/* ── Alert banner ─────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-size: .85rem;
  font-weight: 500;
}
.alert-banner-success { background: #f0fdf4; color: #166534; border-bottom: 1px solid #bbf7d0; }
.alert-banner-danger  { background: #fef2f2; color: #991b1b; border-bottom: 1px solid #fecaca; }
.alert-banner-warning { background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; }
.btn-close-flash { margin-left: auto; cursor: pointer; opacity: .6; font-size: 1rem; color: inherit; background: none; border: none; }
.btn-close-flash:hover { opacity: 1; }

/* ── Page content ─────────────────────────────────────────── */
.page-content { flex: 1; padding: 28px 28px 48px; }

/* ============================================================
   FORMS, INPUTS, CARDS — Global
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-l);
  padding: 15px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: .92rem; font-weight: 700; color: var(--tx-1); }
.card-body { padding: 20px; }

/* Forms */
.form-label { font-size: .8rem; font-weight: 600; color: var(--tx-2); margin-bottom: 5px; display: block; }
.form-control, .form-select {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-family: var(--font);
  color: var(--tx-1);
  background: #fff;
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea.form-control { resize: vertical; min-height: 100px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: .865rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .16s ease;
  font-family: var(--font);
}
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(99,102,241,.3); }
.btn-primary:hover  { background: var(--primary-d); border-color: var(--primary-d); color: #fff; }
.btn-outline   { background: transparent; color: var(--tx-2); border-color: var(--border); }
.btn-outline:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }
.btn-danger    { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover   { background: #dc2626; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: .78rem; }

/* Badges — universal */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .15px;
  white-space: nowrap;
}
.badge-primary   { background: var(--primary-l); color: var(--primary-d); }
.badge-success   { background: #ecfdf5; color: #065f46; }
.badge-warning   { background: #fffbeb; color: #92400e; }
.badge-danger    { background: #fef2f2; color: #991b1b; }
.badge-info      { background: #eff6ff; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Tables */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--tx-3);
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  white-space: nowrap;
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-l); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafbfe; }

/* Page header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { font-size: 1.45rem; font-weight: 800; color: var(--tx-1); line-height: 1.3; }
.page-subtitle { font-size: .85rem; color: var(--tx-2); margin-top: 3px; }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 500;
  color: var(--tx-2);
  background: var(--card);
  transition: all var(--ease);
}
.page-item .page-link:hover { border-color: var(--primary); color: var(--primary); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled .page-link { opacity: .4; pointer-events: none; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 2.5rem; color: var(--border); margin-bottom: 14px; }
.empty-state-title { font-size: .95rem; font-weight: 600; color: var(--tx-3); margin-bottom: 8px; }
.empty-state-text { font-size: .84rem; color: var(--tx-3); margin-bottom: 18px; }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 20px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-l);
}
.filter-bar .form-select, .filter-bar .form-control { width: auto; padding: 6px 11px; font-size: .8rem; }

/* Attachment items */
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-size: .84rem;
  margin-bottom: 8px;
}
.attachment-name { flex: 1; font-weight: 500; color: var(--tx-1); }
.attachment-size { color: var(--tx-3); font-size: .76rem; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
  padding: 28px;
  text-align: center;
  transition: all var(--ease);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-l); }

/* Status dots */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.status-dot.completed { background: var(--success); }
.status-dot.pending   { background: var(--warning); }
.status-dot.progress  { background: var(--primary); }
.status-dot.overdue   { background: var(--danger); }

/* Search */
mark { background: #fef9c3; color: var(--tx-1); border-radius: 2px; padding: 0 1px; }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0B1F33 0%, #1a3a5c 100%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh-md);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
}
.login-brand { text-align: center; margin-bottom: 32px; }
.login-brand-icon {
  width: 54px; height: 54px;
  background: var(--primary);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(99,102,241,.35);
}
.login-title { font-size: 1.35rem; font-weight: 800; color: var(--tx-1); }
.login-subtitle { font-size: .84rem; color: var(--tx-3); margin-top: 4px; }
.login-footer { text-align: center; margin-top: 24px; font-size: .76rem; color: var(--tx-3); }

/* Responsive */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; }
.sidebar-overlay.show { display: block; }
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--sh-md); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 20px 16px 32px; }
}
@media (max-width: 576px) { .page-header { flex-direction: column; } }

/* Print */
@media print {
  .sidebar, .topbar { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 0; }
  .card { box-shadow: none; }
}

/* ============================================================
   DASHBOARD — Specific Components
   ============================================================ */

/* ── Dashboard header ───────────────────────────────────────── */
.dash-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.dash-title { font-size: 1.55rem; font-weight: 800; color: var(--tx-1); line-height: 1.2; }
.dash-sub   { font-size: .84rem; color: var(--tx-2); margin-top: 4px; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-dash {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: .84rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all .16s ease;
  font-family: var(--font);
}
.btn-dash-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 10px rgba(99,102,241,.3); }
.btn-dash-primary:hover { background: var(--primary-d); color: #fff; transform: translateY(-1px); }
.btn-dash-ghost { background: var(--card); color: var(--tx-2); border: 1.5px solid var(--border); }
.btn-dash-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-l); }

/* ── Overdue alert ──────────────────────────────────────────── */
.overdue-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 11px 16px; margin-bottom: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: .82rem; color: #991b1b;
}
.overdue-strip svg { color: #dc2626; flex-shrink: 0; }
.overdue-strip strong { color: #dc2626; }
.overdue-strip a { color: #b91c1c; font-weight: 600; text-decoration: underline; }

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  border-radius: 14px;
  padding: 22px;
  display: block;
  text-decoration: none;
  color: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.kpi-card:hover { transform: translateY(-4px); color: #fff; }

.kpi-blue  { background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%); box-shadow: 0 8px 24px rgba(99,102,241,.35); }
.kpi-blue:hover  { box-shadow: 0 12px 32px rgba(99,102,241,.45); }
.kpi-teal  { background: linear-gradient(135deg, #10B981 0%, #059669 100%); box-shadow: 0 8px 24px rgba(16,185,129,.35); }
.kpi-teal:hover  { box-shadow: 0 12px 32px rgba(16,185,129,.45); }
.kpi-amber { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); box-shadow: 0 8px 24px rgba(245,158,11,.35); }
.kpi-amber:hover { box-shadow: 0 12px 32px rgba(245,158,11,.45); }
.kpi-rose  { background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%); box-shadow: 0 8px 24px rgba(244,63,94,.35); }
.kpi-rose:hover  { box-shadow: 0 12px 32px rgba(244,63,94,.45); }

.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.kpi-icon-wrap { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.kpi-value { font-size: 2.4rem; font-weight: 800; line-height: 1; margin-bottom: 12px; letter-spacing: -1.5px; }
.kpi-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.kpill {
  font-size: .66rem; font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.kpill-light  { background: rgba(255,255,255,.22); color: rgba(255,255,255,.95); }
.kpill-dim    { background: rgba(0,0,0,.12); color: rgba(255,255,255,.75); }
.kpill-danger { background: rgba(0,0,0,.2); color: #fff; }

/* ── Chart panels ───────────────────────────────────────────── */
.chart-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cpanel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 12px;
  border-bottom: 1px solid var(--border-l);
  flex-shrink: 0;
}
.cpanel-title { font-size: .9rem; font-weight: 700; color: var(--tx-1); }
.cpanel-meta  { font-size: .72rem; color: var(--tx-3); font-weight: 500; }

.cpanel-legend { display: flex; align-items: center; gap: 12px; font-size: .72rem; color: var(--tx-2); }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

.cpanel-body { flex: 1; padding: 16px 18px; display: flex; flex-direction: column; }

/* Donut with center stat */
.donut-wrap {
  position: relative;
  width: 100%;
  height: 170px;
  flex-shrink: 0;
}
.donut-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -54%);
  text-align: center;
  pointer-events: none;
}
.donut-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--tx-1); line-height: 1; }
.donut-lbl { display: block; font-size: .65rem; font-weight: 600; color: var(--tx-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* Task stat list */
.task-stat-list { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.tsl-row { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--tx-2); }
.tsl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tsl-row strong { margin-left: auto; font-weight: 700; color: var(--tx-1); font-size: .82rem; }

/* ── Bottom grid ────────────────────────────────────────────── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px;
  align-items: start;
}

.bpanel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  margin-bottom: 0;
}

.bpanel-wide { overflow: hidden; }

.bpanel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-l);
}
.bpanel-title { font-size: .9rem; font-weight: 700; color: var(--tx-1); }
.bpanel-link  { font-size: .76rem; font-weight: 600; color: var(--primary); transition: color var(--ease); }
.bpanel-link:hover { color: var(--primary-d); }

.bpanel-right { display: flex; flex-direction: column; gap: 16px; }

/* Activity table */
.acts-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.acts-table th {
  padding: 9px 16px;
  text-align: left;
  font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--tx-3);
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.acts-table td { padding: 11px 16px; border-bottom: 1px solid var(--border-l); vertical-align: middle; }
.acts-table tbody tr:last-child td { border-bottom: none; }
.acts-table tbody tr:hover td { background: #fafbfe; }
.act-date { white-space: nowrap; color: var(--tx-3); font-size: .78rem; }
.act-title {
  font-weight: 600; color: var(--tx-1); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.act-title:hover { color: var(--primary); }

/* Deadline list */
.dl-list { padding: 4px 16px 8px; }
.dl-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-l);
}
.dl-item:last-child { border-bottom: none; }

.dl-badge {
  text-align: center;
  min-width: 44px;
  padding: 6px 7px;
  border-radius: 9px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.dl-urgent { background: #fef2f2; border-color: #fca5a5; }
.dl-soon   { background: #fffbeb; border-color: #fde68a; }

.dl-day { display: block; font-size: 1rem; font-weight: 800; color: var(--tx-1); line-height: 1; }
.dl-urgent .dl-day { color: var(--danger); }
.dl-soon .dl-day   { color: var(--warning); }
.dl-mon { display: block; font-size: .6rem; font-weight: 700; color: var(--tx-3); letter-spacing: .04em; margin-top: 2px; }

.dl-body { flex: 1; min-width: 0; }
.dl-name { font-size: .82rem; font-weight: 600; color: var(--tx-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-when { font-size: .72rem; color: var(--tx-3); margin-top: 2px; }
.dl-when-red   { color: var(--danger) !important; font-weight: 600; }
.dl-when-amber { color: var(--warning) !important; font-weight: 600; }

/* Quick actions grid */
.qa-grid {
  padding: 12px 14px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qa-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .8rem; font-weight: 600;
  transition: all .15s ease;
  border: 1.5px solid transparent;
  text-decoration: none;
}

.qa-indigo { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.qa-indigo:hover { background: #E0E7FF; color: #3730A3; transform: translateY(-1px); }
.qa-amber  { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.qa-amber:hover  { background: #FEF3C7; color: #92400E; transform: translateY(-1px); }
.qa-teal   { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.qa-teal:hover   { background: #D1FAE5; color: #064E3B; transform: translateY(-1px); }
.qa-rose   { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.qa-rose:hover   { background: #FFE4E6; color: #9F1239; transform: translateY(-1px); }
.qa-slate  { background: #F8FAFC; color: #475569; border-color: #CBD5E1; }
.qa-slate:hover  { background: #F1F5F9; color: #334155; transform: translateY(-1px); }
.qa-purple { background: #F5F3FF; color: #5B21B6; border-color: #DDD6FE; }
.qa-purple:hover { background: #EDE9FE; color: #4C1D95; transform: translateY(-1px); }

/* ── Coloured badges (activity table) ──────────────────────── */
.bdg {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem; font-weight: 600;
  white-space: nowrap;
}
.bdg-done { background: #ecfdf5; color: #065f46; }
.bdg-prog { background: #eff6ff; color: #1e40af; }
.bdg-wait { background: #fffbeb; color: #92400e; }
.bdg-over { background: #fef2f2; color: #991b1b; }
.bdg-pub  { background: #ecfdf5; color: #065f46; }
.bdg-int  { background: #eff6ff; color: #1e40af; }
.bdg-conf { background: #fef2f2; color: #991b1b; }

.bdg-cat-infra  { background: #EEF2FF; color: #3730A3; }
.bdg-cat-cyber  { background: #FEF2F2; color: #991B1B; }
.bdg-cat-dev    { background: #F5F3FF; color: #5B21B6; }
.bdg-cat-admin  { background: #FFFBEB; color: #92400E; }
.bdg-cat-meet   { background: #ECFDF5; color: #065F46; }
.bdg-cat-other  { background: #F8FAFC; color: #475569; }

/* ── Responsive dashboard ───────────────────────────────────── */
@media (max-width: 1200px) {
  .chart-row { grid-template-columns: 1fr 1fr; }
  .chart-panel:nth-child(3) { grid-column: span 2; }
  .task-stat-list { flex-direction: row; gap: 16px; }
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .bpanel-right { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .chart-row { grid-template-columns: 1fr; }
  .chart-panel:nth-child(3) { grid-column: span 1; }
}
@media (max-width: 576px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .bpanel-right { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; }
}
@media (max-width: 400px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-value { font-size: 2rem; }
}

/* ============================================================
   MODULE PAGES — Activities, Tasks, Meetings, Deadlines
   ============================================================ */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.primary::before   { background: var(--primary); }
.stat-card.success::before   { background: var(--success); }
.stat-card.warning::before   { background: var(--warning); }
.stat-card.danger::before    { background: var(--danger); }
.stat-card.info::before      { background: var(--info); }
.stat-card.secondary::before { background: #64748B; }
.stat-card:hover { box-shadow: var(--sh); }

.stat-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.stat-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tx-3); }
.stat-icon { width: 38px; height: 38px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.stat-icon.primary   { background: var(--primary-l); color: var(--primary); }
.stat-icon.success   { background: #ecfdf5; color: var(--success); }
.stat-icon.warning   { background: #fffbeb; color: var(--warning); }
.stat-icon.danger    { background: #fef2f2; color: var(--danger); }
.stat-icon.info      { background: #eff6ff; color: var(--info); }
.stat-icon.secondary { background: #f1f5f9; color: #64748B; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--tx-1); line-height: 1; margin-bottom: 4px; }
.stat-detail { font-size: .76rem; color: var(--tx-3); }

/* Task/deadline overdue row highlight */
.row-overdue td { background: #fff8f8 !important; }
.row-overdue td:first-child { border-left: 3px solid var(--danger); }

/* Deadline item for module pages */
.deadline-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-l); }
.deadline-item:last-child { border-bottom: none; }
.deadline-date-badge { text-align: center; min-width: 44px; padding: 6px 8px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--border); }
.deadline-date-day   { display: block; font-size: 1.1rem; font-weight: 800; color: var(--tx-1); line-height: 1; }
.deadline-date-mon   { display: block; font-size: .62rem; font-weight: 600; color: var(--tx-3); text-transform: uppercase; }
.deadline-item.urgent .deadline-date-badge { border-color: var(--danger); background: #fef2f2; }
.deadline-item.urgent .deadline-date-day   { color: var(--danger); }

/* Quick action (module pages) */
.quick-action {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-l);
  background: var(--card);
  color: var(--tx-1);
  font-size: .875rem; font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
}
.quick-action:hover { border-color: var(--primary); background: var(--primary-l); color: var(--primary); transform: translateX(3px); }
.quick-action-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-blue   { background: rgba(99,102,241,.1); color: var(--primary); }
.qa-orange { background: rgba(245,158,11,.1); color: var(--warning); }
.qa-green  { background: rgba(16,185,129,.1); color: var(--success); }
.qa-red    { background: rgba(239,68,68,.1);  color: var(--danger); }
.qa-purple-m { background: rgba(139,92,246,.1); color: #7c3aed; }


/* ============================================================
   DASHBOARD — Upcoming Tasks Table
   ============================================================ */

.mb-4 { margin-bottom: 20px; }

/* Row states */
.task-row-overdue td { background: #fff8f8 !important; }
.task-row-overdue td:first-child { border-left: 3px solid #EF4444; padding-left: 13px; }
.task-row-urgent td { background: #fffcf5 !important; }
.task-row-urgent td:first-child { border-left: 3px solid #F59E0B; padding-left: 13px; }

/* Priority badge */
.task-priority {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  font-weight: 600;
}
.task-pri-high   { color: #991B1B; }
.task-pri-med    { color: #92400E; }
.task-pri-low    { color: #065F46; }

/* Days left badge */
.days-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.days-overdue { background: #fef2f2; color: #991b1b; }
.days-today   { background: #fef2f2; color: #991b1b; }
.days-urgent  { background: #fffbeb; color: #92400e; }
.days-soon    { background: #fffbeb; color: #b45309; }
.days-ok      { background: #f1f5f9; color: #475569; }

/* Mark done button */
.btn-mark-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: #f0fdf4;
  color: #065f46;
  border: 1.5px solid #a7f3d0;
  border-radius: 7px;
  font-size: .73rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-mark-done:hover {
  background: #10B981;
  color: #fff;
  border-color: #10B981;
}