/**
 * AXION Automotive Operations Intelligence — Dashboard Styles
 * Inspired by Modern High-Tech Automotive Operations ERP Architecture
 * Strict Constraint: All components rendered in 'Times New Roman'
 */

:root {
  --font-serif: "Times New Roman", Times, Georgia, serif;
  
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-subtle: #f8fafc;
  
  --border-main: #e2e8f0;
  --border-light: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-blue-light: #eff6ff;
  
  --color-purple: #8b5cf6;
  --color-orange: #f97316;
  --color-green: #10b981;
  --color-cyan: #06b6d4;
  --color-coral: #ef4444;
  --color-teal: #0d9488;
}

/* ==========================================================================
   SYSTEM TYPOGRAPHY & BOX MODEL (Modern UI + Strict Times New Roman on Print)
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  font-family: 'Times New Roman', Times, Georgia, serif !important;
}

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  direction: ltr;
  text-align: left;
  overflow: hidden;
  overflow-x: hidden !important;
  font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* Strict Times New Roman across all printable documents and A4 sheets */
.modal-sheet-print,
.modal-sheet-print *,
.printable-quotation-paper,
.printable-quotation-paper *,
.po-a4-page,
.po-a4-page *,
#printableWorkOrderPaper,
#printableWorkOrderPaper *,
#printableQcPaper,
#printableQcPaper *,
#printableJobCardPaper,
#printableJobCardPaper *,
#printablePaymentOrderSheet,
#printablePaymentOrderSheet * {
  font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* Keep top print controls toolbar in Times New Roman */
.print-controls-bar,
.print-controls-bar * {
  font-family: 'Times New Roman', Times, Georgia, serif !important;
}

/* ==========================================================================
   APP FULL VIEWPORT LAYOUT
   ========================================================================== */
.app-layout {
  display: flex;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden !important;
  background-color: var(--bg-page);
}

/* ==========================================================================
   1. LEFT SIDEBAR NAVIGATION
   ========================================================================== */
.app-sidebar {
  width: 230px;
  min-width: 230px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  user-select: none;
  z-index: 20;
}

.sidebar-header {
  padding: 18px 18px 14px 18px;
  border-bottom: 1px solid var(--border-main);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-emblem-badge {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  border: 1px solid var(--border-main) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  flex-shrink: 0 !important;
}

.brand-logo-img {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
  display: block !important;
}

.doc-logo {
  width: 66px !important;
  height: 66px !important;
  object-fit: contain !important;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* Navigation List */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 10px 4px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.16s ease;
}

.nav-link:hover {
  background-color: #e2e8f0;
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--primary-blue);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
}

.nav-link.active .nav-icon svg {
  color: #ffffff;
  stroke: #ffffff;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-divider {
  height: 1px;
  background-color: var(--border-main);
  margin: 8px 6px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-main);
  background-color: #f8fafc;
}

.footer-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.footer-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.footer-meta {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* ==========================================================================
   2. APP MAIN & TOPBAR
   ========================================================================== */
.app-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden !important;
  background-color: var(--bg-page);
}

.app-topbar {
  height: 58px;
  min-height: 58px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  z-index: 10;
}

/* Global Search Input & Left Group */
.topbar-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 50%;
}

.btn-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border-main);
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
  background-color: #f1f5f9;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99;
}

.sidebar-backdrop.active {
  display: block;
}

.topbar-search {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  background-color: #f1f5f9;
  border: 1px solid var(--border-main);
  border-radius: 20px;
  padding: 0 16px 0 36px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Topbar Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.branch-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.branch-pill:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.branch-icon {
  color: var(--text-muted);
}

.chevron-mini {
  color: var(--text-light);
}

.btn-top-icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-top-icon:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.badge-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  border: 1.5px solid #ffffff;
}

.badge-red {
  background-color: #ef4444;
}

/* User Profile Chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.user-chip:hover {
  background-color: #f1f5f9;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ==========================================================================
   3. WORKSPACE LAYOUT (Center Main Content + Right Rail)
   ========================================================================== */
.workspace-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.workspace-content {
  flex: 1;
  padding: 20px 24px 30px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* GREETING & STATUS BANNER */
.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-copy h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.welcome-copy p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.welcome-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.chip-online {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  animation: pulseGreen 2s infinite ease-in-out;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.25); }
}

/* ==========================================================================
   4. FIVE KPI METRIC SUMMARY CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: 12px;
  padding: 14px 14px 8px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-icon-squircle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-soft-blue { background-color: #eff6ff; }
.bg-soft-purple { background-color: #f5f3ff; }
.bg-soft-orange { background-color: #fff7ed; }
.bg-soft-green { background-color: #ecfdf5; }
.bg-soft-cyan { background-color: #ecfeff; }

.kpi-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 2px 0 2px 0;
}

.kpi-delta {
  font-size: 0.72rem;
  font-weight: 700;
}

.delta-up { color: #10b981; }
.delta-down { color: #ef4444; }

.kpi-wave {
  margin-top: 4px;
  height: 26px;
  width: 100%;
}

.kpi-wave svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   5. DEPARTMENT APPLICATIONS GRID
   ========================================================================== */
.section-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
}

.btn-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.16s ease;
}

.btn-subtle:hover {
  background-color: #f1f5f9;
  color: var(--text-primary);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.app-card {
  background-color: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  text-decoration: none;
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.06);
}

.app-squircle {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.icon-purple { background: linear-gradient(135deg, #a855f7, #8b5cf6); }
.icon-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.icon-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.icon-green { background: linear-gradient(135deg, #34d399, #10b981); }
.icon-coral { background: linear-gradient(135deg, #f87171, #ef4444); }
.icon-deep-violet { background: linear-gradient(135deg, #c084fc, #9333ea); }
.icon-cobalt { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.icon-cyan-teal { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.icon-mint { background: linear-gradient(135deg, #6ee7b7, #059669); }
.icon-rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.icon-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.icon-orange-warm { background: linear-gradient(135deg, #fdba74, #ea580c); }
.icon-azure { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.icon-violet { background: linear-gradient(135deg, #f472b6, #c026d3); }
.icon-aqua-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

.app-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-meta h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.app-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.2;
}

.app-arrow {
  font-size: 1.25rem;
  color: var(--text-light);
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.app-card:hover .app-arrow {
  color: var(--primary-blue);
  transform: translateX(3px);
}

/* ==========================================================================
   6. BOTTOM SECTION: WORKSHOP LIVE STATUS & QUICK ACTIONS
   ========================================================================== */
.bottom-split-row {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 14px;
}

.panel-pipeline {
  padding: 16px 20px;
}

.live-pulse-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #059669;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Clean Professional Pipeline Nodes (No Car Pictures) */
.pipeline-flow-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 6px 4px;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.node-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}

.pipeline-node:hover .node-circle {
  transform: scale(1.1);
}

.node-num {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}

.node-blue { background-color: #2563eb; }
.node-purple { background-color: #8b5cf6; }
.node-orange { background-color: #f97316; }
.node-red { background-color: #ef4444; }
.node-green { background-color: #10b981; }
.node-teal { background-color: #0d9488; }

.node-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.node-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-blue { background-color: #eff6ff; color: #1d4ed8; }
.badge-purple { background-color: #f5f3ff; color: #7c3aed; }
.badge-orange { background-color: #fff7ed; color: #c2410c; }
.badge-red { background-color: #fef2f2; color: #b91c1c; }
.badge-green { background-color: #ecfdf5; color: #047857; }
.badge-teal { background-color: #f0fdfa; color: #0f766e; }

/* Connectors */
.pipeline-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  margin: 0 4px;
  margin-top: -30px;
}

.connector-arrow {
  font-size: 1.4rem;
  color: #cbd5e1;
  font-weight: bold;
}

/* Quick Actions 2x2 Grid */
.panel-actions {
  padding: 16px 18px;
}

.quick-btns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.btn-action {
  padding: 12px 10px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
  outline: none;
}

.btn-action:hover {
  transform: translateY(-2px);
  filter: brightness(0.97);
}

.btn-plus {
  font-size: 1.05rem;
  font-weight: 800;
}

.btn-soft-blue {
  background-color: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.btn-soft-purple {
  background-color: #ede9fe;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
}

.btn-soft-orange {
  background-color: #ffedd5;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.btn-soft-green {
  background-color: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* ==========================================================================
   7. RIGHT WORKSPACE RAIL (Action Center & Recent Activity)
   ========================================================================== */
.workspace-rail {
  width: 310px;
  min-width: 310px;
  padding: 20px 24px 30px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.rail-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: 14px;
  padding: 16px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.rail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rail-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-blue);
  text-decoration: none;
}

.rail-link:hover {
  text-decoration: underline;
}

/* Action Center Priority Tabs */
.priority-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-tab {
  flex: 1;
  padding: 5px 6px;
  border-radius: 6px;
  border: none;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  background-color: #f1f5f9;
  color: var(--text-secondary);
  transition: all 0.16s ease;
  text-align: center;
}

.filter-tab.active {
  background-color: var(--primary-blue);
  color: #ffffff;
}

.tab-high:not(.active) {
  background-color: #fee2e2;
  color: #dc2626;
}

.tab-medium:not(.active) {
  background-color: #fef3c7;
  color: #d97706;
}

.tab-low:not(.active) {
  background-color: #f1f5f9;
  color: #475569;
}

/* Action Items List */
.action-list {
  display: flex;
  flex-direction: column;
}

.action-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.action-entry:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.action-entry:hover {
  background-color: #f8fafc;
}

.tag-priority {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  text-transform: capitalize;
  min-width: 44px;
  text-align: center;
}

.tag-red {
  background-color: #fee2e2;
  color: #ef4444;
}

.tag-amber {
  background-color: #fef3c7;
  color: #f59e0b;
}

.tag-blue {
  background-color: #eff6ff;
  color: #3b82f6;
}

.action-info {
  flex: 1;
  overflow: hidden;
}

.action-heading {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.action-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

.action-time {
  font-size: 0.68rem;
  color: var(--text-light);
}

.action-arrow {
  color: var(--text-light);
  font-size: 1.15rem;
}

/* Recent Activity Timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-node {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-icon-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.bg-blue { background-color: #2563eb; }
.bg-teal { background-color: #0d9488; }
.bg-green { background-color: #10b981; }
.bg-orange { background-color: #f97316; }
.bg-cyan { background-color: #06b6d4; }

.activity-text {
  flex: 1;
}

.activity-text h5 {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.activity-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.activity-ago {
  font-size: 0.7rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* ==========================================================================
   8. INTERACTIVE MODAL DIALOG
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-sheet {
  background-color: #ffffff;
  border: 1px solid var(--border-main);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 32px 28px;
  text-align: center;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalScale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.btn-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-main);
  background-color: #f1f5f9;
  color: var(--text-secondary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background-color: #fee2e2;
  color: #ef4444;
}

.modal-badge-squircle {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.modal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.modal-content-box {
  background-color: #f8fafc;
  border: 1px solid var(--border-main);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 22px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.modal-btn-row {
  display: flex;
  gap: 10px;
}

.btn-primary-launch {
  flex: 1;
  background-color: var(--primary-blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.btn-primary-launch:hover {
  background-color: var(--primary-blue-hover);
}

.btn-secondary-cancel {
  background-color: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--border-main);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary-cancel:hover {
  background-color: #e2e8f0;
}

/* ==========================================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ========================================================================== */
@media (max-width: 1360px) {
  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .workspace-rail {
    width: 280px;
    min-width: 280px;
  }
}

@media (max-width: 1080px) {
  .workspace-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  .workspace-rail {
    width: 100%;
    padding: 0 24px 30px 24px;
  }
}

@media (max-width: 1024px) {
  .btn-sidebar-toggle {
    display: inline-flex;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: none;
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.25);
  }
  .topbar-left-group {
    max-width: 65%;
  }
}

@media (max-width: 768px) {
  .app-topbar {
    padding: 0 12px;
  }
  .topbar-left-group {
    max-width: 100%;
  }
  .topbar-search {
    max-width: 100%;
    width: 100%;
  }
  .topbar-actions .branch-pill {
    display: none;
  }
  .user-info .user-role {
    display: none;
  }
}
