/* ===== LAYERFIVE CALIBRATION SYSTEM — MAIN STYLES ===== */
:root {
  --dark-navy: #0d1b3e;
  --navy: #1a2744;
  --navy-light: #1e3a6e;
  --blue: #1e40af;
  --blue-light: #3b82f6;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-light: #fed7aa;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --sidebar-width: 260px;
  --header-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-light); }

/* ===== AUTH PAGES (Login, Signup, Forgot Password) ===== */
.auth-page {
  min-height: 100vh;
  background: var(--dark-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, #1e3a6e 0%, #0d1b3e 70%);
  z-index: 0;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  z-index: 0;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo .logo-graphic {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
}

.auth-logo h1 {
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.auth-logo .logo-sub {
  color: var(--orange);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.auth-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 36px;
}

.auth-card h2 {
  color: var(--white);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.auth-card .auth-subtitle {
  color: var(--gray-400);
  font-size: 13px;
  margin-bottom: 28px;
}

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

.form-group label {
  display: block;
  color: var(--gray-300);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: var(--white);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--orange);
  background: rgba(255,255,255,0.12);
}

.form-control::placeholder { color: rgba(255,255,255,0.35); }

.form-control option { background: var(--navy); color: var(--white); }

.input-group { position: relative; }

.input-group .form-control { padding-right: 44px; }

.input-group .input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 16px;
  user-select: none;
}

.input-group .input-icon:hover { color: var(--orange); }

.remember-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-300);
  font-size: 13px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
  cursor: pointer;
}

.auth-link { color: var(--orange); font-size: 13px; }
.auth-link:hover { color: var(--orange-dark); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; line-height: 1; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--blue-light); color: var(--white); }

.btn-orange { background: var(--orange); color: var(--white); }
.btn-orange:hover:not(:disabled) { background: var(--orange-dark); color: var(--white); }

.btn-outline { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover:not(:disabled) { background: var(--gray-100); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; color: var(--white); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover:not(:disabled) { background: #15803d; color: var(--white); }

.btn-dark { background: var(--dark-navy); color: var(--white); }
.btn-dark:hover:not(:disabled) { background: var(--navy); color: var(--white); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 16px; width: 100%; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

.auth-footer { text-align: center; margin-top: 20px; color: var(--gray-400); font-size: 13px; }
.auth-footer a { color: var(--orange); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error { background: rgba(220,38,38,0.15); border: 1px solid rgba(220,38,38,0.3); color: #fca5a5; }
.alert-success { background: rgba(22,163,74,0.15); border: 1px solid rgba(22,163,74,0.3); color: #86efac; }
.alert-warning { background: rgba(217,119,6,0.15); border: 1px solid rgba(217,119,6,0.3); color: #fcd34d; }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ===== APP LAYOUT (after login) ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--dark-navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
}

.sidebar-logo .logo-text small {
  color: var(--orange);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav { padding: 16px 0; flex: 1; }

.nav-section-label {
  padding: 8px 24px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.07); }
.nav-item.active { color: var(--white); background: rgba(249,115,22,0.15); }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); border-radius: 0 3px 3px 0; }

.nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.nav-item .nav-badge { margin-left: auto; background: var(--orange); color: var(--white); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }

.sidebar-user {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .user-avatar {
  width: 36px;
  height: 36px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-role { font-size: 11px; color: var(--orange); text-transform: capitalize; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.app-header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title { font-size: 18px; font-weight: 600; color: var(--gray-800); flex: 1; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--gray-500);
  font-size: 20px;
  transition: all 0.2s;
}
.notif-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.notif-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  min-width: 16px;
  text-align: center;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  color: var(--gray-600);
  padding: 4px;
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 28px; flex: 1; }

.page-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.page-header p { color: var(--gray-500); font-size: 13px; margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-size: 15px; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--gray-200); background: var(--gray-50); }

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

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; color: var(--blue); }
.stat-icon.orange { background: #ffedd5; color: var(--orange); }
.stat-icon.green { background: #dcfce7; color: var(--success); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }

.stat-info .stat-value { font-size: 26px; font-weight: 700; color: var(--gray-800); line-height: 1; }
.stat-info .stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

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

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--gray-50);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  font-size: 13px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-active { background: var(--success-light); color: #15803d; }
.badge-pending { background: var(--warning-light); color: #92400e; }
.badge-suspended { background: var(--danger-light); color: #991b1b; }
.badge-admin { background: #ede9fe; color: #5b21b6; }
.badge-staff { background: #dbeafe; color: #1d4ed8; }
.badge-expiring { background: #ffedd5; color: #c2410c; }

/* ===== SEARCH & FILTER BAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-box input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--blue-light); }
.search-box .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.select-filter {
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  outline: none;
  cursor: pointer;
}

/* ===== FORM STYLES (Dashboard Forms) ===== */
.app-form .form-group { margin-bottom: 18px; }
.app-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.app-form .form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.app-form .form-control:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.app-form .form-control[readonly] { background: var(--gray-50); color: var(--gray-500); }
.app-form .form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.app-form .form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.app-form .form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.section-divider {
  border: none;
  border-top: 2px solid var(--gray-200);
  margin: 24px 0 20px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--dark-navy);
  display: inline-block;
}

/* Reference Equipment Table */
.ref-table-wrapper { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: 8px; }
.ref-table { width: 100%; border-collapse: collapse; }
.ref-table th {
  background: var(--dark-navy);
  color: var(--white);
  padding: 10px 10px;
  font-size: 12px;
  text-align: left;
  font-weight: 600;
}
.ref-table td { padding: 6px 8px; border-bottom: 1px solid var(--gray-100); }
.ref-table tr:last-child td { border-bottom: none; }
.ref-table input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-700);
  outline: none;
}
.ref-table input:focus { border-color: var(--blue-light); }

/* ===== NOTIFICATIONS PANEL ===== */
.notif-dropdown {
  position: absolute;
  top: calc(var(--header-height));
  right: 0;
  width: 360px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  z-index: 200;
  overflow: hidden;
}

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-header h3 { font-size: 14px; font-weight: 600; color: var(--gray-800); }

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #fefce8; border-left: 3px solid var(--orange); }
.notif-item .notif-msg { font-size: 13px; color: var(--gray-700); }
.notif-item .notif-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

.notif-empty { padding: 40px 20px; text-align: center; color: var(--gray-400); font-size: 13px; }

/* ===== EXPIRY ALERT BANNER ===== */
.expiry-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.expiry-banner .banner-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.expiry-banner .banner-title { font-size: 14px; font-weight: 600; color: #92400e; margin-bottom: 8px; }
.expiry-banner .expiry-list { list-style: none; }
.expiry-banner .expiry-list li {
  font-size: 13px;
  color: #78350f;
  padding: 4px 0;
  border-bottom: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  gap: 10px;
}
.expiry-banner .expiry-list li:last-child { border-bottom: none; }
.expiry-banner .cert-no { font-weight: 600; }
.expiry-banner .due-date { margin-left: auto; color: var(--danger); font-weight: 600; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  margin-top: 16px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--gray-50); border-color: var(--gray-300); }
.page-btn.active { background: var(--dark-navy); color: var(--white); border-color: var(--dark-navy); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: var(--gray-800); }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 22px; }
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--blue);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 13px 18px;
  border-radius: 10px;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: slideIn 0.3s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--blue); }

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

/* ===== SESSION TIMEOUT BANNER ===== */
.session-warning {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-navy);
  color: var(--white);
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid var(--orange);
  display: none;
}
.session-warning.show { display: flex; }
.session-warning span { color: var(--orange); font-weight: 700; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ===== CERTIFICATE VIEW (Print layout) ===== */
.cert-preview {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 32px;
  font-family: Arial, sans-serif;
  max-width: 800px;
  margin: 0 auto;
}

.cert-company-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.cert-company-info { font-size: 12px; color: #333; line-height: 1.6; }
.cert-company-info strong { font-size: 13px; font-weight: 700; }

.cert-company-logo { text-align: right; }

.cert-title-box {
  text-align: center;
  border: 2px solid #000;
  padding: 10px 20px;
  margin-bottom: 20px;
}
.cert-title-box h1 { font-size: 18px; font-weight: 700; color: #000; letter-spacing: 1px; }

.cert-field-row {
  display: flex;
  border: 1px solid #ccc;
  margin-bottom: -1px;
}

.cert-field {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  flex: 1;
  border-right: 1px solid #ccc;
  font-size: 12px;
}
.cert-field:last-child { border-right: none; }
.cert-field label { font-weight: 700; white-space: nowrap; margin-right: 8px; font-style: italic; }
.cert-field span { color: #333; }

.cert-section-header {
  background: #f0f0f0;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  margin-bottom: -1px;
}

.cert-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: -1px;
}
.cert-table th {
  background: #e8e8e8;
  border: 1px solid #ccc;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.cert-table td {
  border: 1px solid #ccc;
  padding: 8px;
  font-size: 12px;
  text-align: center;
  min-height: 28px;
}

.cert-remarks {
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 11px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
  font-style: italic;
}
.cert-remarks strong { font-style: normal; }

.cert-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}
.cert-sig-block { font-size: 12px; color: #333; }
.cert-sig-line { border-bottom: 1px solid #333; margin-top: 30px; margin-bottom: 4px; }

.cert-footer-text {
  font-size: 11px;
  color: #333;
  font-weight: 700;
  font-style: italic;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  margin-top: 10px;
}

.cert-iso-logos {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.iso-badge {
  width: 56px;
  height: 56px;
  border: 2px solid #1a2744;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #1a2744;
  text-align: center;
  line-height: 1.2;
}
.iso-badge .iso-main { font-size: 12px; font-weight: 900; }

/* ===== AUDIT LOG TABLE ===== */
.log-action { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.log-LOGIN { background: #dcfce7; color: #15803d; }
.log-LOGOUT { background: #f3f4f6; color: #6b7280; }
.log-CREATE_CERTIFICATE { background: #dbeafe; color: #1d4ed8; }
.log-VIEW_CERTIFICATE { background: #ede9fe; color: #5b21b6; }
.log-SEARCH { background: #fef3c7; color: #92400e; }
.log-DELETE_CERTIFICATE { background: #fee2e2; color: #991b1b; }
.log-LOGIN_FAILED { background: #fee2e2; color: #991b1b; }

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}
.app-footer a { color: var(--orange); font-weight: 500; }
.app-footer a:hover { color: var(--orange-dark); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .mobile-menu-btn { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-form .form-row,
  .app-form .form-row-3,
  .app-form .form-row-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .cert-signatures { grid-template-columns: 1fr; }
  .notif-dropdown { width: 300px; right: -20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar, .app-header, .app-footer, .toolbar, .btn, .page-header .btn,
  .toast-container, .session-warning, .notif-dropdown { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .cert-preview { border: none; padding: 10px; }
  body { background: white; }
}
