:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-dark: #1e3a8a;
  --secondary: #475569;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --sidebar-width: 260px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed ~ .main-wrapper,
.main-wrapper.collapsed {
  margin-left: 70px;
  width: calc(100% - 70px);
  max-width: calc(100% - 70px);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s ease;
}

.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
  gap: 0;
}

.sidebar.collapsed .sidebar-brand {
  display: none !important;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-header .app-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sidebar-header .app-logo:hover {
  transform: scale(1.08);
}

.sidebar-header .logo-badge {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.sidebar-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f8fafc;
}

.sidebar-header .version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  margin-top: 4px;
  line-height: 1.2;
}

.sidebar-header .version-badge .version-dot {
  width: 6px;
  height: 6px;
  background-color: #3b82f6;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #3b82f6;
}

.sidebar-header p {
  font-size: 0.75rem;
  color: #94a3b8;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
}

.sidebar.collapsed .sidebar-nav {
  padding: 16px 8px;
  align-items: center;
}

.sidebar.collapsed .nav-item {
  width: 100%;
}

.sidebar.collapsed .nav-item a {
  justify-content: center;
  padding: 12px 0;
  width: 100%;
}

.sidebar.collapsed .nav-text {
  display: none !important;
}

.sidebar.collapsed .nav-icon {
  margin: 0;
  font-size: 1.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-item a:hover {
  background-color: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item a.active {
  background: linear-gradient(90deg, #1e40af, #2563eb);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.user-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .user-greeting {
  display: none !important;
}

.sidebar.collapsed .user-info-row {
  justify-content: center;
}

.sidebar.collapsed .sidebar-logout-btn {
  width: 36px;
  height: 36px;
}

.user-greeting {
  font-size: 0.8rem;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.user-name {
  color: #ffffff;
  font-weight: 600;
  max-width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: inline-block;
  text-transform: uppercase;
  flex-shrink: 0;
}

.role-badge.role-super {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1e1b4b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

.role-badge.role-admin {
  background: #2563eb;
  color: #ffffff;
}

.role-badge.role-user {
  background: #475569;
  color: #f1f5f9;
}

.sidebar-logout-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-navbar {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-navbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-body {
  padding: 10px 16px 12px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.content-body.content-purchasing,
.content-body.content-pdf_parser,
.content-body.content-warehouse,
.content-body.content-hr,
.content-body.content-sales,
.content-body.content-debts,
.content-body.content-invoices,
.content-body.content-dashboard,
.content-body.content-rep {
  padding: 10px 16px 12px 16px !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

body:has(.content-body),
.app-container:has(.content-body),
.main-wrapper:has(.content-body) {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
}

/* Grid & Cards */
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.k-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.k-card:hover {
  box-shadow: var(--shadow-md);
}

.tab-pane .k-card {
  padding: 0 !important;
}

.k-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.tab-pane .k-card > .k-card-header,
.tab-pane .k-card > .debt-card-header {
  margin-bottom: 0 !important;
  padding-bottom: 0;
}

.k-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.blue { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.green { background-color: var(--success-light); color: var(--success); }
.stat-icon.yellow { background-color: var(--warning-light); color: var(--warning); }
.stat-icon.red { background-color: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background-color: var(--info-light); color: var(--info); }

.stat-info h3 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-info .stat-number {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Buttons */
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.k-btn-primary {
  background-color: var(--primary);
  color: white;
}
.k-btn-primary:hover {
  background-color: var(--primary-hover);
}

.k-btn-success {
  background-color: var(--success);
  color: white;
}
.k-btn-success:hover {
  background-color: #15803d;
}

.k-btn-warning {
  background-color: var(--warning);
  color: white;
}
.k-btn-warning:hover {
  background-color: #b45309;
}

.k-btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.k-btn-outline:hover {
  background-color: #f1f5f9;
}

.k-btn-sm {
  padding: 4px 10px;
  font-size: 0.775rem;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.k-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.k-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.k-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.k-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.k-badge, .badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.k-badge-pending, .badge-warning { background-color: var(--warning-light); color: var(--warning); }
.k-badge-approved, .badge-success { background-color: var(--success-light); color: var(--success); }
.k-badge-rejected, .badge-danger { background-color: var(--danger-light); color: var(--danger); }
.k-badge-paid, .badge-info { background-color: var(--info-light); color: var(--info); }
.k-badge-neutral, .badge-secondary { background-color: #f1f5f9; color: #475569; }

/* Tabs (Standard Unified Option A: Underline 40px Height) */
.k-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 10px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
  user-select: none;
}

.k-tab {
  height: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.k-tab:hover {
  color: var(--primary);
  background: rgba(30, 64, 175, 0.04);
  border-radius: 6px 6px 0 0;
}

.k-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
  background: rgba(30, 64, 175, 0.05);
  border-radius: 6px 6px 0 0;
}

.k-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  line-height: 1;
}

.k-tab.active .k-tab-badge {
  background: #dbeafe;
  color: #1e40af;
}

/* Forms & Inputs */
.form-group, .k-form-group {
  margin-bottom: 14px;
}

.form-group label, .k-form-group label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control, .k-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  background-color: #fff;
  transition: border-color 0.15s;
}

.form-control:focus, .k-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-row, .k-form-grid {
  display: flex;
  gap: 12px;
}

.form-row > * {
  flex: 1;
}

/* Modal */
.k-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.k-modal-backdrop.open {
  display: flex;
}

.k-modal {
  background: #fff;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}

.k-modal-lg {
  max-width: 850px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.k-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.k-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.k-modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

.k-modal-body {
  padding: 20px;
}

.k-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* File Drop Zone */
.dropzone {
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-md);
  padding: 30px;
  text-align: center;
  background-color: #f0fdf4;
  cursor: pointer;
  transition: all 0.2s;
}

.dropzone:hover {
  background-color: #dbeafe;
  border-color: #2563eb;
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 8px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border-left: 4px solid var(--primary);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  font-size: 0.875rem;
  animation: toastIn 0.25s ease-out;
}

.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--danger); }
.toast.toast-warning { border-color: var(--warning); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========================================================
   DASHBOARD COMPACT EXECUTIVE SUITE STYLES
   ======================================================== */
.content-body.content-dashboard,
.content-body.content-rep {
  padding: 10px 16px 12px 16px !important;
  background-color: var(--bg-main, #f8fafc);
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

/* Compact Toolbar Header (Standard 40px Dòng 1) */
.dashboard-compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  padding: 0 12px;
  background: #ffffff;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 10px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.dashboard-compact-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-compact-header .header-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.dashboard-compact-header .header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.dashboard-compact-header .header-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.dashboard-compact-header .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-refresh-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-refresh-compact:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--primary);
}

.btn-refresh-compact.spinning i {
  animation: spinIcon 0.8s linear infinite;
}

@keyframes spinIcon {
  100% { transform: rotate(360deg); }
}

/* 6 Compact KPI Ribbon Cards - Chuẩn ERP Điều Hành */
.dashboard-kpi-ribbon {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1520px) {
  .dashboard-kpi-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}

@media (max-width: 860px) {
  .dashboard-kpi-ribbon {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 520px) {
  .dashboard-kpi-ribbon {
    grid-template-columns: 1fr !important;
  }
}

.kpi-compact-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 96px;
}

.kpi-compact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.kpi-compact-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  gap: 4px;
}

.kpi-compact-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-compact-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.kpi-compact-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-compact-bottom {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}

.kpi-compact-bottom > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-compact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.73rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color 0.15s;
}

.kpi-compact-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

/* 2-Column Main Workspace Grid */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Compact Panels */
.dashboard-panel {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.panel-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.panel-title-compact {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chart heights */
.chart-wrapper-compact {
  position: relative;
  height: 290px;
  width: 100%;
}

.chart-wrapper-doughnut {
  position: relative;
  height: 240px;
  width: 100%;
}

/* Attention Tabs & Items */
.attention-tabs-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
  background: #f8fafc;
  padding: 3px;
  border-radius: 6px;
}

.attention-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.attention-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.attention-badge-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-warning { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }

.attention-items-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}

.attention-item-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.attention-item-compact:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.attention-item-left strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

.attention-item-left span {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.attention-item-right {
  text-align: right;
  font-weight: 600;
  font-size: 0.82rem;
}

/* Activity Tabs & Table Compact */
.activity-tabs-compact {
  display: flex;
  gap: 4px;
}

.activity-tab-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: all 0.15s ease;
}

.activity-tab-btn:hover {
  color: var(--primary);
}

.activity-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.table-compact {
  width: 100%;
  font-size: 0.79rem;
  border-collapse: collapse;
}

.table-compact th {
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  text-align: left;
}

.table-compact td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
}

.table-compact tr:last-child td {
  border-bottom: none;
}

.table-compact tr:hover td {
  background: #f8fafc;
}

