/* ==========================================================================
  The Garden Wing Security System — core stylesheet
   Palette: deep navy/charcoal base with an amber "alert" accent — evokes
   control-room / surveillance-panel hardware rather than a generic SaaS look.
   ========================================================================== */

:root {
  --bg:          #f7f5f2;
  --panel:       #fffdfa;
  --panel-alt:   #f0ede8;
  --border:      #ded9d1;
  --accent:      #c15f3c;
  --accent-soft: #e6a084;
  --accent-dim:  #ead8ce;
  --ok:          #39745a;
  --danger:      #b94b42;
  --info:        #5b6f84;
  --text:        #292725;
  --text-muted:  #766f68;
  --font-body:   'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Newsreader', Georgia, serif;
  --radius:      6px;
}

* { box-sizing: border-box; }

.top-notification {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(41, 39, 37, .12);
  font-size: .88rem;
  font-weight: 600;
  animation: notification-in .2s ease-out;
}

.top-notification-success { background: #eef5ef; border-color: #c9ddd0; color: var(--ok); }
.top-notification-error { background: #fbefed; border-color: #e3c5c1; color: var(--danger); }

@keyframes notification-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 575px) {
  .top-notification { top: 12px; right: 16px; left: 16px; max-width: none; }
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'ss01' 1;
  letter-spacing: 0;
}

body, .auth-page, .auth-brand-pane, .auth-form-pane, .auth-form-card {
  background-color: var(--bg);
}

a { text-decoration: none; }

/* --------------------------------------------------------------------------
   Login / landing page
   -------------------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
}

.auth-brand-pane {
  position: relative;
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 56px 64px;
  background:
    radial-gradient(circle at 15% 20%, rgba(217, 187, 114, 0.16), transparent 38%),
    linear-gradient(180deg, #f5f0e7 0%, #f1eee7 100%);
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.auth-brand-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(234, 238, 245, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 238, 245, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 20% 30%, black, transparent 65%);
  pointer-events: none;
}

.auth-brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  z-index: 1;
  color: var(--accent);
  margin-left: 8px;
}

.auth-brand-mark i {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #f5f0e7;
  background: var(--accent);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(23, 59, 94, 0.18);
}

.auth-brand-copy {
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand-copy h1 {
  font-size: clamp(2.7rem, 3.8vw, 5rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.055em;
  margin-bottom: 22px;
  color: var(--text);
}

.auth-brand-copy p {
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 760px;
  margin: 0;
}

.auth-stat-row {
  display: flex;
  gap: 32px;
  z-index: 1;
  margin-top: 40px;
}

.auth-stat-row .stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.auth-stat-row .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-form-pane {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-form-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 26px 20px;
  box-shadow: 0 12px 28px rgba(23, 59, 94, 0.08);
}

.auth-form-card h2 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: var(--text);
}

.auth-form-card .subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 32px;
}

.auth-form-card label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-form-card .form-control {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 8px;
}

.auth-form-card .form-control:focus {
  background: #fff;
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(23, 59, 94, 0.12);
}

.auth-form-card .form-control::placeholder {
  color: #566078;
}

.role-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.role-picker input[type="radio"] {
  display: none;
}

.role-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.35);
}

.role-picker input[type="radio"]:checked + label {
  border-color: var(--accent-soft);
  color: var(--accent);
  background: rgba(23, 59, 94, 0.06);
}

.btn-accent {
  background: var(--accent);
  border: 1px solid var(--accent-soft);
  color: #f7f3ee;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 8px;
  width: 100%;
  transition: filter .15s ease;
}

.btn-accent:hover {
  filter: brightness(1.08);
  color: #f7f3ee;
}

.auth-footnote {
  margin-top: 28px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 991px) {
  .auth-brand-pane { display: none; }
}

/* --------------------------------------------------------------------------
   Dashboard shell (admin + security)
   -------------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 22px 22px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand i { color: var(--accent); font-size: 1.3rem; }

.sidebar-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: .9rem;
  padding: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
  background: #e5e1db;
  color: var(--text);
}

.sidebar-close:active { transform: scale(.94); }

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-nav .nav-link i,
.sidebar-footer .nav-link i { width: 18px; text-align: center; }

.sidebar-nav .nav-link:hover {
  background: var(--panel-alt);
  color: var(--text);
}

.sidebar-nav .nav-link.active {
  background: rgba(232, 163, 61, 0.1);
  color: var(--accent);
}

.sidebar-nav .nav-link-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-link-toggle span { flex: 1; }

.nav-chevron {
  width: auto !important;
  font-size: 0.7rem;
  transition: transform .15s ease;
}

.nav-link-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.sidebar-subnav {
  display: none;
  padding-left: 28px;
}

.sidebar-subnav.is-open {
  display: block;
}

.sidebar-subnav .nav-link {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 0.85rem;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.btn-icon {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 4px 3px 3px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
}

.profile-menu-button:hover,
.profile-menu-button:focus-visible,
.profile-menu-button.show {
  background: var(--panel);
  border-color: var(--border);
}

.profile-menu-button::after {
  margin-left: 4px;
  color: var(--text-muted);
}

.profile-menu-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.user-role-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.profile-menu {
  min-width: 220px;
  margin-top: 8px !important;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(24, 47, 70, 0.14);
}

.profile-menu .dropdown-header {
  padding: 7px 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.profile-menu .dropdown-divider {
  border-color: var(--border);
}

.profile-menu .dropdown-item {
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.85rem;
}

.profile-menu .dropdown-item:hover,
.profile-menu .dropdown-item:focus {
  background: var(--panel-alt);
}

.profile-signout {
  color: var(--danger) !important;
  font-weight: 600;
}

.profile-signout i {
  width: 18px;
  margin-right: 5px;
}

.user-role-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: rgba(232, 163, 61, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.user-role-badge.badge-security {
  color: var(--info);
  background: rgba(76, 141, 255, 0.1);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-name { font-size: 0.88rem; font-weight: 600; }

@media (max-width: 575px) {
  .app-topbar {
    padding: 14px 16px;
  }

  .profile-menu-copy {
    display: none;
  }
}

.app-content {
  padding: 28px;
  flex: 1;
}

.app-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  padding: 14px 28px;
}

/* --------------------------------------------------------------------------
   Guest belongings form
   -------------------------------------------------------------------------- */

.form-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.form-page-heading h2 { margin: 4px 0 3px; font-size: 1.35rem; font-weight: 800; }
.form-page-heading p { color: var(--text-muted); margin: 0; font-size: .86rem; }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.form-print-button { width: auto; white-space: nowrap; }

.belongings-form {
  max-width: 940px;
  margin: 0 auto;
  padding: 38px 48px 34px;
  background: #fffdf8;
  border: 1px solid #bda975;
  box-shadow: 0 14px 32px rgba(24, 47, 70, .1);
  color: #26333a;
}

.paper-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 2px solid #26333a; }
.paper-brand-mark { display: flex; align-items: center; gap: 9px; color: #26333a; font-size: .9rem; font-weight: 800; letter-spacing: .02em; }
.paper-brand-mark i { color: #a98b3e; font-size: 1.35rem; }
.paper-form-title { text-align: right; }
.paper-form-title h1 { margin: 0; font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.paper-form-title p { margin: 5px 0 0; color: #69716f; font-size: .74rem; text-transform: uppercase; letter-spacing: .13em; }

.paper-form-details { display: grid; grid-template-columns: 1.5fr 1.3fr .75fr; gap: 24px; padding: 24px 0 20px; }
.paper-form-details label { font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.paper-form-details input,
.paper-form-details select {
  display: block;
  width: 100%;
  min-height: 42px;
  border: 1px solid #d5d1ca;
  border-radius: 4px;
  background: #fffdf8;
  padding: 10px 36px 10px 12px;
  color: #26333a;
  font: inherit;
  font-size: .84rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #69716f 50%),
    linear-gradient(135deg, #69716f 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.paper-form-details input:focus,
.paper-form-details select:focus,
.belongings-table input:focus,
.belongings-select:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(57, 116, 90, .12);
}

.belongings-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.belongings-table th { padding: 9px 8px; border-bottom: 2px solid #26333a; font-size: .78rem; text-align: left; letter-spacing: .05em; }
.belongings-table th:not(:first-child), .belongings-table td:not(:first-child) { padding-left: 16px; }
.belongings-table th:nth-child(2), .belongings-table td:nth-child(2) { width: 12%; }
.belongings-table th:nth-child(3), .belongings-table th:nth-child(4) { width: 25%; }
.belongings-table td { height: 39px; border-bottom: 1px solid #b7bbb6; vertical-align: middle; }
.belongings-table input[type="text"], .belongings-table input[type="number"] { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid #7d8581; border-radius: 0; background: transparent; padding: 5px 2px; color: #26333a; }
.belongings-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #d5d1ca;
  border-radius: 4px;
  background: #fffdf8;
  color: #26333a;
  padding: 8px 30px 8px 10px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #69716f 50%),
    linear-gradient(135deg, #69716f 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.belongings-select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57, 116, 90, .12); }
.belongings-table input[type="number"] { text-align: center; }
.wallet-amount-label { display: block; margin-top: 5px; color: #69716f; font-size: .65rem; font-weight: 700; text-transform: uppercase; }
.belongings-table input.wallet-amount { text-align: left; }
.item-check { display: flex; align-items: center; gap: 6px; font-size: .86rem; cursor: pointer; }
.item-check input { width: 15px; height: 15px; accent-color: var(--accent); }
.others-row td { height: 46px; border-bottom: 0; }
.others-row label { display: block; font-size: .82rem; font-weight: 800; }
.paper-form-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.paper-form-footer .employee-submit { width: auto; min-width: 170px; }
.paper-form-footer .employee-submit-secondary { min-width: 120px; }

/* Laptop: preserve the paper proportions while using the available width. */
@media (min-width: 1200px) and (max-width: 1600px) {
  .belongings-form { max-width: 900px; padding: 34px 40px 30px; }
}

/* Tablet: reduce the paper margins and tighten the table slightly. */
@media (min-width: 768px) and (max-width: 1199px) {
  .belongings-form { width: calc(100% - 32px); padding: 30px 28px 28px; }
  .paper-form-header { gap: 16px; }
  .paper-form-details { gap: 16px; }
  .belongings-table th { font-size: .74rem; }
  .belongings-table th:not(:first-child), .belongings-table td:not(:first-child) { padding-left: 10px; }
  .item-check { font-size: .8rem; }
}

/* Mobile: turn each table row into a compact, full-width field group. */
@media (min-width: 576px) and (max-width: 767px) {
  .belongings-form { width: calc(100% - 24px); padding: 26px 20px 24px; }
  .paper-form-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .paper-form-title { text-align: left; }
  .paper-form-title h1 { font-size: 1.1rem; }
  .paper-form-details { grid-template-columns: 1fr 1fr; gap: 14px; }
  .paper-form-details label:last-child { grid-column: 1 / -1; }
}

/* Small mobile: use the full viewport and keep every input touch-friendly. */
@media (max-width: 575px) {
  .belongings-form { width: 100%; padding: 22px 14px 20px; border-left: 0; border-right: 0; box-shadow: none; }
  .paper-form-header { align-items: flex-start; flex-direction: column; gap: 12px; padding-bottom: 18px; }
  .paper-form-title { text-align: left; }
  .paper-form-title h1 { font-size: 1rem; line-height: 1.35; }
  .paper-form-title p { font-size: .65rem; }
  .paper-form-details { grid-template-columns: 1fr; gap: 12px; padding: 18px 0 16px; }
  .paper-form-details input { min-height: 36px; font-size: 1rem; }
}

@media (max-width: 767px) {
  .belongings-table-wrap { width: 100%; overflow: visible; }
  .belongings-table { display: block; width: 100%; table-layout: auto; }
  .belongings-table thead { display: none; }
  .belongings-table tbody { display: block; }
  .belongings-table tbody tr { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 0 12px; padding: 12px 0; border-bottom: 1px solid #b7bbb6; }
  .belongings-table tbody tr:last-child { border-bottom: 0; }
  .belongings-table td,
  .belongings-table th { display: block; width: auto !important; height: auto; padding: 0 !important; border: 0; min-width: 0; }
  .belongings-table td:first-child { grid-column: 1 / -1; margin-bottom: 9px; }
  .belongings-table td:nth-child(2)::before,
  .belongings-table td:nth-child(3)::before,
  .belongings-table td:nth-child(4)::before { display: block; margin-bottom: 3px; color: #69716f; font-size: .63rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .belongings-table td:nth-child(2)::before { content: 'Quantity'; }
  .belongings-table td:nth-child(3)::before { content: 'Brand'; }
  .belongings-table td:nth-child(4)::before { content: 'Color'; }
  .belongings-table td:nth-child(4) { grid-column: 1 / -1; margin-top: 10px; }
  .belongings-table input[type="text"],
  .belongings-table input[type="number"],
  .belongings-select { min-height: 36px; font-size: .95rem; }
  .item-check { font-size: .84rem; }
  .item-check input { width: 18px; height: 18px; }
  .wallet-amount-label { margin-top: 6px; }
  .paper-form-footer { justify-content: stretch; }
  .paper-form-footer .btn { flex: 1; min-height: 42px; }
}

@media print {
  @page { size: landscape; margin: 8mm; }
  body { background: #fff; }
  .app-sidebar, .app-topbar, .app-footer, .d-print-none, .dtr-filter-panel, .dtr-hero .btn { display: none !important; }
  .app-main, .app-content { display: block; padding: 0; }
  .belongings-form { max-width: none; border: 0; box-shadow: none; padding: 0; }
  .dtr-sheet { border: 0; padding: 0; }
}

/* --------------------------------------------------------------------------
  Access portal and gate operations dashboard
  -------------------------------------------------------------------------- */
.access-portal { background: #f5f2eb; color: #17262b; }
.access-portal .auth-brand-pane { flex-basis: 58%; justify-content: space-between; padding: 44px 7vw 38px; background: #172d32; border-right: 0; color: #f5f2eb; }
.access-portal .auth-brand-pane::before { background-image: linear-gradient(rgba(232, 225, 205, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(232, 225, 205, .06) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(135deg, black, transparent 78%); }
.access-portal .auth-brand-mark { color: #f2ba63; margin: 0; }
.access-portal .auth-brand-mark i { color: #172d32; background: #f2ba63; box-shadow: none; }
.access-portal .auth-brand-copy { margin: 0; max-width: 720px; }
.access-portal .auth-brand-copy h1 { color: #f5f2eb; font-size: clamp(2.8rem, 5vw, 5.7rem); letter-spacing: -.065em; margin: 16px 0 24px; }
.access-portal .auth-brand-copy h1 em { color: #f2ba63; font-family: var(--font-display); font-weight: 500; }
.access-portal .auth-brand-copy p { max-width: 480px; color: #b7c4c1; }
.access-portal .eyebrow { color: #df9c4b; }
.portal-steps { display: flex; gap: 28px; margin-top: 56px; }
.portal-steps div { min-width: 138px; padding-top: 12px; border-top: 1px solid rgba(245,242,235,.26); }
.portal-steps span, .portal-steps strong, .portal-steps small { display: block; }
.portal-steps span { color: #f2ba63; font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.portal-steps strong { margin-top: 14px; color: #f5f2eb; font-size: .92rem; }
.portal-steps small { margin-top: 4px; color: #91a6a2; font-size: .75rem; }
.auth-location { position: relative; z-index: 1; color: #91a6a2; font-size: .75rem; letter-spacing: .02em; }
.auth-location i { color: #f2ba63; margin-right: 6px; }
.auth-location span { margin: 0 10px; color: #53706e; }
.access-portal .auth-form-pane { flex-basis: 42%; padding: 32px 7vw; background: #f5f2eb; }
.access-portal .auth-form-card { max-width: 440px; padding: 0; background: transparent; border: 0; box-shadow: none; }
.form-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.secure-mark { color: #39745a; font-size: .72rem; font-weight: 700; }
.access-portal .auth-form-card h2 { color: #17262b; font-size: 2.2rem; letter-spacing: -.04em; }
.access-portal .auth-form-card .subtitle { margin-bottom: 34px; color: #71807d; }
.access-portal .auth-form-card label { color: #536461; font-weight: 700; }
.access-portal .auth-form-card .form-control { border: 0; border-bottom: 1px solid #c9d0ca; border-radius: 0; padding: 12px 0; background: transparent; }
.access-portal .auth-form-card .form-control:focus { border-color: #39745a; box-shadow: 0 2px 0 #39745a; }
.access-portal .role-picker label { border-radius: 3px; background: #ebe8df; }
.access-portal .role-picker input[type="radio"]:checked + label { border-color: #39745a; color: #39745a; background: #e1ece5; }
.access-portal .btn-accent { margin-top: 8px; border: 0; border-radius: 3px; background: #39745a; }
.access-portal .btn-accent:hover { background: #2f6049; }
.access-portal .auth-footnote { color: #71807d; }
.access-portal .auth-footnote i { color: #39745a; margin-right: 5px; }

.ops-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 8px 0 30px; }
.ops-hero h2 { margin: 10px 0 8px; color: #172d32; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -.06em; line-height: .98; }
.ops-hero p { margin: 0; color: var(--text-muted); }
.ops-clock { white-space: nowrap; color: #172d32; font-weight: 800; font-size: 1.1rem; }
.ops-clock small { color: var(--text-muted); font-size: .72rem; font-weight: 500; }
.metric-card { height: 100%; padding: 18px 20px; border: 1px solid #d9ded7; border-radius: 5px; background: #fffdf8; }
.metric-card.metric-primary { background: #172d32; border-color: #172d32; color: #f5f2eb; }
.metric-card span { display: block; color: #7a8781; font-size: .75rem; }
.metric-card.metric-primary span { color: #b7c4c1; }
.metric-card .metric-kicker { margin-bottom: 15px; text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; font-weight: 800; }
.metric-card strong { display: block; margin-bottom: 10px; font-size: 2rem; letter-spacing: -.05em; }
.metric-card i { color: #39745a; }
.metric-primary i { color: #f2ba63; }
.scan-panel { height: 100%; padding: 28px; border-radius: 5px; background: #e3ece5; border: 1px solid #ccddd0; }
.scan-panel h3 { margin: 8px 0 6px; color: #172d32; font-size: 1.65rem; letter-spacing: -.04em; }
.scan-panel p { margin: 0; color: #637570; font-size: .86rem; }
.scan-badge { padding: 7px 10px; border-radius: 20px; background: #d4e6da; color: #39745a; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.scan-input-wrap { display: flex; align-items: center; gap: 12px; padding: 5px 6px 5px 16px; border: 1px solid #a9c3b1; border-radius: 4px; background: #fffdf8; }
.scan-input-wrap > i { color: #39745a; font-size: 1.25rem; }
.scan-input-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #172d32; padding: 11px 0; }
.scan-input-wrap button { width: 38px; height: 38px; border: 0; border-radius: 3px; background: #39745a; color: #fff; }
.scan-hint { margin-top: 12px; color: #6b8175; font-size: .74rem; }
.scan-hint i { margin-right: 5px; }
.quick-actions { display: flex; gap: 10px; margin-top: 24px; }
.quick-actions .btn { width: auto; font-size: .78rem; }
.camera-modal[hidden] { display: none; }
.camera-modal { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(23, 45, 50, .72); }
.camera-dialog { width: min(100%, 520px); padding: 24px; border: 1px solid #ccddd0; border-radius: 6px; background: #fffdf8; box-shadow: 0 24px 70px rgba(23, 45, 50, .25); }
.camera-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.camera-dialog h2 { margin: 7px 0 0; color: #172d32; font-size: 1.25rem; }
.camera-close { flex: 0 0 auto; }
.qr-reader { min-height: 280px; overflow: hidden; border: 1px solid #ccddd0; border-radius: 4px; background: #172d32; }
.qr-reader video { border-radius: 4px; }
.camera-status { margin: 12px 0 0; color: #637570; font-size: .78rem; }
.btn-quiet { border: 1px solid #bfd0c3; color: #39745a; background: transparent; }
.btn-quiet:hover { background: #d4e6da; color: #2f6049; }
.queue-card { padding: 24px; }
.queue-count { min-width: 32px; padding: 7px 9px; border-radius: 4px; background: #f5e4c9; color: #a66527; text-align: center; font-weight: 800; font-size: .8rem; }
.queue-row { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid #e3e1d9; }
.queue-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #dce9e0; color: #39745a; font-size: .7rem; font-weight: 800; }
.queue-avatar.warm { background: #f5e4c9; color: #a66527; }.queue-avatar.green { background: #d9e5eb; color: #426c7b; }
.queue-row strong, .queue-row small { display: block; }.queue-row strong { color: #263633; font-size: .82rem; }.queue-row small { margin-top: 2px; color: #84908b; font-size: .7rem; }
.queue-time { color: #84908b; font-size: .7rem; }.queue-link { display: block; margin-top: 18px; color: #39745a; font-size: .76rem; font-weight: 800; }
.queue-link i { float: right; }.activity-panel { padding: 24px; }.live-label { color: #39745a; font-size: .72rem; font-weight: 800; }
.direction-in { color: #39745a; }.direction-out { color: #a66527; }.status-pill { display: inline-block; padding: 5px 8px; border-radius: 20px; font-size: .66rem; font-weight: 800; }.status-pill.cleared { background: #e1ece5; color: #39745a; }.status-pill.review { background: #f5e4c9; color: #a66527; }
.table-security td { vertical-align: middle; }

.verify-page {
  max-width: 1200px;
  margin: 0 auto;
}

.verify-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.verify-header h1 {
  margin: 8px 0 6px;
  color: var(--text);
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  letter-spacing: -0.05em;
}

.verify-header p {
  max-width: 620px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.verify-empty-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.verify-scan-panel {
  padding: 30px 28px;
  border-radius: 18px;
  border: 1px solid #cfe0d5;
  box-shadow: 0 18px 40px rgba(23, 45, 50, 0.06);
}

.verify-panel-intro {
  margin-bottom: 10px;
}

.verify-panel-intro .panel-title {
  margin-top: 8px;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.verify-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.verify-main-column,
.verify-side-column {
  display: grid;
  gap: 20px;
}

.verify-pass-summary-card,
.verify-items-card,
.verify-side-card {
  padding: 22px 24px;
}

.verify-pass-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.verify-pass-top h2 {
  margin: 8px 0 6px;
  color: var(--text);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.verify-pass-top p {
  margin: 0;
}

.verify-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.verify-summary-item {
  padding: 16px 14px;
  border: 1px solid #e8dfd5;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdfb 0%, #f8f4f1 100%);
}

.verify-summary-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verify-summary-item strong {
  display: block;
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.4;
  word-break: break-word;
}

.verify-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.verify-section-header h3 {
  margin-top: 8px;
}

.verify-item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f5e6df;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.verify-table thead th {
  white-space: nowrap;
}

.verify-action-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.verify-action-form .btn {
  min-width: 220px;
}

.verify-edit-card {
  padding: 24px;
  border: 1px solid #cfe0d5;
  background: linear-gradient(180deg, #f5faf5 0%, #fffdfb 100%);
}

.verify-edit-card .belongings-form {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.verify-edit-note {
  margin: -4px 0 20px;
  color: var(--text-muted);
  font-size: .84rem;
}

.verify-edit-items-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 12px;
}

.verify-edit-items-head h4 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 1rem;
}

.verify-edit-items {
  display: grid;
  gap: 10px;
}

.verify-edit-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) 70px minmax(110px, 1fr) minmax(100px, 1fr) 110px 36px;
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5ded5;
  border-radius: 6px;
  background: rgba(255, 255, 255, .75);
}

.verify-remove-item {
  width: 36px;
  height: 40px;
  color: var(--danger);
}

.verify-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.verify-side-panel {
  padding: 24px 22px;
}

.verify-side-card {
  background: linear-gradient(180deg, #fffdfb 0%, #fbf8f3 100%);
}

.verify-checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.8;
}

.verify-checklist li + li {
  margin-top: 4px;
}

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

  .verify-side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .verify-header {
    flex-direction: column;
    align-items: stretch;
  }

  .verify-header .btn {
    width: fit-content;
  }

  .verify-summary-grid,
  .verify-side-column {
    grid-template-columns: 1fr;
  }

  .verify-pass-top,
  .verify-section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .verify-action-form {
    justify-content: stretch;
  }

  .verify-action-form .btn {
    width: 100%;
    min-width: 0;
  }

  .verify-action-form,
  .verify-edit-actions {
    flex-direction: column;
  }

}

.pass-empty-state {
  max-width: 720px;
  margin: 0 auto;
}

.pass-navigation {
  max-width: 820px;
  margin: 0 auto 16px;
}

.pass-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 253, 250, 0.72);
  box-shadow: 0 4px 12px rgba(41, 39, 37, 0.05);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

.pass-back-link:hover,
.pass-back-link:focus-visible {
  border-color: var(--accent);
  background: #fffdfa;
  color: var(--accent);
  transform: translateX(-2px);
}

.pass-back-link:focus-visible {
  outline: 3px solid rgba(193, 95, 60, 0.2);
  outline-offset: 2px;
}

.pass-card {
  max-width: 820px;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffdfb 0%, #f9f6f2 100%);
  border: 1px solid #d9d2c8;
  border-radius: 22px;
  box-shadow: 0 26px 60px rgba(23, 29, 32, 0.08);
  overflow: hidden;
}

.pass-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 28px 22px;
  background: linear-gradient(135deg, rgba(193, 95, 60, 0.08), rgba(57, 116, 90, 0.06));
  border-bottom: 1px solid var(--border);
}

.pass-head h1 {
  margin: 8px 0 6px;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.pass-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pass-body {
  padding: 28px;
}

.pass-qr-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid #ddd3c7;
  background: linear-gradient(180deg, #f7f2ea 0%, #f3efe9 100%);
}

#passQr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #e3ddd4;
  border-radius: 16px;
  box-shadow: 0 14px 26px rgba(33, 46, 53, 0.08);
}

.pass-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
}

.pass-id {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(57, 116, 90, 0.09);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-pass-download {
  width: 100%;
  margin-top: 16px;
  border: 1px solid rgba(85, 140, 97, 0.32);
  background: linear-gradient(135deg, #f6faf7 0%, #eaf4ee 100%);
  color: var(--ok);
  font-weight: 800;
  border-radius: 12px;
  padding: 0.82rem 1rem;
  box-shadow: 0 10px 20px rgba(57, 116, 90, 0.08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.btn-pass-download:hover,
.btn-pass-download:focus-visible {
  background: linear-gradient(135deg, #edf8f1 0%, #dfeee4 100%);
  color: #2b5b46;
  border-color: rgba(57, 116, 90, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(57, 116, 90, 0.12);
}

.pass-details-wrap {
  background: linear-gradient(180deg, #fff 0%, #faf7f2 100%);
  border: 1px solid #e3ddd1;
  border-radius: 16px;
  padding: 20px;
}

.pass-detail-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px 18px;
}

.pass-detail-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.pass-detail-value {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.pass-info-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.pass-info-strip > div {
  background: #f7f3ee;
  border: 1px solid #e5ddd1;
  border-radius: 12px;
  padding: 14px 16px;
}

.pass-info-strip span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.pass-info-strip strong {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.pass-items {
  padding: 0 28px 28px;
}

.pass-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-top: 8px;
}

.pass-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pass-item-count {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(193, 95, 60, 0.09);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pass-items .table-responsive {
  border: 1px solid #e8e1d7;
  border-radius: 14px;
  overflow: hidden;
}

.pass-items .table-security thead th {
  background: #f4efe9;
  padding: 14px 16px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.pass-items .table-security td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee7df;
}

.pass-items .table-security tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 767px) {
  .pass-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .pass-body,
  .pass-items {
    padding-left: 18px;
    padding-right: 18px;
  }

  .pass-head {
    padding-left: 18px;
    padding-right: 18px;
  }

  .pass-section-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .pass-item-count {
    white-space: nowrap;
  }

  .pass-items .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .pass-items .table-security {
    min-width: 540px;
    width: 100%;
  }

  .pass-items .table-security thead th,
  .pass-items .table-security td {
    white-space: nowrap;
    font-size: 0.78rem;
    padding-left: 12px;
    padding-right: 12px;
  }

  .pass-detail-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pass-info-strip {
    grid-template-columns: 1fr;
  }
}

.dtr-filter-panel { margin-bottom: 18px; }
.dtr-filter-form { display: flex; align-items: flex-end; gap: 14px; }
.dtr-filter-form .employee-field { min-width: 190px; margin-bottom: 0; }
.dtr-filter-submit { min-height: 40px; }
.dtr-sheet { overflow: hidden; }
.dtr-sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.dtr-sheet-heading h3 { margin: 8px 0 4px; color: #172d32; font-size: 1.5rem; }
.dtr-sheet-heading p { margin: 0; color: var(--text-muted); font-size: .8rem; }
.dtr-live-clock { display: flex; align-items: flex-end; flex-direction: column; gap: 3px; color: #39745a; }
.dtr-live-clock strong { font-size: 1rem; }
.dtr-live-clock span { color: var(--text-muted); font-size: .72rem; }
.dtr-live-clock .btn { margin-top: 8px; }
.dtr-legend { display: flex; gap: 12px; color: var(--text-muted); font-size: .68rem; font-weight: 800; }
.dtr-in-key, .dtr-out-key { color: #39745a; }
.dtr-out-key { color: #a66527; }
.dtr-table-wrap { overflow-x: auto; border: 1px solid var(--border); }
.dtr-table { min-width: 1100px; border-collapse: collapse; color: var(--text); font-size: .68rem; }
.dtr-table th, .dtr-table td { min-width: 31px; padding: 7px 4px; border-right: 1px solid #e6e3db; border-bottom: 1px solid #e6e3db; text-align: center; white-space: nowrap; }
.dtr-table thead th { background: #eef3ee; color: #536461; font-size: .63rem; font-weight: 800; }
.dtr-table thead th small { display: block; margin-top: 3px; color: #8a9791; font-size: .55rem; font-weight: 600; }
.dtr-table .dtr-employee-heading { min-width: 170px; text-align: left; }
.dtr-table .dtr-employee-name { position: sticky; left: 0; z-index: 1; min-width: 170px; background: #fffdf8; text-align: left; }
.dtr-employee-name strong, .dtr-employee-name small { display: block; }
.dtr-employee-name small { margin-top: 3px; color: var(--text-muted); font-size: .6rem; font-weight: 500; }
.dtr-employee-name { border-left: 4px solid transparent; }
.dtr-employee-name small { color: inherit; font-weight: 800; }
.dtr-dept-0 { border-left-color: #39745a !important; color: #285d46; background: #edf6ef !important; }
.dtr-dept-1 { border-left-color: #4b78a8 !important; color: #315c88; background: #edf3fa !important; }
.dtr-dept-2 { border-left-color: #a66527 !important; color: #88531f; background: #fbf1e5 !important; }
.dtr-dept-3 { border-left-color: #8b5b96 !important; color: #704579; background: #f6eef8 !important; }
.dtr-dept-4 { border-left-color: #227c83 !important; color: #17666c; background: #eaf7f6 !important; }
.dtr-dept-5 { border-left-color: #b44b55 !important; color: #963d47; background: #fbeef0 !important; }
.dtr-dept-6 { border-left-color: #6b6d35 !important; color: #575a2b; background: #f5f5e8 !important; }
.dtr-dept-7 { border-left-color: #7563a8 !important; color: #5d4d8d; background: #f1effa !important; }
.dtr-table tbody tr:hover td, .dtr-table tbody tr:hover .dtr-employee-name { background: #faf5e9; }
.dtr-table [data-day].dtr-today { background: #fff0c7 !important; box-shadow: inset 0 2px 0 #d79535, inset 0 -2px 0 #d79535; }
.dtr-table thead [data-day].dtr-today { color: #88531f; }
.dtr-empty { padding: 30px !important; color: var(--text-muted); }

@media (max-width: 767px) {
  .dtr-live-clock { align-items: flex-start; }
  .dtr-filter-form { align-items: stretch; flex-direction: column; }
  .dtr-filter-form .employee-field { min-width: 0; }
  .dtr-filter-submit { width: 100%; }
  .dtr-sheet-heading { flex-direction: column; }
}

.employee-hero { padding-bottom: 24px; }
.employee-location-card {
  position: relative;
  display: block;
  min-height: 132px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.employee-location-card:hover,
.employee-location-card:focus-visible {
  color: var(--text);
  border-color: #b7cdbd;
  box-shadow: 0 8px 20px rgba(53, 45, 37, .08);
  transform: translateY(-2px);
}
.employee-location-card.is-selected { border-top: 3px solid var(--ok); padding-top: 15px; }
.employee-location-card strong { font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: -.04em; }
.employee-location-card > span:not(.metric-kicker) { color: var(--text-muted); }
.employee-location-card > span i { color: var(--ok); margin-right: 5px; }
.location-arrow { position: absolute; top: 19px; right: 20px; color: var(--text-muted); font-size: .95rem; }
.employee-form-panel .form-label { color: #536461; font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.employee-form-panel .form-control,
.employee-form-panel .form-select {
  border: 1px solid #d5d1ca;
  border-radius: 4px;
  background: #fffdf8;
  color: var(--text);
  font-size: .86rem;
  padding: 10px 12px;
}
.employee-form-panel .form-control:focus,
.employee-form-panel .form-select:focus { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(57, 116, 90, .12); }
.employee-directory-panel .table-security { min-width: 600px; }
.employee-directory-panel .table-responsive { margin: 0 -6px; }

@media (max-width: 575px) {
  .employee-location-card { min-height: 118px; }
  .employee-directory-panel .table-responsive { margin: 0; }
}

/* --------------------------------------------------------------------------
   Employee directory: standalone layout
   -------------------------------------------------------------------------- */
.employee-page { margin-top: 4px; }
.employee-alert { margin: 0 0 18px; padding: 12px 14px; border: 1px solid; border-radius: 4px; font-size: .82rem; }
.employee-alert-success { border-color: #c9ddd0; background: #eef5ef; color: #39745a; }
.employee-alert-error { border-color: #e3c5c1; background: #fbefed; color: #9d4d45; }
.employee-location-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.employee-location-card { width: 100%; }
.employee-workspace { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); align-items: start; gap: 14px; }
.employee-form-panel, .employee-directory-panel { min-width: 0; }
.employee-directory-panel:only-child { grid-column: 1 / -1; }
.employee-form-panel .panel-subtitle { margin-bottom: 24px; }
.employee-readonly-note { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid rgba(57, 116, 90, .2); border-radius: 4px; background: rgba(57, 116, 90, .06); color: #536461; font-size: .84rem; line-height: 1.5; }
.employee-readonly-note i { color: var(--ok); margin-top: 2px; }
.employee-field { display: block; margin-bottom: 18px; }
.employee-field > span { display: block; margin-bottom: 7px; color: #536461; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.employee-field input, .employee-field select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d5d1ca; border-radius: 4px; outline: 0; background: #fffdf8; color: var(--text); font: inherit; font-size: .84rem; }
.employee-field input:focus, .employee-field select:focus { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(57, 116, 90, .12); }
.employee-field select:disabled { color: #aaa39b; background: #f0ede8; }
.employee-form-actions { display: flex; align-items: center; gap: 10px; }
.employee-form-actions .employee-submit { flex: 1; margin-top: 0; }
.employee-submit { display: inline-flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 42px; margin-top: 4px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: #fffaf6; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 700; transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.employee-submit:hover, .employee-submit:focus-visible { border-color: #a94e30; background: #a94e30; transform: translateY(-1px); }
.employee-submit-secondary { width: auto; min-width: 120px; background: #fffdf8; border-color: #d5d1ca; color: var(--text); }
.employee-submit-secondary:hover, .employee-submit-secondary:focus-visible { background: #f2efe9; border-color: #bdb6ae; color: var(--text); }
.employee-action-link, .employee-action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 7px 10px; border-radius: 4px; font-size: .74rem; font-weight: 700; text-decoration: none; transition: all .15s ease; }
.employee-action-link { border: 1px solid rgba(57, 116, 90, .2); background: rgba(57, 116, 90, .06); color: var(--ok); }
.employee-action-link { cursor: pointer; font: inherit; }
.employee-action-link:hover, .employee-action-link:focus-visible { background: rgba(57, 116, 90, .12); }
.employee-action-button { border: 1px solid rgba(157, 77, 69, .22); background: rgba(157, 77, 69, .06); color: #9d4d45; cursor: pointer; }
.employee-action-button:hover, .employee-action-button:focus-visible { background: rgba(157, 77, 69, .12); }
.employee-action-form { display: inline-block; }
.employee-actions { display: flex; align-items: center; gap: 8px; }
.employee-actions-cell { white-space: nowrap; }
.employee-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, 1fr) auto;
  gap: 14px;
  margin: 0 0 20px;
  align-items: end;
}
.employee-filter-form .employee-field { margin-bottom: 0; }
.employee-filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}
.employee-filter-actions .employee-submit {
  width: auto;
  min-width: 180px;
  margin-top: 0;
}
.employee-reset-link {
  color: var(--ok);
  font-weight: 700;
  text-decoration: none;
}
.employee-reset-link:hover, .employee-reset-link:focus-visible { text-decoration: underline; }
.employee-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.employee-panel-heading .panel-subtitle { margin-bottom: 0; }
.employee-table-wrap { overflow-x: auto; }
.employee-table-wrap .table-security { width: 100%; min-width: 580px; border-collapse: collapse; }
.employee-table-wrap .table-security th { padding: 0 8px 12px; border-bottom: 1px solid var(--border); color: #8a827a; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.employee-table-wrap .table-security td { padding: 14px 8px; border-bottom: 1px solid #ebe7e2; color: var(--text); font-size: .84rem; }
.employee-table-wrap .table-security tbody tr:last-child td { border-bottom: 0; }
.employee-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 18px; }
.employee-page-link { min-width: 32px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--text-muted); font-size: .78rem; font-weight: 700; text-align: center; }
.employee-page-link:hover, .employee-page-link.is-current { border-color: var(--accent); background: var(--accent); color: #fff; }
.employee-empty { color: var(--text-muted) !important; text-align: center; }
.employee-modal[hidden] { display: none; }
.employee-modal { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(23, 45, 50, .68); }
.employee-modal-dialog { width: min(100%, 470px); padding: 26px; border: 1px solid var(--border); border-radius: 6px; background: #fffdf8; box-shadow: 0 24px 70px rgba(23, 45, 50, .22); }
.employee-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.employee-modal-header h3 { margin: 5px 0 0; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; }
.employee-modal-close { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.employee-modal-close:hover, .employee-modal-close:focus-visible { border-color: var(--accent); color: var(--accent); }
.employee-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.employee-modal-actions .employee-submit { width: auto; min-width: 130px; margin-top: 0; }
.employee-delete-copy { margin: -6px 0 0; color: var(--text-muted); font-size: .86rem; line-height: 1.55; }
.employee-delete-confirm { border-color: #9d4d45; background: #9d4d45; }
.employee-delete-confirm:hover, .employee-delete-confirm:focus-visible { border-color: #843d37; background: #843d37; }
body.employee-modal-open { overflow: hidden; }

@media (max-width: 760px) {
  .employee-location-stats, .employee-workspace { grid-template-columns: 1fr; }
  .employee-filter-form { grid-template-columns: 1fr; }
  .employee-filter-actions { width: 100%; }
  .employee-filter-actions .employee-submit { flex: 1; min-width: 0; }
}

@media (max-width: 991px) { .access-portal .auth-brand-pane { display: flex; min-height: 47vh; padding: 32px; }.access-portal .auth-brand-copy h1 { font-size: 3rem; }.portal-steps { margin-top: 28px; }.access-portal .auth-form-pane { padding: 42px 32px; }.ops-hero { align-items: flex-start; flex-direction: column; } }
@media (max-width: 575px) { .portal-steps { gap: 12px; }.portal-steps div { min-width: 0; }.portal-steps small { display: none; }.access-portal .auth-brand-copy h1 { font-size: 2.5rem; }.scan-panel, .queue-card, .activity-panel { padding: 20px; }.scan-badge { display: none; }.quick-actions { flex-direction: column; }.quick-actions .btn { width: 100%; }.app-content { padding: 20px 16px; } }

/* --------------------------------------------------------------------------
   Dashboard widgets
   -------------------------------------------------------------------------- */

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  height: 100%;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.stat-icon.tone-accent { background: rgba(232, 163, 61, 0.12); color: var(--accent); }
.stat-icon.tone-ok     { background: rgba(55, 196, 139, 0.12); color: var(--ok); }
.stat-icon.tone-danger { background: rgba(225, 92, 86, 0.12); color: var(--danger); }
.stat-icon.tone-info   { background: rgba(76, 141, 255, 0.12); color: var(--info); }

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat-card .stat-delta {
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
  display: inline-block;
}

.stat-delta.up { color: var(--ok); }
.stat-delta.down { color: var(--danger); }

.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.panel-card .panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.panel-card .panel-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 18px;
}

/* --------------------------------------------------------------------------
   Admin destination pages
   -------------------------------------------------------------------------- */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-heading h2 { margin: 7px 0 4px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.page-heading .eyebrow i { margin-right: 5px; }
.page-date { color: var(--text-muted); font-size: .76rem; white-space: nowrap; }
.page-stat-grid { margin-bottom: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-stat-grid .stat-card { min-height: 132px; }
.page-stat-grid .stat-kicker { display: block; margin-bottom: 15px; color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.page-stat-grid .stat-value { display: block; margin-bottom: 5px; }
.page-panel { min-height: 220px; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading-row .panel-subtitle { margin-bottom: 0; }
.icon-action { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); background: var(--panel); }
.icon-action:hover, .icon-action:focus-visible { color: var(--accent); border-color: var(--accent-soft); background: var(--panel-alt); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.admin-table th { padding: 11px 10px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.admin-table td { padding: 14px 10px; border-bottom: 1px solid #ebe7e1; vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { margin-top: 3px; color: var(--text-muted); font-size: .72rem; }
.admin-table td:last-child, .admin-table th:last-child { width: 48px; text-align: right; }
.status-badge { display: inline-block; padding: 4px 8px; border-radius: 20px; font-size: .67rem; font-weight: 800; }
.badge-ok { color: var(--ok); background: rgba(57, 116, 90, .11); }
.badge-warm { color: #9b6a20; background: rgba(193, 95, 60, .11); }
.badge-danger { color: var(--danger); background: rgba(185, 75, 66, .11); }
.empty-state { display: flex; min-height: 170px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: var(--text-muted); text-align: center; }
.empty-state i { margin-bottom: 5px; color: var(--accent-soft); font-size: 1.8rem; }
.empty-state strong { color: var(--text); font-size: .92rem; }
.empty-state span { font-size: .8rem; }
.text-action { margin-top: 8px; color: var(--accent); font-size: .78rem; font-weight: 700; }
.department-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.department-card { min-height: 180px; display: flex; align-items: flex-start; flex-direction: column; gap: 15px; }
.department-card h3 { margin: 0 0 5px; font-size: 1rem; }
.department-card p { margin: 0; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.department-card .icon-action { margin-top: auto; }
.department-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; font-size: 1.05rem; }
.department-icon.tone-accent { background: rgba(193, 95, 60, .11); color: var(--accent); }
.department-icon.tone-info { background: rgba(91, 111, 132, .12); color: var(--info); }
.department-icon.tone-ok { background: rgba(57, 116, 90, .12); color: var(--ok); }

@media (max-width: 767px) {
  .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-heading h2 { font-size: 1.45rem; }
  .page-date { display: none; }
  .page-stat-grid, .department-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .admin-table { min-width: 620px; }
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.online  { background: var(--ok); box-shadow: 0 0 0 3px rgba(55,196,139,0.15); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 3px rgba(225,92,86,0.15); }
.status-dot.warning { background: var(--accent); box-shadow: 0 0 0 3px rgba(232,163,61,0.15); }

.table-security {
  color: var(--text);
  margin-bottom: 0;
}

.table-security thead th {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.table-security td {
  border-color: var(--border);
  padding: 12px 8px;
  font-size: 0.9rem;
  vertical-align: middle;
}

.badge-severity-high { background: rgba(225,92,86,0.14); color: var(--danger); }
.badge-severity-med   { background: rgba(232,163,61,0.14); color: var(--accent); }
.badge-severity-low   { background: rgba(76,141,255,0.14); color: var(--info); }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.activity-time {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.camera-tile {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.camera-tile .cam-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 0.72rem;
  background: rgba(0,0,0,0.5);
  padding: 3px 8px;
  border-radius: 4px;
}

.camera-tile .cam-live {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--danger);
  background: rgba(0,0,0,0.5);
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------------------
   Admin workspace visual system
   -------------------------------------------------------------------------- */

.app-shell { background: var(--bg); }

.app-sidebar {
  width: 264px;
  background: #eeebe6;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  min-height: 76px;
  padding: 22px 24px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.sidebar-brand i { color: var(--accent); }

.sidebar-nav { padding: 24px 14px; gap: 4px; }

.sidebar-nav .nav-link,
.sidebar-footer .nav-link {
  min-height: 42px;
  padding: 10px 13px;
  color: #716b65;
  border-radius: 5px;
  font-size: 0.86rem;
  transition: background-color .15s ease, color .15s ease;
}

.sidebar-nav .nav-link:hover { background: #e5e1db; color: var(--text); }

.sidebar-nav .nav-link.active {
  background: #e2dcd5;
  color: var(--text);
  font-weight: 700;
}

.sidebar-nav .nav-link.active i:first-child { color: var(--accent); }

.sidebar-subnav {
  padding-left: 18px;
  border-left: 1px solid #d8d1c9;
  margin-left: 19px;
}

.sidebar-subnav .nav-link {
  min-height: 36px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 0.82rem;
}

.app-topbar {
  min-height: 76px;
  padding: 16px 36px;
  background: rgba(247, 245, 242, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-title {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.btn-icon { background: var(--panel); border-color: var(--border); color: var(--text); border-radius: 5px; }

.profile-menu-button { border-radius: 5px; }

.profile-menu-button:hover,
.profile-menu-button:focus-visible,
.profile-menu-button.show { background: var(--panel); border-color: var(--border); }

.user-avatar { background: var(--accent); border: 0; color: #fffaf6; }

.profile-menu {
  background: var(--panel);
  border-color: var(--border);
  border-radius: 6px;
  box-shadow: 0 14px 30px rgba(53, 45, 37, 0.12);
}

.app-content {
  max-width: 1480px;
  width: 100%;
  padding: 40px 42px 52px;
}

.app-content h2,
.app-content h3,
.app-content .panel-title {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.app-content h2 { color: var(--text); font-size: 1.6rem !important; font-weight: 600 !important; }
.app-content .text-muted, .panel-card .panel-subtitle { color: var(--text-muted) !important; }

.stat-card,
.panel-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(53, 45, 37, 0.025);
}

.stat-card { padding: 22px 22px 20px; }
.stat-card .stat-icon { width: 38px; height: 38px; border-radius: 5px; margin-bottom: 16px; }
.stat-icon.tone-accent { background: #f5e6df; color: var(--accent); }
.stat-icon.tone-ok { background: #e4eee8; color: var(--ok); }
.stat-icon.tone-danger { background: #f5e4e2; color: var(--danger); }
.stat-icon.tone-info { background: #e8edf1; color: var(--info); }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; }
.panel-card { padding: 25px 26px; }
.panel-card .panel-title { font-size: 1.18rem; font-weight: 600; }

.table-security thead th { color: #8a827a; border-bottom-color: var(--border); font-size: 0.68rem; letter-spacing: 0.08em; }
.table-security td { border-color: #ebe7e2; padding: 14px 8px; font-size: 0.86rem; }
.badge-severity-high { background: #f5e4e2; color: var(--danger); }
.badge-severity-med { background: #f5eadd; color: #9a6a2e; }
.badge-severity-low { background: #e5eee9; color: var(--ok); }

.app-content .btn { border-radius: 5px; font-size: 0.82rem; font-weight: 700; padding: 10px 15px; }
.app-content .btn-accent { width: auto; background: var(--accent); border-color: var(--accent); color: #fffaf6; }
.app-content .btn-accent:hover { background: #a94e30; border-color: #a94e30; }
.app-content .btn-outline-secondary { color: var(--text); border-color: #c9c2ba; }
.app-content .btn-outline-secondary:hover { background: #e9e4de; border-color: #b8afa6; color: var(--text); }

.app-footer { background: var(--bg); border-top-color: var(--border); color: var(--text-muted); }

@media (max-width: 1199px) {
  .btn-icon { display: inline-flex; }
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 12px 0 30px rgba(53, 45, 37, 0.12);
  }

  .app-sidebar.show-mobile { transform: translateX(0); }
  .app-topbar { padding: 16px 22px; }
  .app-content { padding: 30px 22px 42px; }
}

@media (max-width: 575px) {
  .app-content { padding: 24px 16px 34px; }
  .panel-card { padding: 20px 16px; }
}

/* --------------------------------------------------------------------------
   Admin command center
   -------------------------------------------------------------------------- */

.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.dashboard-intro h2 { margin: 7px 0 8px; font-size: clamp(1.8rem, 3vw, 2.55rem) !important; }
.intro-copy { margin: 0; color: var(--text-muted); font-size: .9rem; }
.eyebrow { margin: 0; }

.system-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid #d7e4da;
  border-radius: 4px;
  background: #f3f8f3;
  color: var(--ok);
  white-space: nowrap;
  font-size: .78rem;
}

.system-state .status-dot { margin-right: 1px; }
.system-state span:last-child { color: #78907f; border-left: 1px solid #d7e4da; padding-left: 8px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card { min-height: 176px; }
.stat-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.stat-card .stat-icon { margin: 0; }
.stat-kicker { color: #958c83; font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stat-card .stat-value { display: block; margin-bottom: 2px; }
.stat-card .stat-value small { color: #a59c93; font-family: var(--font-body); font-size: .95rem; font-weight: 500; letter-spacing: 0; }
.stat-card .stat-label { display: block; }
.stat-card .stat-delta { margin-top: 17px; font-size: .72rem; }
.stat-card-featured { border-top: 3px solid var(--accent); padding-top: 19px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .85fr);
  gap: 14px;
  align-items: stretch;
}

.activity-panel-admin, .device-panel { min-width: 0; }
.panel-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-heading-row .panel-subtitle { margin-bottom: 0; }
.panel-link { color: var(--accent); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.panel-link i { margin-left: 3px; }
.table-wrap { overflow-x: auto; }
.table-security { width: 100%; border-collapse: collapse; }
.table-security td:first-child { color: var(--text); font-weight: 600; }
.device-total { color: var(--ok); background: #e4eee8; border-radius: 3px; padding: 5px 8px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.device-row { padding: 14px 0; }
.device-row .activity-time { margin-top: 3px; }

.btn-icon {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d8d1c9;
  border-radius: 9px;
  background: #eeebe6;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(53, 45, 37, .06);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.btn-icon i { font-size: 1.2rem; line-height: 1; }

.btn-icon:hover,
.btn-icon:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf6;
  box-shadow: 0 5px 12px rgba(191, 91, 55, .2);
}

.btn-icon:active { transform: scale(.95); }

@media (max-width: 1199px) {
  .btn-icon { display: inline-flex; }
  .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
}

.profile-menu { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; }
.profile-menu.is-open { display: block; }
.topbar-user { position: relative; }
.profile-menu-heading { padding: 7px 10px 12px; color: var(--text-muted); font-size: .75rem; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.profile-signout { display: block; padding: 9px 10px; border-radius: 7px; font-size: .85rem; }
.profile-signout:hover { background: var(--panel-alt); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-intro { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .system-state { width: 100%; justify-content: space-between; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .app-content { padding-top: 28px; }
}

@media (max-width: 575px) {
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { min-height: auto; padding: 18px; }
  .stat-card .stat-delta { margin-top: 12px; }
  .system-state { align-items: flex-start; flex-wrap: wrap; }
  .system-state span:last-child { width: 100%; border-left: 0; padding-left: 15px; }
}

/* Shared responsive guardrails for phones and tablets. */
@media (max-width: 991px) {
  .access-portal {
    flex-direction: column;
  }

  .access-portal .auth-brand-pane,
  .access-portal .auth-form-pane {
    flex: 0 0 auto;
    width: 100%;
  }

  .access-portal .auth-brand-pane {
    min-height: auto;
    padding: 32px clamp(22px, 6vw, 64px) 30px;
  }

  .access-portal .auth-form-pane {
    min-height: 53vh;
    padding: 42px clamp(22px, 6vw, 64px) 48px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-content {
    min-width: 0;
    overflow-x: hidden;
  }
}

@media (max-width: 767px) {
  .access-portal .auth-brand-copy h1 {
    font-size: clamp(2.35rem, 10vw, 3.2rem);
  }

  .portal-steps {
    gap: 16px;
    justify-content: space-between;
  }

  .portal-steps div {
    flex: 1;
    min-width: 0;
  }

  .form-page-heading,
  .paper-form-header,
  .dashboard-intro {
    width: 100%;
  }

  .form-page-heading .btn,
  .paper-form-footer .btn {
    min-height: 42px;
  }

  .page-panel,
  .panel-card,
  .scan-panel,
  .queue-card,
  .activity-panel {
    min-width: 0;
  }

  .app-topbar {
    gap: 10px;
  }

  .topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 575px) {
  .access-portal .auth-brand-pane {
    padding: 24px 18px 26px;
  }

  .access-portal .auth-form-pane {
    min-height: auto;
    padding: 32px 18px 38px;
  }

  .auth-brand-mark {
    font-size: 1rem;
  }

  .auth-brand-copy h1 {
    letter-spacing: -0.045em;
  }

  .portal-steps strong {
    font-size: 0.8rem;
  }

  .access-portal .auth-form-card h2 {
    font-size: 1.85rem;
  }

  .role-picker {
    gap: 6px;
  }

  .role-picker label {
    min-height: 44px;
    padding: 9px 5px;
    font-size: 0.78rem;
  }

  .auth-form-card .form-control,
  .btn-accent {
    min-height: 44px;
  }

  .app-topbar {
    min-height: 64px;
    padding: 12px 16px;
  }

  .app-footer {
    padding: 14px 16px;
  }

  .profile-menu-button {
    padding-right: 0;
  }
}
