/* ================================================
   PEGADAIAN PRO — Modern UI with Sidebar Layout
   Font: Inter | Layout: Sidebar + Topbar
   ================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 60px;
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: rgba(102,126,234,0.2);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #fff;
  --bg: #f1f5f9;
  --card-bg: #fff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ================================================
   APP LAYOUT — Sidebar + Main
   ================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-title {
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 8px;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar-link.active i {
  color: var(--primary);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 8px 14px;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-collapse-btn {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 14px;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

/* Sidebar Collapsed State */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-collapsed .sidebar-title,
.sidebar-collapsed .sidebar-link span {
  opacity: 0;
  width: 0;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 10px;
}

.sidebar-collapsed .sidebar-link i {
  font-size: 18px;
}

.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .sidebar-collapse-btn i {
  transform: rotate(180deg);
}

.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}

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

/* ================================================
   TOPBAR
   ================================================ */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.topbar-toggle:hover {
  background: var(--bg);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-sep {
  color: var(--border);
  font-size: 12px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

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

.topbar-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.topbar-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.topbar-tenant {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-tenant-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

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

.topbar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.topbar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-logout {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 16px;
}

.topbar-logout:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
}

.main-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Legacy container support */
.container {
  max-width: 1400px;
  width: 100%;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* ================================================
   TILES (Dashboard menu)
   ================================================ */
.tile {
  border-radius: var(--radius);
  padding: 22px;
  color: #fff;
  box-shadow: var(--shadow-md);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 90px;
  height: 90px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.tile h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.tile p { margin: 0; opacity: 0.95; font-size: 28px; font-weight: 700; }
.tile small { opacity: 0.85; font-size: 12px; }

/* Tile Colors */
.t-green { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.t-blue { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.t-orange { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.t-magenta { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #333; }
.t-red { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.t-purple { background: var(--primary-gradient); }
.t-teal { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%); }
.t-cyan { background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%); }

/* ================================================
   CARDS
   ================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
}

.card h3 {
  margin: 16px 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn:active { transform: translateY(0); }

.btn.secondary {
  background: var(--text-muted);
  box-shadow: 0 1px 3px rgba(100,116,139,0.3);
}
.btn.secondary:hover { box-shadow: 0 4px 12px rgba(100,116,139,0.4); }

.btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 1px 3px rgba(239,68,68,0.3);
}
.btn.danger:hover { box-shadow: 0 4px 12px rgba(239,68,68,0.4); }

.btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 1px 3px rgba(16,185,129,0.3);
}
.btn.success:hover { box-shadow: 0 4px 12px rgba(16,185,129,0.4); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ================================================
   TABLES
   ================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
}

.table th {
  background: var(--sidebar-bg);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child { border-radius: 0 8px 0 0; }

.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:nth-child(even) { background: #fafbfc; }
.table tbody tr:nth-child(even):hover { background: #f1f5f9; }

/* ================================================
   FORMS
   ================================================ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.input,
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: #fff;
  color: var(--text);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.input::placeholder { color: #94a3b8; }

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

/* ================================================
   NOTICES / ALERTS
   ================================================ */
.notice {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice.error   { background: #fef2f2; border-left: 4px solid #ef4444; color: #991b1b; }
.notice.success { background: #f0fdf4; border-left: 4px solid #22c55e; color: #166534; }
.notice.warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }
.notice.info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e40af; }
.notice:not(.error):not(.success):not(.warning):not(.info) {
  background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f;
}

.success-message {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  animation: slideDown 0.3s ease;
}

/* ================================================
   LOGIN CARD (standalone page, no sidebar)
   ================================================ */
.login-card {
  width: 420px;
  max-width: 90%;
  margin: 80px auto;
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.login-card h2 { text-align: center; color: var(--text); margin-bottom: 8px; font-size: 26px; }
.login-card p { text-align: center; color: var(--text-muted); margin-bottom: 24px; }

.login-card .tenant-info {
  background: #f0fdf4;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--success);
}
.login-card .tenant-info small { color: #166534; line-height: 1.6; }

.login-card form { margin-top: 20px; }
.login-card .form-group:last-of-type { margin-bottom: 24px; }
.login-card .btn { width: 100%; padding: 14px; font-size: 15px; justify-content: center; }
.login-card .link-wrapper { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Links */
a.link { color: var(--primary); text-decoration: none; font-weight: 600; transition: color 0.2s; }
a.link:hover { color: var(--primary-dark); text-decoration: underline; }

/* ================================================
   BACK BAR / PRINT BAR
   ================================================ */
.backbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.printbar {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* Legacy footer */
.footer {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  margin: 32px 0 16px;
}

/* Info Box */
.info-box {
  background: #f0fdf4;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid var(--success);
  color: #166534;
}

/* ================================================
   STATS GRID
   ================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}

.stat-card h4 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-card p {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
}

/* ================================================
   BADGES
   ================================================ */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge.success,
.badge-success { background: #d1fae5; color: #065f46; }
.badge.warning,
.badge-warning { background: #fef3c7; color: #92400e; }
.badge.danger,
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge.info,
.badge-info    { background: #dbeafe; color: #1e40af; }

/* Utility */
.mobile-stack { display: flex; flex-direction: column; gap: 8px; }
.mobile-full-width { width: 100%; }

/* Prevent overflow */
* { word-wrap: break-word; overflow-wrap: break-word; }

/* Table Wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ================================================
   LOADING SPINNER
   ================================================ */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   MODAL / POPUP
   ================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body { margin-bottom: 20px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Button group */
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-group .btn { font-size: 12px; padding: 6px 12px; }

/* ================================================
   RESPONSIVE — Tablet (<=1024px)
   ================================================ */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .topbar-toggle {
    display: block;
  }
  .topbar-tenant {
    display: none;
  }
}

/* ================================================
   RESPONSIVE — Mobile (<=768px)
   ================================================ */
@media (max-width: 768px) {
  body { overflow-x: hidden; }

  .main-content { padding: 16px; }
  
  .topbar { padding: 0 16px; }
  
  .topbar-user-info { display: none; }

  .form-grid { grid-template-columns: 1fr; }

  .card { padding: 16px; margin-bottom: 16px; }
  .card h2 { font-size: 18px; }
  .card h3 { font-size: 15px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .tile { padding: 16px; min-height: 100px; }
  .tile h3 { font-size: 14px; }
  .tile p { font-size: 22px; }

  .table { font-size: 13px; }
  .table th, .table td { padding: 8px 6px; white-space: nowrap; font-size: 12px; }
  .table th { font-size: 10px; position: sticky; top: 0; z-index: 10; }

  .btn { padding: 8px 16px; font-size: 13px; }

  .backbar .btn { font-size: 12px; padding: 8px 12px; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 16px; }
  .stat-card p { font-size: 22px; }

  .notice { font-size: 12px; padding: 10px 12px; }

  .input, select, textarea { font-size: 14px; padding: 10px 12px; }
  .form-group label { font-size: 12px; }

  .table td .btn { font-size: 11px; padding: 5px 8px; }

  .modal { padding: 10px; }
  .modal-content { padding: 20px; max-height: 85vh; }
  .modal-header h2 { font-size: 18px; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  h2[style*="color:#fff"],
  h2[style*="color: #fff"] { font-size: 18px !important; }
}

/* ================================================
   RESPONSIVE — Small Mobile (<=480px)
   ================================================ */
@media (max-width: 480px) {
  .main-content { padding: 12px; }
  .card { padding: 14px; border-radius: 10px; }
  .card h2 { font-size: 16px; }

  .grid { grid-template-columns: 1fr; }

  .table { font-size: 11px; }
  .table th, .table td { padding: 6px 4px; font-size: 10px; }
  .table th { font-size: 9px; }

  .btn { padding: 8px 12px; font-size: 12px; white-space: normal; text-align: center; }
  .table td .btn { font-size: 10px; padding: 4px 8px; }

  .tile { padding: 14px; }
  .tile h3 { font-size: 13px; }
  .tile p { font-size: 20px; }

  .input, select, textarea { font-size: 13px; padding: 8px 10px; }
  .form-group label { font-size: 12px; }
  .form-grid { grid-template-columns: 1fr !important; gap: 12px; }

  .stats-grid { grid-template-columns: 1fr; }
  .stat-card p { font-size: 20px; }

  .login-card { margin: 30px auto; padding: 24px; }

  .modal-content { padding: 16px; }
  .modal-header h2 { font-size: 16px; }

  .form-group[style*="grid-column"] { grid-column: 1 / -1 !important; }
}

/* ================================================
   PAGE HEADER — Consistent page titles
   ================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-info h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header-info h1 i {
  color: var(--primary);
  font-size: 20px;
}

.page-header-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================================================
   ICON BUTTONS — Small action buttons for tables
   ================================================ */
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg);
}

.btn-icon:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}

.btn-icon.edit:hover { background: var(--info); }
.btn-icon.delete:hover { background: var(--danger); }
.btn-icon.print:hover { background: var(--success); }
.btn-icon.view:hover { background: var(--primary); }

/* ================================================
   SEARCH BOX — Filter tables
   ================================================ */
.search-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* ================================================
   EMPTY STATE — When no data
   ================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.empty-state p {
  font-size: 14px;
  margin: 0 0 20px;
}

/* ================================================
   QUICK ACTION CARDS — Dashboard shortcuts
   ================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.quick-action:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.quick-action-text {
  flex: 1;
  min-width: 0;
}

.quick-action-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.quick-action-text span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================================
   WELCOME BANNER — Dashboard greeting
   ================================================ */
.welcome-banner {
  background: var(--primary-gradient);
  border-radius: var(--radius);
  padding: 24px 28px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.welcome-banner h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  border: none;
  padding: 0;
  color: #fff;
}

.welcome-banner p {
  margin: 0;
  opacity: 0.9;
  font-size: 14px;
}

.welcome-banner .meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.welcome-banner .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.9;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 6px;
}

/* ================================================
   DATA COUNT — Inline count badge
   ================================================ */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  margin-left: 6px;
}

/* ================================================
   TABLE TOOLBAR — Search + actions above table
   ================================================ */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================================================
   NOTIFICATION CARDS — Dashboard alerts
   ================================================ */
.notif-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  margin-bottom: 16px;
  overflow: hidden;
}

.notif-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
}

.notif-card-header.danger {
  background: #fef2f2;
  color: #991b1b;
  border-bottom: 2px solid #fecaca;
}

.notif-card-header.warning {
  background: #fffbeb;
  color: #92400e;
  border-bottom: 2px solid #fde68a;
}

.notif-card-header .notif-count {
  margin-left: auto;
  background: currentColor;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.notif-card-header.danger .notif-count { background: #ef4444; }
.notif-card-header.warning .notif-count { background: #f59e0b; }

.notif-card-body {
  padding: 0;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background 0.15s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }

.notif-item-info {
  flex: 1;
  min-width: 0;
}

.notif-item-info strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

.notif-item-info span {
  color: var(--text-muted);
  font-size: 12px;
}

/* ================================================
   TOOLTIP
   ================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  animation: fadeIn 0.15s ease;
}

/* ================================================
   RESPONSIVE — New components
   ================================================ */
@media (max-width: 768px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; font-size: 12px; }
  .page-header-info h1 { font-size: 18px; }
  
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-action { padding: 12px; gap: 10px; }
  .quick-action-icon { width: 36px; height: 36px; font-size: 15px; }
  .quick-action-text strong { font-size: 13px; }
  
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
  
  .welcome-banner { padding: 18px 20px; }
  .welcome-banner h2 { font-size: 17px; }
  .welcome-banner .meta { gap: 8px; }
  .welcome-banner .meta-item { font-size: 12px; padding: 3px 8px; }
  
  .btn-icon { width: 30px; height: 30px; font-size: 13px; }
  
  .notif-item { padding: 10px 14px; }
}

@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr; }
  .page-header-actions { flex-direction: column; }
  .page-header-actions .btn { width: 100%; }
}

/* ================================================
   DARK MODE
   ================================================ */
[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4), 0 4px 6px rgba(0,0,0,0.2);
}

[data-theme="dark"] .topbar { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .table tbody tr:hover { background: #334155; }
[data-theme="dark"] .table tbody tr:nth-child(even) { background: rgba(51,65,85,0.3); }
[data-theme="dark"] .table tbody tr:nth-child(even):hover { background: #334155; }
[data-theme="dark"] .input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: #0f172a; border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102,126,234,0.2); }
[data-theme="dark"] .input::placeholder { color: #64748b; }
[data-theme="dark"] .modal-content { background: #1e293b; }
[data-theme="dark"] .notice.error { background: rgba(239,68,68,0.15); color: #fca5a5; }
[data-theme="dark"] .notice.success { background: rgba(34,197,94,0.15); color: #86efac; }
[data-theme="dark"] .notice.warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
[data-theme="dark"] .notice.info { background: rgba(59,130,246,0.15); color: #93c5fd; }
[data-theme="dark"] .btn-icon { background: #334155; color: #94a3b8; }
[data-theme="dark"] .notif-card { border-color: #334155; background: #1e293b; }
[data-theme="dark"] .notif-card-header.danger { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.2); }
[data-theme="dark"] .notif-card-header.warning { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.2); }
[data-theme="dark"] .notif-item { border-color: #334155; }
[data-theme="dark"] .notif-item:hover { background: #334155; }
[data-theme="dark"] .search-box input { background: #0f172a; border-color: #475569; color: #e2e8f0; }
[data-theme="dark"] .chart-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .confirm-box { background: #1e293b; }
[data-theme="dark"] .toast { background: #1e293b; }
[data-theme="dark"] .global-search-box { background: #1e293b; }
[data-theme="dark"] .global-search-input { color: #e2e8f0; }
[data-theme="dark"] .search-result-item:hover { background: #334155; }
[data-theme="dark"] .search-result-icon { background: #334155; }
[data-theme="dark"] .login-card { background: #1e293b; }
[data-theme="dark"] .login-card h2,
[data-theme="dark"] .login-card p { color: #e2e8f0; }

.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ================================================
   GUEST LAYOUT (Login pages, no sidebar)
   ================================================ */
.guest-layout {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
  border-left: 4px solid var(--primary);
  pointer-events: auto;
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  transition: all 0.3s ease;
  min-width: 300px;
  position: relative;
  overflow: hidden;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.toast-close:hover { opacity: 1; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 0 12px;
  animation: toastProgress linear forwards;
}

.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: var(--success); }
.toast.success .toast-progress { background: var(--success); }

.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { background: var(--danger); }
.toast.error .toast-progress { background: var(--danger); }

.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.warning .toast-progress { background: var(--warning); }

.toast.info { border-left-color: var(--info); }
.toast.info .toast-icon { background: var(--info); }
.toast.info .toast-progress { background: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: 0; }
  to { opacity: 0; transform: translateX(100px); max-height: 0; margin-bottom: -10px; padding: 0; }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ================================================
   GLOBAL SEARCH (Ctrl+K)
   ================================================ */
.global-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99998;
  animation: fadeIn 0.15s ease;
}

.global-search-overlay.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.global-search-box {
  background: var(--card-bg);
  border-radius: 16px;
  width: 560px;
  max-width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.2s ease;
  overflow: hidden;
}

.global-search-input-wrap {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.global-search-input-wrap i {
  color: var(--primary);
  font-size: 18px;
  flex-shrink: 0;
}

.global-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  background: none;
  color: var(--text);
}

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

.global-search-kbd {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 600;
  border: 1px solid var(--border);
}

.global-search-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.global-search-results::-webkit-scrollbar { width: 4px; }
.global-search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.search-result-group {
  padding: 4px 12px 8px;
}

.search-result-group-title {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 8px 0 4px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
}

.search-result-item:hover,
.search-result-item.active {
  background: var(--bg);
}

.search-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--primary);
}

.search-result-text {
  flex: 1;
  min-width: 0;
}

.search-result-text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.search-result-text span {
  font-size: 12px;
  color: var(--text-muted);
}

.search-result-item:hover .search-result-icon {
  background: var(--primary);
  color: #fff;
}

.global-search-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.global-search-empty i {
  font-size: 32px;
  color: var(--border);
  margin-bottom: 8px;
  display: block;
}

.global-search-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.global-search-footer kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: inherit;
  font-weight: 600;
}

/* ================================================
   CONFIRM DIALOG (replaces browser confirm)
   ================================================ */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.confirm-overlay.active { display: flex; }

.confirm-box {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
  text-align: center;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.confirm-icon.danger { background: #fee2e2; color: var(--danger); }
.confirm-icon.warning { background: #fef3c7; color: var(--warning); }

.confirm-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}

.confirm-box p {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions .btn { min-width: 100px; justify-content: center; }

/* ================================================
   CHART CONTAINERS
   ================================================ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.chart-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card h3 i { color: var(--primary); }

.chart-wrapper {
  position: relative;
  width: 100%;
}

@media (max-width: 768px) {
  .chart-grid { grid-template-columns: 1fr; }
  .toast-container { top: 10px; right: 10px; left: 10px; max-width: 100%; }
  .toast { min-width: auto; }
  .global-search-overlay { padding-top: 8vh; }
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
  /* Hide ALL app chrome */
  .no-print, .sidebar, .topbar, .main-footer, .backbar, .printbar,
  .sidebar-overlay, .toast-container, .confirm-overlay,
  .global-search-overlay, .theme-toggle, .page-header-actions,
  .sidebar-collapse-btn, .topbar-toggle, .quick-actions,
  .btn-icon[data-tooltip], .pagination, .filter-bar,
  .report-tabs, .search-box, .welcome-banner { display: none !important; }

  /* Reset layout completely */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  /* Override dark mode for print */
  html[data-theme="dark"], html[data-theme="dark"] body {
    background: #fff !important;
    color: #000 !important;
  }
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .stat-card,
  html[data-theme="dark"] .table,
  html[data-theme="dark"] .main-content {
    background: #fff !important;
    color: #000 !important;
    border-color: #ccc !important;
  }

  .app-layout { display: block !important; }
  .main-wrapper { margin-left: 0 !important; width: 100% !important; }
  .main-content { padding: 10px 0 !important; max-width: 100% !important; }

  /* Cards */
  .card {
    box-shadow: none !important;
    border: none !important;
    background: #fff !important;
    padding: 0 !important;
    page-break-inside: avoid;
  }

  /* Stat cards - reset dark gradients */
  .stat-card, .stat-grid .stat-card, .chart-card, .notif-card {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .stat-card .value { color: #000 !important; }
  .stat-card .label { color: #333 !important; }
  .stat-card h4 { color: #000 !important; }
  .stat-card p { color: #000 !important; }

  /* Tables */
  .table-wrapper { overflow: visible !important; }
  .table { width: 100% !important; border-collapse: collapse !important; }
  .table th {
    background: #e5e7eb !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .table td {
    border: 1px solid #ccc !important;
    padding: 5px 8px !important;
    font-size: 10px !important;
    color: #000 !important;
  }

  /* Badges */
  .badge { border: 1px solid #999 !important; }
  .badge-success { background: #dcfce7 !important; color: #166534 !important; }
  .badge-warning { background: #fef3c7 !important; color: #92400e !important; }
  .badge-danger { background: #fee2e2 !important; color: #991b1b !important; }

  /* Charts - hide canvas as they don't print well */
  .chart-card canvas, .chart-wrapper canvas { display: none !important; }
  .chart-card { page-break-inside: avoid; }

  /* Page headers - show title only */
  .page-header { border: none !important; padding: 0 !important; margin-bottom: 10px !important; }
  .page-header h1 { font-size: 16px !important; color: #000 !important; }
  .page-header p { color: #333 !important; }

  /* Print-only elements */
  .print-only { display: block !important; }

  /* Page breaks */
  h2, h3 { page-break-after: avoid; }
  tr { page-break-inside: avoid; }

  /* Links - show as text */
  a { color: #000 !important; text-decoration: none !important; }
  .btn { display: none !important; }

  /* Notices */
  .notice { display: none !important; }
}
