:root {
  --ink: #122033;
  --muted: #5f6e7f;
  --canvas: #fffaf2;
  --brand: #f0ab20;
  --brand-dark: #d18c08;
  --navy: #0d2d53;
  --navy-deep: #081b33;
  --line: #e5d9c7;
}

[data-theme="dark"] {
  --ink: #e0e6ed;
  --muted: #8c9ba9;
  --canvas: #091321;
  --brand: #f5b73d;
  --brand-dark: #c48206;
  --navy: #152940;
  --navy-deep: #0b1a2e;
  --line: #20364d;
}

[data-theme="dark"] body {
  background: var(--canvas);
}

[data-theme="dark"] .card, 
[data-theme="dark"] .stat-card, 
[data-theme="dark"] .overview-card, 
[data-theme="dark"] .quick-stat-card,
[data-theme="dark"] .modal-container,
[data-theme="dark"] tr {
  background: #111f32 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #e0e6ed !important;
}

[data-theme="dark"] td {
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
  border-right-color: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] td::before {
  color: #849fb4 !important;
}

[data-theme="dark"] .card-head, 
[data-theme="dark"] .view-header {
  border-bottom-color: #20364d !important;
  background: #0a1421 !important;
}

[data-theme="dark"] .card-head h2,
[data-theme="dark"] .view-title {
  color: #e0e6ed !important;
}

[data-theme="dark"] .stat-value,
[data-theme="dark"] .split-value,
[data-theme="dark"] .lt-val,
[data-theme="dark"] .qs-value {
  color: #ffffff !important;
}

[data-theme="dark"] .stat-label,
[data-theme="dark"] .split-label,
[data-theme="dark"] .qs-label,
[data-theme="dark"] th {
  color: var(--muted) !important;
}

[data-theme="dark"] .dashboard-layout {
  background: var(--canvas);
}

[data-theme="dark"] input:not([type="submit"]):not([type="button"]):not(.btn),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #0a1421 !important;
  color: #e0e6ed !important;
  border-color: #20364d !important;
}

[data-theme="dark"] input::placeholder {
  color: #a0aec0 !important;
  opacity: 1;
}

[data-theme="dark"] .auth-card {
  background: #111f32;
  border-color: #20364d;
}

[data-theme="dark"] .auth-form label,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] .view-title {
  color: #fff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 7% 8%, rgba(240, 171, 32, 0.12), transparent 28%),
    radial-gradient(circle at 94% 10%, rgba(13, 45, 83, 0.12), transparent 24%),
    linear-gradient(180deg, #fffefb 0%, var(--canvas) 100%);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.container {
  width: min(1150px, 93vw);
  margin: 0 auto;
}

.admin-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.header-row {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffe6b4;
  font-weight: 700;
}

h1 {
  margin: 0.15rem 0 0.2rem;
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.5rem, 4.3vw, 2.1rem);
}

.sub {
  margin: 0;
  color: #e7eef5;
  max-width: 64ch;
}

.back-link {
  text-decoration: none;
  color: #081b33;
  background: #ffe8b9;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn {
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.52rem 0.85rem;
  font-weight: 700;
}

.auth-shell {
  padding: 1.2rem 0 0.6rem;
}

.auth-card {
  width: min(560px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(176, 122, 68, 0.35);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 10px 28px rgba(13, 29, 52, 0.1);
}

.auth-card h2 {
  margin: 0 0 0.35rem;
  font-family: "Montserrat", sans-serif;
  color: var(--navy-deep);
}

.auth-card p {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.auth-tab {
  padding: 0.45rem 0.4rem;
  font-size: 0.74rem;
  border-radius: 8px;
}

.auth-tab.is-active {
  background: #ffe7bd;
  border-color: #c78814;
  color: var(--navy-deep);
}

.auth-form {
  display: grid;
  gap: 0.55rem;
}

.auth-form label {
  font-weight: 700;
  color: var(--navy-deep);
  font-size: 0.9rem;
}

.auth-form input {
  border: 1px solid rgba(176, 122, 68, 0.45);
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  font: inherit;
  background: #fffdfa;
  width: 100%;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.toggle-password:hover {
  color: var(--gold-active);
}

.auth-form button {
  margin-top: 0.2rem;
}

.password-hint {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  color: #495b6d;
}

.auth-status {
  min-height: 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-status.is-error {
  color: #8a1c1c;
}

.auth-status.is-success {
  color: #1f5f2a;
}

.expiry-alert {
  border: 1px solid #e3b96a;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: #fff6df;
  color: #684b12;
  font-weight: 700;
}

.expiry-alert.is-expired {
  border-color: #cd7a7a;
  background: #fff0f0;
  color: #7b1d1d;
}

.admin-main-content {
  padding: 2rem 3rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  height: 100vh;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-grid article {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 10px 30px rgba(13, 29, 52, 0.08);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.stat-value {
  margin: 0.25rem 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: 1.9rem;
  color: var(--navy-deep);
  font-weight: 800;
}

.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(13, 29, 52, 0.08);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 247, 236, 0.92);
}

.card-head h2 {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  color: var(--navy-deep);
  font-size: 1.1rem;
}

.actions {
  display: flex;
  gap: 0.45rem;
}

button {
  border: none;
  background: var(--brand-dark);
  color: white;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
  background: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

button.danger {
  background: #ef4444;
  color: white;
}

button.danger:hover {
  background: #dc2626;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* --- Global Card Tables (Replaces traditional tables) --- */
table thead {
  display: none;
}
table {
  display: block;
  width: 100%;
}
tbody {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
  width: 100%;
}
tr {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
tr:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(13, 29, 52, 0.1);
}
td, th {
  position: relative;
  padding: 0.5rem 0.7rem;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  grid-column: span 6; /* Default full width */
  box-sizing: border-box;
  font-size: 0.95rem;
}
td:last-child {
  border-bottom: none;
}

/* Group 1: 50% width (3/6 columns) */
td[data-label="JOB #"],
td[data-label="DATE"],
td[data-label="USERNAME"],
td[data-label="EMAIL"],
td[data-label="SERVICE"],
td[data-label="STATUS"],
td[data-label="CUSTOMER"],
td[data-label="CATEGORY"],
td[data-label="UPLOADED"],
td[data-label="TITLE"],
td[data-label="ADDED"],
td[data-label="CREATED"],
td[data-label="RATING"] {
  grid-column: span 3;
}

/* Group 2: 33% width (2/6 columns) */
td[data-label="NAME"],
td[data-label="PHONE"],
td[data-label="POSTCODE"] {
  grid-column: span 2;
}

/* Add dividers between horizontally grouped cells */
td[data-label="JOB #"], 
td[data-label="NAME"], 
td[data-label="PHONE"], 
td[data-label="USERNAME"],
td[data-label="SERVICE"],
td[data-label="DATE"],
td[data-label="CUSTOMER"],
td[data-label="CATEGORY"],
td[data-label="TITLE"] {
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

td::before {
  content: attr(data-label);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

td.no-data {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  grid-column: span 6;
}
td.no-data::before {
  display: none;
}

/* Ultra-compact Action Buttons */
td[data-label="ACTIONS"] {
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.6rem !important;
  background: rgba(0, 0, 0, 0.015);
}
td[data-label="ACTIONS"]::before {
  display: none;
}

.table-img-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 200px;
}

.no-data {
  color: var(--muted);
  text-align: center;
  padding: 1rem;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-pill.is-completed {
  color: #1f5f2a;
  background: #e6f8ea;
  border: 1px solid #9ed2aa;
}

.status-pill.is-pending {
  color: #7a5a16;
  background: #fff5dc;
  border: 1px solid #dfc17d;
}

.action-btn {
  display: block;
  width: 100%;
  margin: 0.35rem 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  border: none;
  background: #e2e8f0;
  color: #334155;
  transition: all 0.2s;
}

.action-btn:hover {
  background: #cbd5e1;
}

.action-btn.is-complete {
  background: #10b981;
  color: #ffffff;
}

.action-btn.is-complete:hover {
  background: #059669;
}

/* Hardcoded styles for upload forms to override any conflicting CSS and fix mobile spacing */
#gallery-form select,
#projects-form select,
#gallery-form input[type="text"],
#projects-form input[type="text"] {
  width: 100% !important;
  padding: 1rem !important;
  border-radius: 8px !important;
  margin-bottom: 1.5rem !important;
  font-size: 1rem !important;
  display: block !important;
}

#gallery-form .file-input-wrapper,
#projects-form .file-input-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  background: rgba(128,128,128,0.05) !important;
  padding: 1.25rem 1rem !important;
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  margin-bottom: 1.5rem !important;
  gap: 1rem !important;
}

#gallery-form .btn.is-primary,
#projects-form .btn.is-primary {
  width: auto !important;
  padding: 0.75rem 2.5rem !important;
  font-size: 1rem !important;
  border-radius: 8px !important;
  margin: 1.5rem auto 0 auto !important;
  display: block !important;
  text-align: center !important;
}

.action-btn.is-reopen {
  background: #f59e0b;
  color: #ffffff;
}

.action-btn.is-reopen:hover {
  background: #d97706;
}

.action-btn.is-delete {
  background: #ef4444;
  color: #ffffff;
}

.action-btn.is-delete:hover {
  background: #dc2626;
}

@media (max-width: 760px) {
  .header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .auth-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .auth-tabs {
    grid-template-columns: 1fr;
  }
  .sidebar-brand h2 {
    display: none;
  }
  .sidebar-brand {
    padding: 0.8rem 0.5rem;
    flex: 0;
  }
  .sidebar-footer {
    flex: 1;
    justify-content: flex-end;
  }
}

.upload-form {
  padding: 1rem 1.4rem;
  background: var(--canvas-alt);
  border-bottom: 1px solid rgba(176, 122, 68, 0.2);
}

.form-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-row input[type="text"],
.form-row select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.form-row input[type="file"] {
  font-size: 0.9rem;
}

.table-img-preview {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

/* Sidebar & Dashboard Layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: transparent;
}

.admin-sidebar {
  background: rgba(8, 27, 51, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 10;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  padding: 0 0.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.sidebar-brand h2 {
  font-family: "Montserrat", sans-serif;
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
  letter-spacing: 0.02em;
}

.mobile-menu-btn {
  display: none; /* Hidden on desktop */
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn svg {
  width: 28px;
  height: 28px;
}

.sidebar-menu-collapse {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s;
  text-align: center;
}

.file-input-wrapper:hover {
  background: var(--brand-dark);
}

.file-input-wrapper input[type="file"] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

.file-name-display {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* --- Admins Management Grid Layout --- */
.dashboard-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (min-width: 1024px) {
  .dashboard-grid-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(6px);
}

.nav-link.is-active {
  background: linear-gradient(90deg, rgba(240, 171, 32, 0.15), transparent);
  color: var(--brand);
  transform: translateX(6px);
}

.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--brand);
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.back-link-alt, .logout-btn-alt {
  width: 100%;
}

.logout-btn-alt {
  color: #e5a4a4;
}

.logout-btn-alt:hover {
  background: rgba(229, 164, 164, 0.1);
  color: #fff;
}

.theme-toggle-sidebar {
  cursor: pointer;
  user-select: none;
}

.theme-toggle-sidebar svg {
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-sidebar:hover svg {
  transform: rotate(25deg) scale(1.1);
}

[data-theme="dark"] .theme-toggle-sidebar svg.moon-icon {
  stroke: var(--brand);
}

.view-title {
  margin: 0 0 0.2rem;
  font-family: "Montserrat", sans-serif;
  color: var(--navy-deep);
  font-size: 1.8rem;
}

.view-sub {
  color: var(--muted);
  margin: 0 0 2rem;
}

/* 1. Laptops & Landscape Tablets (1366x768 / iPad Pro 1024px) */
@media (max-width: 1024px) {
  .dashboard-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
  }
  
  .admin-sidebar {
    position: relative;
    flex-direction: row;
    padding: 0.8rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    overflow: visible !important;
  }

  .sidebar-brand {
    padding: 0;
    margin: 0;
    border: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-brand p {
    display: none;
  }
  
  .sidebar-brand h2 {
    font-size: 1.4rem;
    white-space: nowrap;
  }

  .mobile-menu-btn {
    display: block;
    margin-left: auto;
  }

  .sidebar-menu-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(8, 27, 51, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 1rem 1.5rem 2rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .admin-sidebar.is-open .sidebar-menu-collapse {
    display: flex;
  }

  .sidebar-nav {
    flex-direction: column;
    gap: 0.4rem;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.8rem 1rem;
    width: 100%;
  }

  .sidebar-footer {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
  }

  .admin-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
  }
}

/* 2. Tablet Portrait (iPad 768px) & Mobile Phones (480px, 360px) */
@media (max-width: 768px) {
  .admin-sidebar {
    padding: 0.8rem 1rem;
  }
  
  .sidebar-brand h2 {
    font-size: 1.25rem;
  }

  .sidebar-menu-collapse {
    padding: 1rem 1rem 2rem;
  }

  .view-title {
    font-size: 1.4rem;
  }
  
  .overview-time-grid {
    grid-template-columns: 1fr;
  }

  .admin-main-content {
    padding: 1rem;
  }
}

/* Removed legacy mobile table queries */

/* Overview Dashboard Specific Styles */
.overview-time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}

.overview-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 1.3rem 1.6rem;
  box-shadow: 0 8px 24px rgba(13, 29, 52, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(13, 29, 52, 0.1);
}

.overview-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.overview-card-header .stat-icon {
  font-size: 1.1rem;
}

.overview-card-header .stat-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.overview-main-value {
  margin: 0.3rem 0;
  font-family: "Montserrat", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--navy-deep);
  line-height: 1.1;
}

.overview-main-value.text-pending {
  color: #d97706;
}

.overview-main-value.text-completed {
  color: #10b981;
}

.overview-subtext {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

[data-theme="dark"] .overview-card {
  background: rgba(18, 30, 49, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .overview-card-header .stat-label {
  color: #f1f5f9;
}

[data-theme="dark"] .overview-main-value {
  color: #ffffff;
}

[data-theme="dark"] .overview-main-value.text-pending {
  color: #fbbf24;
}

[data-theme="dark"] .overview-main-value.text-completed {
  color: #34d399;
}

.overview-bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.recent-quotes-card .table-wrap {
  max-height: 400px;
  overflow-y: auto;
}

.overview-side-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Donut Chart */
.breakdown-body {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1.5rem 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.donut-chart {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#1f5f2a var(--completed-pct, 0%), #e5d9c7 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.donut-chart::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
}

.breakdown-legend {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 140px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-completed {
  background: #1f5f2a;
}

.dot-pending {
  background: #dfc17d;
}

.legend-val {
  margin-left: auto;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
}

/* Lifetime Totals */
.lifetime-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lt-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.lt-stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.lt-label {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.lt-val {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy-deep);
}

@media (max-width: 1024px) {
  .overview-bottom-grid {
    grid-template-columns: 1fr;
  }
  .lt-stat {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem 0;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
  opacity: 0;
}

/* Modal Container */
.modal-container {
  background: #ffffff;
  width: 90%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

/* Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  background: var(--navy-deep);
  color: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-family: "Montserrat", sans-serif;
}

.close-modal-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
  box-shadow: none;
}

.close-modal-btn:hover {
  background: none;
  color: white;
  transform: none;
  box-shadow: none;
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
  max-height: 80vh;
  overflow-y: auto;
}

/* Job Info Grid */
.job-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.info-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.info-group p {
  margin: 0;
  font-size: 1rem;
  color: #334155;
  font-weight: 500;
}

.info-group.full-width {
  grid-column: 1 / -1;
}

.details-box {
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.modal-divider {
  border: 0;
  height: 1px;
  background: #e2e8f0;
  margin: 1.5rem 0;
}

/* Delete Reason Box Styling */
.delete-reason-box {
  margin-top: 1.5rem;
  background: #f8fafc;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  text-align: left;
}

[data-theme="dark"] .delete-reason-box {
  background: #0f172a;
  border-color: #334155;
}

.delete-reason-label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

[data-theme="dark"] .delete-reason-label {
  color: #94a3b8;
}

.delete-reason-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.85rem;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  background: #ffffff;
  color: #1e293b;
}

.delete-reason-textarea:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .delete-reason-textarea {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}

[data-theme="dark"] .delete-reason-textarea:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3) !important;
}

/* Admin Notes Section */
.admin-notes-section label {
  display: block;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.admin-notes-section textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.95rem;
  color: #334155;
  resize: vertical;
  background: #fff;
}

.admin-notes-section textarea:focus {
  outline: none;
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 3px rgba(176, 122, 68, 0.1);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.save-status {
  font-size: 0.9rem;
  color: #10b981;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-status.show {
  opacity: 1;
}

.notes-history-box {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1rem;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.95rem;
  color: #334155;
  white-space: pre-wrap;
  margin-bottom: 1rem;
}

.no-notes-text {
  color: #94a3b8;
  font-style: italic;
  margin: 0;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 18px rgba(212, 139, 41, 0.6);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-to-top svg {
  width: 28px;
  height: 28px;
  stroke: #fff;
  stroke-width: 3.5px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--brand-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(212, 139, 41, 0.5);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
  }
  .scroll-to-top svg {
    width: 24px;
    height: 24px;
  }
}

/* --- Premium Split-Screen Login --- */
.login-split {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}
@media (min-width: 1024px) {
  .login-split {
    grid-template-columns: 1.1fr 1fr;
  }
}

.login-image-side {
  background: url('sample_exterior_1.png') center/cover no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: white;
}
@media (max-width: 1023px) {
  .login-image-side {
    min-height: 250px;
  }
}

.login-overlay {
  background: rgba(8, 27, 51, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-overlay h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.login-overlay p {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  color: #f0ab20;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.login-form-side {
  background: var(--canvas);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
}

.login-header-simple {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: flex-end;
}

.login-form-side .auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-form-side .auth-card {
  width: 100%;
  max-width: 500px;
  margin: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(176, 122, 68, 0.2);
  box-shadow: 0 15px 35px rgba(13, 29, 52, 0.08);
  padding: 2.5rem;
  border-radius: 24px;
}

/* Floating Labels */
.auth-form {
  gap: 1.2rem;
}

.auth-form label {
  color: var(--navy-deep);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: -0.8rem;
  z-index: 1;
}

.auth-form input {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(176, 122, 68, 0.3);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 171, 32, 0.2);
}

/* Brute-force countdown UI */
.lockout-timer {
  background: #fff0f0;
  border: 1px solid #cd7a7a;
  color: #7b1d1d;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(205, 122, 122, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(205, 122, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(205, 122, 122, 0); }
}

/* --- Quick Stats --- */
.quick-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
  .quick-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }
}
.quick-stat-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.qs-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}
.qs-value {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
}

/* Mobile adjustments for Dashboard Overview 3-card layout */
@media (max-width: 768px) {
  .overview-time-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.4rem !important;
  }
  .overview-card {
    padding: 0.6rem 0.4rem !important;
    border-radius: 10px !important;
  }
  .overview-card .stat-label {
    font-size: 0.75rem !important;
    text-align: center;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  [data-theme="dark"] .overview-card .stat-label {
    border-bottom-color: rgba(255,255,255,0.1);
  }
  .overview-card .split-stats {
    flex-direction: column !important;
    gap: 0.5rem !important;
    margin-top: 0 !important;
  }
  .overview-card .split-stats > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }
  .overview-card .split-label {
    font-size: 0.65rem !important;
    white-space: normal;
    line-height: 1.1;
  }
  .overview-card .split-value {
    font-size: 1.2rem !important;
    margin-top: 0.1rem !important;
  }
}

/* --- Business Resource Buttons --- */
.btn-resource {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-resource svg {
  flex-shrink: 0;
}

.btn-resource-secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.btn-resource-secondary:hover {
  background: #cbd5e1;
}

.btn-resource-primary {
  background: #1e293b;
  color: #ffffff;
}

.btn-resource-primary:hover {
  background: #0f172a;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .btn-resource-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e6ed;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-resource-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .btn-resource-primary {
  background: var(--brand);
  color: var(--navy-deep);
  border: 1px solid var(--brand-dark);
}

[data-theme="dark"] .btn-resource-primary:hover {
  background: var(--brand-dark);
}

/* --- Admin Reply on Feedbacks --- */
.admin-reply {
  margin-top: 15px;
  padding: 12px 15px;
  background-color: #eef2ff;
  border-left: 4px solid var(--brand, #f0ab20);
  border-radius: 6px;
  font-size: 0.95em;
  color: #334155;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.admin-reply strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy, #0d2d53);
  font-size: 1.05em;
}

[data-theme="dark"] .admin-reply {
  background-color: rgba(245, 183, 61, 0.15); /* tinted with brand-gold */
  border-left: 4px solid var(--brand, #f5b73d);
  color: #e0e6ed;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .admin-reply strong {
  color: var(--brand, #f5b73d);
}

/* --- Admins Management Grid Layout --- */
.dashboard-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

@media (min-width: 1024px) {
  .dashboard-grid-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
/* --- Quick Filter Chips Bar --- */
.quick-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.filter-chip:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(13, 29, 52, 0.2);
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  min-width: 1.2rem;
}

.filter-chip.is-active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chip-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pending-indicator {
  background: #f59e0b;
}

.completed-indicator {
  background: #10b981;
}

/* Dark Mode Overrides */
[data-theme="dark"] .quick-stat-card {
  background: rgba(18, 30, 49, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .filter-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

[data-theme="dark"] .filter-chip:hover {
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .filter-chip.is-active {
  background: var(--brand);
  color: var(--navy-deep);
  border-color: var(--brand);
}

[data-theme="dark"] .filter-chip.is-active .chip-count {
  background: rgba(0, 0, 0, 0.15);
  color: var(--navy-deep);
}

/* --- Responsive 2x2 Grid on Smartphones --- */
@media (max-width: 640px) {
  .quick-filters-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
  }

  .filter-chip {
    width: 100%;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
    box-sizing: border-box;
    text-align: center;
    gap: 0.4rem;
  }

  .filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .chip-count {
    flex-shrink: 0;
    padding: 0.1rem 0.4rem;
  }
}

@media (max-width: 768px) {
  .overview-time-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
}

/* ==========================================================================
   Admins Management & Security Hub - Modern Tabbed Experience
   ========================================================================== */
.admin-subtabs-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.75rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.admin-subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
  user-select: none;
}

.admin-subtab-btn:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--navy);
  transform: translateY(-1px);
}

.admin-subtab-btn.is-active {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(13, 45, 83, 0.25);
}

.subtab-badge {
  background: rgba(240, 171, 32, 0.2);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  line-height: 1;
}

.admin-subtab-btn.is-active .subtab-badge {
  background: var(--brand);
  color: var(--navy-deep);
}

.subtab-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
}

.subtab-status-dot.is-active {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.subtab-status-dot.is-warning {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.admin-subtab-content {
  animation: fadeInAdminTab 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInAdminTab {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-management-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(13, 45, 83, 0.06);
  border: 1px solid var(--line);
  background: #ffffff;
}

/* Security Grid Layout */
.admin-security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

/* Business Resources Grid */
.business-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.resource-item-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.resource-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13, 45, 83, 0.12);
}

.resource-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(13, 45, 83, 0.08), rgba(240, 171, 32, 0.15));
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  border: 1px solid var(--line);
}

.resource-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 0.5rem 0;
}

.resource-card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
  flex-grow: 1;
}

.resource-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.resource-card-actions .btn-resource {
  justify-content: center;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
}

/* Dark Mode Overrides for Admins Hub */
[data-theme="dark"] .admin-subtab-btn {
  background: rgba(17, 31, 50, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
  color: #a0aec0;
}

[data-theme="dark"] .admin-subtab-btn:hover {
  background: #152940;
  color: #fff;
  border-color: var(--brand);
}

[data-theme="dark"] .admin-subtab-btn.is-active {
  background: var(--brand);
  color: #0b1a2e;
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(245, 183, 61, 0.3);
}

[data-theme="dark"] .admin-subtab-btn.is-active .subtab-badge {
  background: #0b1a2e;
  color: var(--brand);
}

[data-theme="dark"] .admin-management-card {
  background: #111f32 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .resource-card-icon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--brand);
}

[data-theme="dark"] .resource-card-title {
  color: #ffffff;
}

/* Responsive 2x2 Grid for Tablets & Smartphones (Portrait / Vertical) */
@media (max-width: 860px) {
  .admin-subtabs-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    width: 100%;
    overflow-x: visible;
    padding-bottom: 0.85rem;
    border-bottom: 2px solid var(--line);
  }
  
  .admin-subtab-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 0.6rem;
    font-size: 0.82rem;
    box-sizing: border-box;
    text-align: center;
    gap: 0.45rem;
    white-space: nowrap;
  }

  .admin-subtab-btn svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
  }

  .admin-security-grid,
  .business-resources-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-subtabs-nav {
    gap: 0.45rem;
  }

  .admin-subtab-btn {
    padding: 0.6rem 0.35rem;
    font-size: 0.76rem;
    gap: 0.35rem;
  }

  .admin-subtab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .subtab-badge {
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
  }
}


