/* ===================================================================
   UNICO Facilities Management System
   Professional UI — Pixel-perfect clone of original system
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ───────────────────────────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES
─────────────────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:        #564aa3;
  --primary-hover:  #4a3f94;
  --primary-light:  #7c72c4;
  --primary-10:     rgba(86, 74, 163, 0.10);
  --primary-20:     rgba(86, 74, 163, 0.20);

  /* Sidebar */
  --sidebar-bg:     #2c2c4e;
  --sidebar-width:  230px;
  --sidebar-text:   rgba(255,255,255,0.68);
  --sidebar-icon:   rgba(255,255,255,0.45);
  --sidebar-hover:  rgba(255,255,255,0.06);
  --sidebar-active: rgba(86,74,163,0.55);
  --sidebar-border: rgba(255,255,255,0.07);

  /* Content */
  --topbar-h:       56px;
  --page-bg:        #f0f2f7;
  --card-bg:        #ffffff;
  --border:         #e4e6ef;
  --border-light:   #eff0f6;

  /* Text */
  --text:           #1e1e2d;
  --text-muted:     #7e8299;
  --text-light:     #b5b5c3;

  /* Status */
  --success:        #50cd89;
  --success-light:  #e8fff3;
  --success-text:   #027a48;
  --danger:         #f1416c;
  --danger-light:   #fff5f8;
  --danger-text:    #c01048;
  --warning:        #ffc700;
  --warning-light:  #fff8dd;
  --warning-text:   #b54708;
  --info:           #009ef7;
  --info-light:     #f1faff;
  --info-text:      #026aa2;

  /* Spacing & Shape */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow:      0 2px 8px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.08);
}

/* ───────────────────────────────────────────────────────────────────
   2. RESET & BASE
─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 13px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ───────────────────────────────────────────────────────────────────
   4. SIDEBAR — exact match to original
─────────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 2px 0 8px rgba(0,0,0,0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* Sidebar logo/header */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-logo img {
  height: 30px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.sidebar-logo-text { line-height: 1.25; min-width: 0; }
.sidebar-logo-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0.3px;
}

/* Nav sections */
.sidebar-nav { flex: 1; padding: 8px 0; }

.sidebar-section {
  padding: 18px 18px 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  user-select: none;
}

/* Nav items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-item.active {
  background: var(--sidebar-active);
  color: #fff;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #fff;
  border-radius: 0 2px 2px 0;
}
.sidebar-item i {
  width: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--sidebar-icon);
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar-item:hover i,
.sidebar-item.active i { color: rgba(255,255,255,0.9); }

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 20px;
  min-width: 16px;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px 18px;
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
}
.sidebar-logout {
  color: rgba(255,255,255,0.3);
  font-size: 14px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger); }

/* ───────────────────────────────────────────────────────────────────
   5. TOPBAR
─────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.topbar-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--page-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.topbar-toggle:hover { background: var(--border); color: var(--text); }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.topbar-breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}
.topbar-breadcrumb span { font-size: 10px; }

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 6px; }

.topbar-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  position: relative;
  transition: all 0.15s;
}
.topbar-icon-btn:hover { background: var(--page-bg); color: var(--primary); }

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: all 0.15s;
}
.topbar-user-btn:hover { background: var(--page-bg); }
.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}
.topbar-user-info { text-align: left; }
.topbar-user-name { font-size: 12px; font-weight: 600; color: var(--text); }
.topbar-user-role { font-size: 10px; color: var(--text-muted); }

/* ───────────────────────────────────────────────────────────────────
   6. PAGE CONTENT
─────────────────────────────────────────────────────────────────── */
.page-content { padding: 20px 24px; flex: 1; }

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}
.page-header .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 3px 0 0;
}
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Breadcrumb trail */
.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb-trail a { color: var(--primary); }
.breadcrumb-trail a:hover { text-decoration: underline; }

/* ───────────────────────────────────────────────────────────────────
   7. CARDS
─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
}
.card-header h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-header h5 > i { font-size: 14px; color: var(--primary); }
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  background: #fafbfd;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ───────────────────────────────────────────────────────────────────
   8. STAT CARDS — DASHBOARD
─────────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.purple  { background: var(--primary-10); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success-text); }
.stat-icon.danger  { background: var(--danger-light); color: var(--danger-text); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning-text); }
.stat-icon.info    { background: var(--info-light); color: var(--info-text); }
.stat-icon.dark    { background: #f5f5f8; color: #3f3f5e; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* ───────────────────────────────────────────────────────────────────
   9. TABLES
─────────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--text);
}
.table thead th {
  background: #f7f8fd;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.1s; }
.table-hover tbody tr:hover { background: #f8f9ff; }
.table tfoot td {
  padding: 10px 14px;
  background: #f7f8fd;
  font-weight: 700;
  border-top: 2px solid var(--border);
}

/* DataTables override */
.dataTables_wrapper { padding: 0; }
.dataTables_wrapper .dataTables_filter {
  padding: 12px 18px;
  float: right;
}
.dataTables_wrapper .dataTables_length {
  padding: 12px 18px;
  float: left;
}
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label { font-size: 12px; color: var(--text-muted); }
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  background: #fff;
  color: var(--text);
  outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--primary) !important; }
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  background: #fff;
}
.dataTables_wrapper .dataTables_info {
  padding: 12px 18px;
  font-size: 11px;
  color: var(--text-muted);
  float: left;
  clear: both;
}
.dataTables_wrapper .dataTables_paginate {
  padding: 12px 18px;
  float: right;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-size: 11px !important;
  padding: 3px 8px !important;
  border-radius: 5px !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  margin: 0 2px;
  cursor: pointer;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--page-bg) !important;
  color: var(--text) !important;
}
.dataTables_wrapper::after { content: ''; display: table; clear: both; }

/* ───────────────────────────────────────────────────────────────────
   10. TABLE ACTIONS
─────────────────────────────────────────────────────────────────── */
.table-actions { display: flex; align-items: center; gap: 4px; }

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  transition: all 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}
.btn-icon-primary { background: var(--primary-10); color: var(--primary); }
.btn-icon-primary:hover { background: var(--primary); color: #fff; }
.btn-icon-info { background: var(--info-light); color: var(--info-text); }
.btn-icon-info:hover { background: var(--info); color: #fff; }
.btn-icon-success { background: var(--success-light); color: var(--success-text); }
.btn-icon-success:hover { background: var(--success); color: #fff; }
.btn-icon-warning { background: var(--warning-light); color: var(--warning-text); }
.btn-icon-warning:hover { background: var(--warning); color: #000; }
.btn-icon-danger { background: var(--danger-light); color: var(--danger-text); }
.btn-icon-danger:hover { background: var(--danger); color: #fff; }

/* ───────────────────────────────────────────────────────────────────
   11. BADGES & STATUS
─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-active, .badge-success { background: var(--success-light); color: var(--success-text); }
.badge-inactive, .badge-secondary { background: #f5f5f8; color: #7e8299; }
.badge-danger, .badge-expired { background: var(--danger-light); color: var(--danger-text); }
.badge-warning, .badge-pending { background: var(--warning-light); color: var(--warning-text); }
.badge-info { background: var(--info-light); color: var(--info-text); }
.badge-primary { background: var(--primary-10); color: var(--primary); }
.badge-dark { background: #f0f0fa; color: var(--text); }

/* Bootstrap badge compatibility */
.bg-success { background: var(--success-light) !important; color: var(--success-text) !important; }
.bg-danger  { background: var(--danger-light) !important; color: var(--danger-text) !important; }
.bg-warning { background: var(--warning-light) !important; color: var(--warning-text) !important; }
.bg-info    { background: var(--info-light) !important; color: var(--info-text) !important; }
.bg-primary { background: var(--primary-10) !important; color: var(--primary) !important; }
.bg-secondary { background: #f5f5f8 !important; color: #7e8299 !important; }
.bg-dark    { background: #f0f0fa !important; color: var(--text) !important; }

/* SIA Expiry helpers */
.sia-expired  { background: var(--danger-light); color: var(--danger-text); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.sia-expiring { background: var(--warning-light); color: var(--warning-text); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.sia-valid    { background: var(--success-light); color: var(--success-text); padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* ───────────────────────────────────────────────────────────────────
   12. BUTTONS
─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-sm { padding: 5px 12px; font-size: 11.5px; border-radius: 6px; }
.btn-lg { padding: 10px 22px; font-size: 14px; border-radius: 8px; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(0.92); color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); color: #fff; }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #000; }
.btn-warning:hover { filter: brightness(0.92); }

.btn-secondary { background: #f5f5f8; border-color: var(--border); color: var(--text-muted); }
.btn-secondary:hover { background: var(--border); color: var(--text); }

.btn-outline-primary { background: none; border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary { background: none; border-color: var(--border); color: var(--text-muted); }
.btn-outline-secondary:hover { background: var(--page-bg); color: var(--text); }
.btn-outline-success { background: none; border-color: var(--success); color: var(--success-text); }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-danger { background: none; border-color: var(--danger); color: var(--danger-text); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

/* ───────────────────────────────────────────────────────────────────
   13. FORMS
─────────────────────────────────────────────────────────────────── */
.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: block;
  text-transform: none;
  letter-spacing: 0;
}
.required-star { color: var(--danger); font-size: 12px; }

.form-control, .form-select {
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(86,74,163,0.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control-sm, .form-select-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input {
  width: 15px;
  height: 15px;
  border: 2px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.form-check-label { font-size: 12.5px; color: var(--text); cursor: pointer; }

/* ───────────────────────────────────────────────────────────────────
   14. FILTER BAR
─────────────────────────────────────────────────────────────────── */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-bar label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* ───────────────────────────────────────────────────────────────────
   15. TABS
─────────────────────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: 18px;
  overflow-x: auto;
}
.nav-tabs .nav-item { list-style: none; }
.nav-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  background: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-tabs .nav-link:hover { color: var(--primary); }
.nav-tabs .nav-link.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom-color: var(--primary);
}

/* ───────────────────────────────────────────────────────────────────
   16. MODALS
─────────────────────────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--radius-lg) !important;
  border: none !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18) !important;
}
.modal-header {
  background: var(--primary);
  padding: 14px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  border: none !important;
}
.modal-header .modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header .btn-close { filter: brightness(0) invert(1); opacity: 0.7; }
.modal-header .btn-close:hover { opacity: 1; }
.modal-body { padding: 20px; }
.modal-footer {
  background: #fafbfd;
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  padding: 12px 20px;
}

/* ───────────────────────────────────────────────────────────────────
   17. ROSTER SHIFTS — Most critical part
─────────────────────────────────────────────────────────────────── */
.roster-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 11.5px; }
.roster-table th {
  background: #f7f8fd;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.roster-table th:first-child { text-align: left; }
.roster-table td {
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 4px 5px;
  vertical-align: top;
  min-width: 90px;
}
.roster-table td:first-child {
  min-width: 160px;
  background: #fafbfd;
  padding: 8px 12px;
}
.roster-table tr:hover td { background: #f9f9ff; }
.roster-table tr:hover td:first-child { background: #f0f1fb; }

/* Shift cells */
.shift-pill {
  display: block;
  padding: 4px 7px;
  border-radius: 5px;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: filter 0.15s;
  word-break: break-word;
}
.shift-pill:hover { filter: brightness(0.93); }
.shift-pill:last-child { margin-bottom: 0; }

.shift-confirmed   { background: #e8fff3; border-left-color: #17c964; color: #027a48; }
.shift-booked-on   { background: #eff8ff; border-left-color: #009ef7; color: #026aa2; }
.shift-unconfirmed { background: #fff8dd; border-left-color: #ffc700; color: #b54708; }
.shift-vacant      { background: #fff5f8; border-left-color: #f1416c; color: #c01048; }
.shift-unpaid      { background: #f5f5f8; border-left-color: #b5b5c3; color: #4a4a6a; }

.shift-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  border: 1.5px dashed var(--border);
  border-radius: 5px;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  background: none;
  transition: all 0.15s;
  line-height: 1;
}
.shift-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-10);
}

/* ───────────────────────────────────────────────────────────────────
   18. ALERTS
─────────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid;
  margin-bottom: 16px;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: var(--success-light); border-color: #abefc6; color: var(--success-text); }
.alert-danger,
.alert-error   { background: var(--danger-light); border-color: #fecdca; color: var(--danger-text); }
.alert-warning { background: var(--warning-light); border-color: #fedf89; color: var(--warning-text); }
.alert-info    { background: var(--info-light); border-color: #b9e6fe; color: var(--info-text); }

/* ───────────────────────────────────────────────────────────────────
   19. AUTH LAYOUT
─────────────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: #eef0f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0,0,0,0.10);
}
.auth-header {
  background: var(--primary);
  padding: 24px 30px;
  text-align: center;
}
.auth-header img { max-height: 46px; max-width: 180px; object-fit: contain; }
.auth-logo-text {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 4px;
}
.auth-body { padding: 28px 30px; }
.auth-subtitle {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.auth-field { margin-bottom: 14px; }
.auth-field .input-group-text {
  background: #f7f8fd;
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 0 12px;
  border-radius: 7px 0 0 7px;
}
.auth-field .form-control {
  border-radius: 0 7px 7px 0;
  border-left: none;
}
.auth-field .form-control:focus { box-shadow: none; }
.auth-field .input-group:focus-within .input-group-text,
.auth-field .input-group:focus-within .form-control  {
  border-color: var(--primary);
}
.btn-auth {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 6px;
}
.btn-auth:hover { background: var(--primary-hover); }
.auth-footer {
  background: #f7f8fd;
  padding: 12px 30px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}
.auth-page-footer {
  margin-top: 20px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ───────────────────────────────────────────────────────────────────
   20. MISC UTILITIES
─────────────────────────────────────────────────────────────────── */
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fs-11  { font-size: 11px !important; }
.fs-12  { font-size: 12px !important; }
.fs-13  { font-size: 13px !important; }
.text-primary-color { color: var(--primary) !important; }
.text-muted-color   { color: var(--text-muted) !important; }

.divider { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }

/* Spinner */
.spinner-wrapper { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner-border  { width: 28px; height: 28px; border-width: 3px; border-color: var(--primary); border-right-color: transparent; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 44px; opacity: 0.2; display: block; margin-bottom: 16px; }
.empty-state h5 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.empty-state p  { font-size: 12.5px; }

/* Toast */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}
.toast-item.success { background: var(--success); color: var(--success-text); }
.toast-item.error   { background: var(--danger); color: var(--danger-text); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ───────────────────────────────────────────────────────────────────
   21. INVOICE
─────────────────────────────────────────────────────────────────── */
.invoice-doc { max-width: 820px; margin: 0 auto; }
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; }
.invoice-title { font-size: 38px; font-weight: 800; color: var(--primary); letter-spacing: 4px; }

/* ───────────────────────────────────────────────────────────────────
   22. PRINT
─────────────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .page-header .btn, .filter-bar,
  .table-actions, .no-print, footer { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .page-content { padding: 0 !important; }
}

/* ───────────────────────────────────────────────────────────────────
   23. RESPONSIVE
─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 14px 16px; }
}
