/* ============================================================
   Para-App — نظام إدارة المستندات | RTL Arabic Design
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables (Light / Default Theme) ───────────────── */
:root, [data-theme="light"], [data-theme="artynova-light"] {
  --theme-name:    'artynova-light';
  --primary:       #1a3a6b;
  --primary-light: #2456a4;
  --primary-dark:  #0f2444;
  --accent:        #e8a020;
  --accent-light:  #f5c05a;
  --success:       #1a8a50;
  --danger:        #c0392b;
  --warning:       #d97706;
  --info:          #0e7490;
  --incoming:      #0e7490;
  --outgoing:      #7c3aed;
  --bg:            #f0f2f7;
  --surface:       #ffffff;
  --surface2:      #f8fafc;
  --border:        #e2e8f0;
  --border-focus:  #2456a4;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --sidebar-bg:    #0f2444;
  --sidebar-border: rgba(255,255,255,0.08);
  --topbar-bg:     #ffffff;
  --input-bg:      #ffffff;
  --card-bg:       #ffffff;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .2s ease;
  --badge-opacity: 0.15;
}

/* ─── Artynova Dark Theme ────────────────────────────────── */
[data-theme="dark"], [data-theme="artynova-dark"], body.dark-theme {
  --theme-name:    'artynova-dark';
  --primary:       #38bdf8;
  --primary-light: #0284c7;
  --primary-dark:  #081022;
  --accent:        #f59e0b;
  --accent-light:  #fbbf24;
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #06b6d4;
  --incoming:      #06b6d4;
  --outgoing:      #a855f7;
  --bg:            #0b1329;
  --surface:       #111e38;
  --surface2:      #182849;
  --border:        #1e355b;
  --border-focus:  #38bdf8;
  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-light:    #64748b;
  --sidebar-bg:    #081022;
  --sidebar-border: #162644;
  --topbar-bg:     #111e38;
  --input-bg:      #182849;
  --card-bg:       #111e38;
  --shadow:        0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.6);
  --badge-opacity: 0.25;
}

/* ─── Elegant Navy Theme ─────────────────────────────────── */
[data-theme="elegant"], [data-theme="navy"] {
  --theme-name:    'elegant';
  --primary:       #818cf8;
  --primary-light: #6366f1;
  --primary-dark:  #0a0f1d;
  --accent:        #fbbf24;
  --accent-light:  #fde047;
  --success:       #34d399;
  --danger:        #fb7185;
  --warning:       #fbbf24;
  --info:          #38bdf8;
  --incoming:      #38bdf8;
  --outgoing:      #c084fc;
  --bg:            #0a0f1d;
  --surface:       #111827;
  --surface2:      #1f2937;
  --border:        #374151;
  --border-focus:  #818cf8;
  --text:          #f9fafb;
  --text-muted:    #9ca3af;
  --text-light:    #6b7280;
  --sidebar-bg:    #0a0f1d;
  --sidebar-border: #1f2937;
  --topbar-bg:     #111827;
  --input-bg:      #1f2937;
  --card-bg:       #111827;
  --shadow:        0 4px 20px rgba(0,0,0,.45);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.65);
  --badge-opacity: 0.25;
}

/* ─── Slate Professional Theme ───────────────────────────── */
[data-theme="slate"] {
  --theme-name:    'slate';
  --primary:       #38bdf8;
  --primary-light: #0284c7;
  --primary-dark:  #0f172a;
  --accent:        #34d399;
  --accent-light:  #6ee7b7;
  --success:       #22c55e;
  --danger:        #f43f5e;
  --warning:       #eab308;
  --info:          #06b6d4;
  --incoming:      #06b6d4;
  --outgoing:      #a855f7;
  --bg:            #0f172a;
  --surface:       #1e293b;
  --surface2:      #334155;
  --border:        #475569;
  --border-focus:  #38bdf8;
  --text:          #f8fafc;
  --text-muted:    #94a3b8;
  --text-light:    #64748b;
  --sidebar-bg:    #0f172a;
  --sidebar-border: #334155;
  --topbar-bg:     #1e293b;
  --input-bg:      #334155;
  --card-bg:       #1e293b;
  --shadow:        0 4px 20px rgba(0,0,0,.4);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.6);
  --badge-opacity: 0.25;
}

/* ─── Reset ─────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Cairo',sans-serif;font-size:15px;color:var(--text);background:var(--bg);direction:rtl;min-height:100vh;line-height:1.6}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
input,select,textarea,button{font-family:inherit;font-size:inherit}

/* ─── Layout ────────────────────────────────────────────── */
.app-wrapper{display:flex;min-height:100vh}

/* SIDEBAR */
.sidebar{
  width:var(--sidebar-w);flex-shrink:0;background:var(--primary-dark);
  display:flex;flex-direction:column;position:fixed;top:0;right:0;
  height:100vh;overflow-y:auto;z-index:200;
  transition:transform var(--transition);
  scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15);border-radius:4px}

.sidebar-brand{
  display:flex;align-items:center;gap:12px;
  padding:22px 20px 18px;border-bottom:1px solid rgba(255,255,255,.08);
}
.brand-icon{
  display:flex;align-items:center;justify-content:center;
  width:38px;height:38px;flex-shrink:0;
}
.brand-mini-logo{
  width:100%;height:100%;max-width:38px;max-height:38px;
  object-fit:contain;filter:drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.brand-title{font-size:16px;font-weight:700;color:#fff}
.brand-sub{font-size:11px;color:rgba(255,255,255,.5);margin-top:2px}

.sidebar-nav{flex:1;padding:16px 12px}
.nav-section-title{
  font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:rgba(255,255,255,.35);padding:16px 8px 6px;
}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:10px 12px;
  border-radius:var(--radius-sm);color:rgba(255,255,255,.7);
  font-size:14px;font-weight:500;transition:all var(--transition);margin-bottom:2px;
}
.nav-item:hover{background:rgba(255,255,255,.08);color:#fff;transform:translateX(-3px)}
.nav-item.active{background:var(--primary-light);color:#fff;box-shadow:0 4px 12px rgba(36,86,164,.4)}
.nav-item-create{
  background:linear-gradient(135deg,var(--accent),var(--accent-light));
  color:var(--primary-dark)!important;font-weight:700;margin-top:8px;
}
.nav-item-create:hover{opacity:.9;transform:translateX(-3px)}
.nav-icon{font-size:16px;width:20px;text-align:center}

.sidebar-footer{padding:16px;border-top:1px solid rgba(255,255,255,.08)}
.sidebar-user{display:flex;align-items:center;gap:10px}
.user-avatar-sm{
  width:36px;height:36px;border-radius:50%;background:var(--primary-light);
  color:#fff;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;flex-shrink:0;
}
.user-name-sm{font-size:13px;font-weight:600;color:#fff}
.user-role-sm{font-size:11px;color:rgba(255,255,255,.5)}
.user-meta{flex:1;min-width:0}
.logout-btn{
  width:32px;height:32px;border-radius:50%;background:rgba(255,255,255,.08);
  display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.6);
  font-size:16px;transition:all var(--transition);
}
.logout-btn:hover{background:var(--danger);color:#fff}

/* MAIN */
.main-area{
  flex:1;margin-right:var(--sidebar-w);display:flex;flex-direction:column;min-height:100vh;
}

/* TOPBAR */
.topbar{
  height:var(--topbar-h);background:var(--surface);border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:16px;padding:0 28px;
  position:sticky;top:0;z-index:100;box-shadow:0 1px 8px rgba(0,0,0,.05);
}
.topbar-title{font-size:18px;font-weight:700;color:var(--primary);flex:1}
.topbar-org{font-size:12px;color:var(--text-muted)}
.sidebar-toggle{
  display:none;background:none;border:none;cursor:pointer;
  font-size:22px;color:var(--text-muted);padding:4px;
}

/* PAGE CONTENT */
.page-content{flex:1;padding:28px;max-width:1400px;width:100%}

/* ─── Cards ─────────────────────────────────────────────── */
.card{
  background:var(--surface);border-radius:var(--radius);
  box-shadow:var(--shadow);border:1px solid var(--border);
  overflow:hidden;
}
.card-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 24px;border-bottom:1px solid var(--border);
  background:var(--surface2);
}
.card-title{font-size:16px;font-weight:700;color:var(--primary)}
.card-body{padding:24px}

/* ─── Stat Widgets ──────────────────────────────────────── */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:20px;margin-bottom:28px}
.stat-card{
  background:var(--surface);border-radius:var(--radius);padding:24px;
  border:1px solid var(--border);box-shadow:var(--shadow);
  display:flex;align-items:center;gap:16px;position:relative;overflow:hidden;
  transition:transform var(--transition),box-shadow var(--transition);
}
.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-lg)}
.stat-card::before{
  content:'';position:absolute;top:0;right:0;width:4px;height:100%;
  background:var(--stat-color,var(--primary));
}
.stat-icon{
  width:52px;height:52px;border-radius:14px;display:flex;align-items:center;
  justify-content:center;font-size:24px;flex-shrink:0;
  background:color-mix(in srgb,var(--stat-color,var(--primary)) 12%,transparent);
}
.stat-value{font-size:28px;font-weight:800;color:var(--text);line-height:1}
.stat-label{font-size:13px;color:var(--text-muted);margin-top:4px;font-weight:500}
.stat-card.blue  {--stat-color:var(--primary)}
.stat-card.teal  {--stat-color:var(--incoming)}
.stat-card.purple{--stat-color:var(--outgoing)}
.stat-card.green {--stat-color:var(--success)}
.stat-card.orange{--stat-color:var(--warning)}
.stat-card.red   {--stat-color:var(--danger)}

/* ─── Dashboard Cards ───────────────────────────────────── */
.dashboard-cards{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:20px;margin-bottom:28px;
}
.card.danger-card{
  --stat-color:var(--danger);
  border:1px solid color-mix(in srgb,var(--danger) 30%,transparent);
}
.card.danger-card .card-icon{
  background:color-mix(in srgb,var(--danger) 12%,transparent);
}
.dashboard-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:20px;
}

/* ─── Reports Menu ──────────────────────────────────────── */
.reports-menu{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin:20px 0;
}
.report-card{
  display:flex;align-items:center;gap:12px;padding:16px 20px;
  border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);
  transition:all var(--transition);
}
.report-card:hover{
  transform:translateY(-3px);box-shadow:var(--shadow-lg);
  border-color:var(--primary-light);
}
.report-card.active{
  border-color:var(--primary);background:color-mix(in srgb,var(--primary) 5%,var(--surface));
}
.report-icon{font-size:24px}
.report-title{font-weight:600;color:var(--text)}

/* ─── Filters ───────────────────────────────────────────── */
.filters-bar{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:18px 20px;margin-bottom:22px;display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;
}
.filter-group{display:flex;flex-direction:column;gap:5px;min-width:150px}
.filter-group label{font-size:12px;font-weight:600;color:var(--text-muted);}

/* ─── Table ─────────────────────────────────────────────── */
.table-wrap{overflow-x:auto;border-radius:var(--radius-sm)}
table{width:100%;border-collapse:collapse;font-size:14px}
thead th{
  background:var(--surface2);color:var(--text-muted);font-weight:600;
  font-size:12px;padding:12px 16px;border-bottom:2px solid var(--border);
  white-space:nowrap;
}
tbody tr{border-bottom:1px solid var(--border);transition:background var(--transition)}
tbody tr:hover{background:var(--surface2)}
tbody tr:last-child{border-bottom:none}
td{padding:14px 16px;vertical-align:middle}
.td-ref{font-family:monospace;font-weight:700;color:var(--primary);font-size:13px}
.td-subject{font-weight:600;max-width:280px}
.td-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.td-muted{color:var(--text-muted);font-size:13px}
.td-actions{display:flex;gap:6px;align-items:center}

/* ─── Badges ────────────────────────────────────────────── */
.badge{
  display:inline-flex;align-items:center;gap:4px;padding:3px 10px;
  border-radius:20px;font-size:12px;font-weight:600;white-space:nowrap;
}
.badge-incoming {background:#e0f2fe;color:#0369a1}
.badge-outgoing {background:#f3e8ff;color:#7c3aed}
.badge-warning  {background:#fef3c7;color:#92400e}
.badge-success  {background:#d1fae5;color:#065f46}
.badge-secondary{background:#f1f5f9;color:#475569}
.badge-dark     {background:#1e293b;color:#94a3b8}
.badge-info     {background:#e0f2fe;color:#0e7490}
.badge-expense  {background:#fee2e2;color:#991b1b}
.badge-revenue  {background:#d1fae5;color:#065f46}

/* ─── Buttons ───────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;gap:7px;padding:9px 18px;
  border-radius:var(--radius-sm);font-weight:600;font-size:14px;
  cursor:pointer;border:none;transition:all var(--transition);white-space:nowrap;
}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-primary{background:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-light);box-shadow:0 4px 12px rgba(26,58,107,.3)}
.btn-accent{background:var(--accent);color:var(--primary-dark)}
.btn-accent:hover{background:var(--accent-light)}
.btn-success{background:var(--success);color:#fff}
.btn-success:hover{filter:brightness(1.1)}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger:hover{filter:brightness(1.1)}
.btn-secondary{background:var(--surface2);color:var(--text);border:1px solid var(--border)}
.btn-secondary:hover{background:var(--border)}
.btn-sm{padding:6px 12px;font-size:13px;border-radius:6px}
.btn-icon{padding:7px;border-radius:8px}

/* ─── Forms ─────────────────────────────────────────────── */
.form-grid{display:grid;gap:20px}
.form-grid-2{grid-template-columns:1fr 1fr}
.form-grid-3{grid-template-columns:1fr 1fr 1fr}
.form-group{display:flex;flex-direction:column;gap:6px}
.form-group label{font-size:13px;font-weight:600;color:var(--text)}
.form-group label .req{color:var(--danger);margin-right:2px}
.form-control{
  padding:10px 14px;border:1.5px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text);width:100%;
  transition:border-color var(--transition),box-shadow var(--transition);
}
.form-control:focus{outline:none;border-color:var(--primary-light);box-shadow:0 0 0 3px rgba(36,86,164,.12)}
.form-control:invalid:not(:placeholder-shown){border-color:var(--danger)}
textarea.form-control{resize:vertical;min-height:100px}
.form-hint{font-size:12px;color:var(--text-muted)}
.form-section{
  border:1px solid var(--border);border-radius:var(--radius);padding:20px;
  margin-top:8px;background:var(--surface2);
}
.form-section-title{
  font-size:14px;font-weight:700;color:var(--primary);margin-bottom:16px;
  padding-bottom:10px;border-bottom:1px solid var(--border);
}
.form-row{display:flex;gap:15px;margin-bottom:15px;}
.form-row .form-group{flex:1;}

/* Form Builder Styles */
.form-field-builder{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 15px;
  background-color: var(--surface2);
}
.field-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.field-header h4{
  margin: 0;
  color: var(--text);
}

/* Upload Area */
.upload-area{
  border:2px dashed var(--border);border-radius:var(--radius);
  padding:32px;text-align:center;cursor:pointer;
  transition:all var(--transition);background:var(--surface2);
}
.upload-area:hover,.upload-area.dragover{border-color:var(--primary-light);background:#eff6ff}
.upload-area-icon{font-size:40px;margin-bottom:10px}
.upload-area-text{font-size:14px;color:var(--text-muted)}
.upload-area input[type=file]{display:none}

/* Attachment list */
.attachment-item{
  display:flex;align-items:center;gap:12px;padding:10px 14px;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface);margin-top:8px;
}
.attachment-icon{font-size:22px}
.attachment-name{flex:1;font-size:13px;font-weight:600}
.attachment-size{font-size:12px;color:var(--text-muted)}

/* ─── Flash ─────────────────────────────────────────────── */
.flash{
  display:flex;align-items:center;gap:10px;padding:14px 20px;margin:16px 28px 0;
  border-radius:var(--radius-sm);font-weight:500;font-size:14px;
}
.flash-success{background:#d1fae5;color:#065f46;border:1px solid #6ee7b7}
.flash-error  {background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}
.flash-info   {background:#dbeafe;color:#1e40af;border:1px solid #93c5fd}
.flash-close{margin-right:auto;background:none;border:none;font-size:20px;cursor:pointer;opacity:.5;line-height:1}
.flash-close:hover{opacity:1}

/* ─── Empty State ───────────────────────────────────────── */
.empty-state{text-align:center;padding:60px 20px;color:var(--text-muted)}
.empty-icon{font-size:64px;margin-bottom:16px;opacity:.4}
.empty-state h3{font-size:18px;color:var(--text);margin-bottom:8px}
.empty-state p{font-size:14px}

/* ─── Pagination ────────────────────────────────────────── */
.pagination{display:flex;gap:6px;align-items:center;justify-content:center;margin-top:20px}
.page-btn{
  width:36px;height:36px;border-radius:8px;display:flex;align-items:center;
  justify-content:center;font-size:13px;font-weight:600;border:1px solid var(--border);
  background:var(--surface);color:var(--text);cursor:pointer;transition:all var(--transition);
}
.page-btn:hover,.page-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.page-btn.disabled{opacity:.4;cursor:not-allowed}

/* ─── Detail View ───────────────────────────────────────── */
.detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.detail-item{}
.detail-label{font-size:12px;font-weight:700;color:var(--text-muted);text-transform:uppercase;margin-bottom:4px}
.detail-value{font-size:15px;color:var(--text);font-weight:500}
.detail-full{grid-column:1/-1}

/* ─── Login ─────────────────────────────────────────────── */
.login-page{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#0c1626 0%,#1a3a6b 50%,#0f2444 100%);
  padding:24px;
}
.login-card{
  background:var(--surface);border-radius:24px;padding:44px 38px;
  width:100%;max-width:440px;box-shadow:0 24px 64px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,0.08);
}
.login-main-logo{
  width:100%;max-width:260px;height:auto;object-fit:contain;
}
.login-branding{text-align:center;margin-bottom:28px}
.login-logo-sub{font-size:13px;color:var(--text-muted);margin-top:4px}
.login-title{font-size:22px;font-weight:700;text-align:center;margin-bottom:28px;color:var(--text)}

/* ─── Page Headers ──────────────────────────────────────── */
.page-header{
  display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;
}
.page-header-title h1{font-size:22px;font-weight:800;color:var(--primary)}
.page-header-title p{font-size:13px;color:var(--text-muted);margin-top:2px}
.page-header-actions{display:flex;gap:10px}

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay{
  display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);
  z-index:500;align-items:center;justify-content:center;
}
.modal-overlay.open{display:flex}
.modal{
  background:var(--surface);border-radius:var(--radius);max-width:480px;width:90%;
  box-shadow:var(--shadow-lg);animation:modalIn .2s ease;
}
@keyframes modalIn{from{transform:scale(.9);opacity:0}to{transform:scale(1);opacity:1}}
.modal-header{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.modal-title{font-size:16px;font-weight:700;color:var(--primary)}
.modal-body{padding:24px}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;gap:10px;justify-content:flex-end}

/* ─── Chart area ────────────────────────────────────────── */
.chart-container{position:relative;height:280px}

/* ─── Report Table ──────────────────────────────────────── */
.report-table{width:100%;border-collapse:collapse;margin-top:15px;}
.report-table th, .report-table td{border:1px solid var(--border);padding:8px;text-align:right;}
.report-table th{background-color:var(--surface2);font-weight:600;}
.table-actions{margin-bottom:15px;display:flex;gap:10px;}

/* ─── Responsive ────────────────────────────────────────── */
@media(max-width:900px){
  .sidebar{transform:translateX(100%)}
  .sidebar.open{transform:translateX(0)}
  .main-area{margin-right:0}
  .sidebar-toggle{display:flex}
  .form-grid-2,.form-grid-3{grid-template-columns:1fr}
  .detail-grid{grid-template-columns:1fr}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .dashboard-grid{grid-template-columns:1fr}
  .page-content{padding:16px}
  .form-row{flex-direction:column;gap:15px;}
}
@media(max-width:480px){
  .stats-grid{grid-template-columns:1fr}
  .login-card{padding:32px 24px}
  .filters-bar{flex-direction:column}
  .reports-menu{grid-template-columns:1fr}
  .dashboard-cards{grid-template-columns:1fr}
}

/* ============================================================
   Artynova Management System — Additional Styles
   ============================================================ */

/* ─── Artynova Brand Colors ─────────────────────────────────── */
:root {
  --stage-inspection:      #0891b2;
  --stage-design:          #7c3aed;
  --stage-tech-office:     #6d28d9;
  --stage-operation:       #d97706;
  --stage-qc:              #ea580c;
  --stage-installation:    #0f766e;
  --stage-guarantee:       #16a34a;
  --delivery-on-track:     #16a34a;
  --delivery-at-risk:      #d97706;
  --delivery-overdue:      #dc2626;
}

/* ─── Badge Extensions ─────────────────────────────────────── */
.badge-purple   { background:#7c3aed22; color:#7c3aed; }
.badge-orange   { background:#ea580c22; color:#ea580c; }
.badge-teal     { background:#0f766e22; color:#0f766e; }
.badge-blue     { background:#1d4ed822; color:#1d4ed8; }
.badge-info     { background:#0891b222; color:#0891b2; }
.badge-incoming { background:#0e749022; color:#0e7490; }
.badge-outgoing { background:#7c3aed22; color:#7c3aed; }

/* ─── Project Timeline ─────────────────────────────────────── */
.project-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 20px 0;
  position: relative;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 80px;
}
.timeline-step::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 50%;
  left: -50%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}
.timeline-step:first-child::before { display: none; }
.timeline-step.completed::before   { background: var(--success); }
.timeline-step.current::before     { background: linear-gradient(to left, var(--border), var(--success)); }

.timeline-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  position: relative; z-index: 1;
  transition: all .3s ease;
}
.timeline-step.completed .timeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.timeline-step.current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(232,160,32,.2);
  animation: pulse 2s infinite;
}
.timeline-step.rejected .timeline-dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.timeline-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  white-space: nowrap;
}
.timeline-step.completed .timeline-label { color: var(--success); }
.timeline-step.current .timeline-label   { color: var(--accent); font-weight: 700; }
.timeline-date {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 3px;
  text-align: center;
}

/* ─── Delivery Status ──────────────────────────────────────── */
.delivery-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 20px;
  font-weight: 700; font-size: 14px;
}
.delivery-on-track { background: #16a34a22; color: #16a34a; }
.delivery-at-risk  { background: #d9770622; color: #d97706; }
.delivery-overdue  { background: #dc262622; color: #dc2626; animation: pulse 2s infinite; }
.delivery-completed { background: #1d4ed822; color: #1d4ed8; }

/* ─── Project Card ─────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: var(--primary);
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.project-card.stage-inspection::before  { background: var(--stage-inspection); }
.project-card.stage-design::before      { background: var(--stage-design); }
.project-card.stage-operation::before   { background: var(--stage-operation); }
.project-card.stage-qc::before          { background: var(--stage-qc); }
.project-card.stage-installation::before { background: var(--stage-installation); }
.project-card.stage-guarantee::before   { background: var(--stage-guarantee); }

.project-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.project-number {
  font-size: 13px; font-weight: 700; color: var(--primary);
  font-family: monospace; letter-spacing: 0.05em;
}
.project-client {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin: 4px 0;
}
.project-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px;
}

/* ─── Stage Progress Bar ───────────────────────────────────── */
.stage-progress {
  display: flex; gap: 4px; margin: 12px 0;
}
.stage-progress-step {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--border);
  transition: background .3s;
}
.stage-progress-step.done    { background: var(--success); }
.stage-progress-step.current { background: var(--accent); }

/* ─── Visit Cards ──────────────────────────────────────────── */
.visit-list { display: grid; gap: 12px; }
.visit-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex; align-items: center; gap: 16px;
}
.visit-number {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  flex-shrink: 0;
}
.visit-card.completed .visit-number { background: var(--success); }
.visit-card.cancelled .visit-number { background: var(--danger); }

/* ─── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border);
  margin-bottom: 24px; overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 18px;
  border: none; border-bottom: 3px solid transparent;
  background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
  margin-bottom: -2px;
}
.tab-btn:hover  { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── QC Checklist ─────────────────────────────────────────── */
.qc-checklist { display: grid; gap: 8px; }
.qc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface2); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.qc-item-result.pass  { color: var(--success); font-weight: 700; }
.qc-item-result.fail  { color: var(--danger); font-weight: 700; }
.qc-item-result.na    { color: var(--text-muted); }

/* ─── File Stage Grid ──────────────────────────────────────── */
.files-stage-section { margin-bottom: 24px; }
.files-stage-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.file-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  transition: all var(--transition);
}
.file-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.file-icon { font-size: 28px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Guarantee Status ─────────────────────────────────────── */
.guarantee-card {
  background: linear-gradient(135deg, #16a34a08, #16a34a15);
  border: 1px solid #16a34a40;
  border-radius: var(--radius);
  padding: 24px;
}
.guarantee-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 16px 0;
}
.guarantee-date-item { text-align: center; }
.guarantee-date-label { font-size: 12px; color: var(--text-muted); }
.guarantee-date-value { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 4px; }
.guarantee-expired { background: #dc262608; border-color: #dc262640; }
.guarantee-expired .guarantee-date-value { color: var(--danger); }

/* ─── Maintenance Priority Colors ──────────────────────────── */
.priority-urgent { border-right: 4px solid #dc2626 !important; }
.priority-high   { border-right: 4px solid #d97706 !important; }
.priority-medium { border-right: 4px solid #0891b2 !important; }
.priority-low    { border-right: 4px solid #94a3b8 !important; }

/* ─── Activity Log ─────────────────────────────────────────── */
.activity-log-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-log-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.activity-content { flex: 1; }
.activity-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Dashboard Artynova ───────────────────────────────────── */
.stage-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.stage-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  position: relative; overflow: hidden;
}
.stage-stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.stage-stat-icon { font-size: 24px; margin-bottom: 8px; }
.stage-stat-value { font-size: 24px; font-weight: 800; color: var(--text); }
.stage-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.urgent-actions { display: grid; gap: 8px; }
.urgent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-right: 4px solid var(--danger);
  transition: all var(--transition);
}
.urgent-item:hover { background: var(--surface2); }
.urgent-item-text { flex: 1; }
.urgent-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.urgent-item-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── Notification Center ──────────────────────────────────── */
.notification-item {
  display: flex; gap: 12px; padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notification-item:hover { background: var(--surface2); }
.notification-item.unread { background: #1a3a6b08; }
.notification-item.unread .notification-title { font-weight: 700; }
.notification-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 6px;
}
.notification-item.read .notification-dot { background: var(--border); }
.notification-body { flex: 1; }
.notification-title { font-size: 14px; color: var(--text); }
.notification-message { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.notification-time { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ============================================================
   DARK MODE COMPONENT ADJUSTMENTS & HIGH CONTRAST RULES
   ============================================================ */
[data-theme="dark"], [data-theme="artynova-dark"], [data-theme="elegant"], [data-theme="slate"] {
  color-scheme: dark;
}

[data-theme="dark"] .sidebar, [data-theme="elegant"] .sidebar, [data-theme="slate"] .sidebar {
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
}

[data-theme="dark"] .topbar, [data-theme="elegant"] .topbar, [data-theme="slate"] .topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .card, [data-theme="elegant"] .card, [data-theme="slate"] .card {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .card-header, [data-theme="elegant"] .card-header, [data-theme="slate"] .card-header {
  background: var(--surface2);
  border-bottom-color: var(--border);
}

[data-theme="dark"] thead th, [data-theme="elegant"] thead th, [data-theme="slate"] thead th {
  background: var(--surface2);
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

[data-theme="dark"] tbody tr:hover, [data-theme="elegant"] tbody tr:hover, [data-theme="slate"] tbody tr:hover {
  background: rgba(56, 189, 248, 0.04);
}

[data-theme="dark"] .form-control, [data-theme="elegant"] .form-control, [data-theme="slate"] .form-control {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .form-control:focus, [data-theme="elegant"] .form-control:focus, [data-theme="slate"] .form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

[data-theme="dark"] select.form-control option, [data-theme="elegant"] select.form-control option, [data-theme="slate"] select.form-control option {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .form-section, [data-theme="elegant"] .form-section, [data-theme="slate"] .form-section {
  background: var(--surface2);
  border-color: var(--border);
}

[data-theme="dark"] .upload-area, [data-theme="elegant"] .upload-area, [data-theme="slate"] .upload-area {
  background: var(--surface2);
  border-color: var(--border);
}

[data-theme="dark"] .upload-area:hover, [data-theme="elegant"] .upload-area:hover, [data-theme="slate"] .upload-area:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--primary);
}

[data-theme="dark"] .filters-bar, [data-theme="elegant"] .filters-bar, [data-theme="slate"] .filters-bar {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .project-timeline, [data-theme="elegant"] .project-timeline, [data-theme="slate"] .project-timeline {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .timeline-step.pending .timeline-dot, [data-theme="elegant"] .timeline-step.pending .timeline-dot, [data-theme="slate"] .timeline-step.pending .timeline-dot {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .flash-success, [data-theme="elegant"] .flash-success, [data-theme="slate"] .flash-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .flash-error, [data-theme="elegant"] .flash-error, [data-theme="slate"] .flash-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .flash-info, [data-theme="elegant"] .flash-info, [data-theme="slate"] .flash-info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* ─── Online Users Widget (Stories / Corporate Pulse Bar) ──── */
.online-users-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  position: relative;
}

.online-users-container::-webkit-scrollbar {
  height: 4px;
}
.online-users-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.online-users-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}
.online-users-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.online-count-badge {
  background: rgba(16, 185, 129, 0.18);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.online-users-list {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.online-user-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition);
  padding: 4px;
  border-radius: var(--radius-sm);
  min-width: 62px;
}
.online-user-card:hover {
  transform: translateY(-2px);
}

.online-avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}
.online-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  border: 2px solid var(--surface);
}
.online-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}

.online-status-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: onlinePulse 2s infinite;
}
.online-status-dot.idle {
  background: #f59e0b;
  animation: none;
}
.online-status-dot.offline {
  background: #94a3b8;
  animation: none;
}

@keyframes onlinePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.online-user-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-user-role {
  font-size: 9px;
  color: var(--text-muted);
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Theme Switcher Dropdown in Topbar ─────────────────────── */
.theme-switcher-wrapper {
  position: relative;
}
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle-btn:hover {
  background: var(--border);
  transform: rotate(15deg);
}
.theme-dropdown {
  position: absolute;
  top: 115%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  width: 210px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.theme-dropdown.show {
  display: flex;
  animation: fadeInDown 0.2s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: right;
  width: 100%;
}
.theme-option:hover {
  background: var(--surface2);
  border-color: var(--border);
}
.theme-option.active {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  font-weight: 700;
  border-color: var(--primary);
}
.theme-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ─── Profile Settings Page Styles ─────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.profile-card-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.profile-avatar-large-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.profile-avatar-large {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
}
.profile-avatar-large-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--surface);
}

.profile-nav-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  text-align: right;
}
.profile-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
}
.profile-tab-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.profile-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,58,107,0.25);
}

/* ─── Installation Address Highlight Card ──────────────────── */
.installation-address-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(245, 158, 11, 0.08));
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.installation-address-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.installation-address-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
}

/* ============================================================
   EXECUTIVE DASHBOARD REDESIGN STYLES
   ============================================================ */

.dash-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Dashboard Header ─────────────────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 6px;
}
.dash-title-group h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.dash-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ─── Compact KPI Grid ─────────────────────────────────────── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 768px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.dash-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.dash-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  border-color: var(--primary-light);
}
.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.dash-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.dash-kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.dash-kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}
.dash-kpi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.dash-kpi-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* KPI Color Variations */
.kpi-blue   .dash-kpi-icon { background: rgba(56, 189, 248, 0.12); color: #0284c7; }
.kpi-amber  .dash-kpi-icon { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.kpi-green  .dash-kpi-icon { background: rgba(16, 185, 129, 0.12); color: #059669; }
.kpi-rose   .dash-kpi-icon { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.kpi-purple .dash-kpi-icon { background: rgba(168, 85, 247, 0.12); color: #9333ea; }
.kpi-teal   .dash-kpi-icon { background: rgba(20, 184, 166, 0.12); color: #0d9488; }

/* ─── Interactive Project Pipeline Flow ────────────────────── */
.dash-pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.dash-pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-pipeline-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-pipeline-flow {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
@media (max-width: 1024px) {
  .dash-pipeline-flow {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
  }
  .dash-pipeline-step {
    min-width: 120px;
  }
}

.dash-pipeline-step {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  position: relative;
}
.dash-pipeline-step:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.dash-pipeline-step.has-projects {
  border-top: 3px solid var(--primary);
}
.dash-pipeline-step-icon {
  font-size: 18px;
}
.dash-pipeline-step-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.dash-pipeline-step-count {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  background: var(--surface);
  border-radius: 12px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  min-width: 32px;
}

/* ─── Multi-Column Asymmetric Layouts ──────────────────────── */
.dash-grid-2col {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 24px;
}
.dash-grid-3col {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 20px;
}
.dash-grid-equal-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1100px) {
  .dash-grid-2col,
  .dash-grid-3col,
  .dash-grid-equal-2 {
    grid-template-columns: 1fr;
  }
}

/* ─── Compact Data Tables ─────────────────────────────────── */
.dash-table-wrap {
  overflow-x: auto;
  margin: 0 -24px -24px;
}
.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dash-table thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  white-space: nowrap;
}
.dash-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.dash-table tbody tr:hover {
  background: var(--surface2);
}
.dash-table tbody tr:last-child {
  border-bottom: none;
}
.dash-table td {
  padding: 11px 16px;
  vertical-align: middle;
}

/* ─── Progress Bar ─────────────────────────────────────────── */
.dash-progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}
.dash-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}
.dash-progress-fill.success {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.dash-progress-fill.warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.dash-progress-fill.danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ─── Urgent Action Cards ──────────────────────────────────── */
.dash-urgent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: all var(--transition);
}
.dash-urgent-item:hover {
  border-color: var(--danger);
  transform: translateX(-3px);
}
.dash-urgent-item.overdue {
  border-right: 4px solid var(--danger);
}
.dash-urgent-item.at_risk {
  border-right: 4px solid var(--warning);
}
.dash-urgent-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dash-urgent-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.dash-urgent-title:hover {
  color: var(--primary);
}
.dash-urgent-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Activity Timeline Feed ───────────────────────────────── */
.dash-activity-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}
.dash-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.dash-activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-activity-content {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
}
.dash-activity-title {
  font-size: 12px;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.4;
}
.dash-activity-time {
  font-size: 10px;
  color: var(--text-muted);
}

/* ─── Team Workload List ───────────────────────────────────── */
.dash-workload-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-workload-item:last-child {
  border-bottom: none;
}
.dash-workload-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.dash-workload-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dash-workload-initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-workload-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.dash-workload-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Quick Actions Floating Grid ──────────────────────────── */
.dash-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.dash-quick-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}
.dash-quick-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26,58,107,0.25);
}
.dash-quick-btn span.dash-quick-icon {
  font-size: 20px;
}

/* ─── Performance Summary Tiles ────────────────────────────── */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 768px) {
  .dash-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.dash-metric-box {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
  text-align: center;
}
.dash-metric-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.dash-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}