/*
 * Urban Shelter Limited — official brand palette (urbanshelter.com).
 * Roboto / Roboto Slab are loaded via Google Fonts in each HTML page,
 * with system fallbacks below so the app still renders offline.
 */

:root {
  color-scheme: light;
  --us-navy: #004274;
  --us-navy-deep: #002c4e;
  --us-blue: #09648a;
  --us-blue-bright: #0b98d3;
  --us-blue-light: #00aeff;
  --us-blue-action: #087aa8;
  --us-blue-soft: #e6f4fb;
  --us-red: #cc232a;
  --us-paper: #ffffff;
  --us-cream: #f7f9fc;
  --us-bg: #f4f7f9;
  --us-ink: #222222;
  --us-muted: #56646c;
  --us-faint: #626d73;
  --us-neutral: #a1a7a8;
  --us-line: #dce0e0;
  --us-line-strong: #c6cdd0;
  --success: #0d6f50;
  --success-soft: #e7f7f1;
  --warning: #87500b;
  --warning-soft: #fff4d8;
  --danger: #cc232a;
  --danger-soft: #fbeaeb;
  --shadow-sm: 0 8px 24px rgba(0, 66, 116, 0.06);
  --shadow-md: 0 18px 48px rgba(0, 66, 116, 0.09);
  --shadow-lg: 0 30px 80px rgba(0, 44, 78, 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --sidebar-width: 286px;
  --font: 'Roboto', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  --font-display: 'Roboto Slab', 'Roboto', ui-serif, Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--us-bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: var(--font);
  color: var(--us-ink);
  background: var(--us-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2 {
  font-family: var(--font-display);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
dialog {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button,
a {
  touch-action: manipulation;
}

svg {
  display: block;
}

::selection {
  color: #fff;
  background: var(--us-blue);
}

:focus-visible {
  outline: 3px solid var(--us-blue-action);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--us-navy);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 22px 22px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  background:
    radial-gradient(circle at 12% 0%, rgba(0, 174, 255, 0.15), transparent 26rem),
    radial-gradient(circle at 100% 92%, rgba(11, 152, 211, 0.2), transparent 22rem),
    linear-gradient(165deg, var(--us-navy) 0%, var(--us-navy-deep) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::before {
  position: absolute;
  right: -110px;
  bottom: -90px;
  width: 250px;
  height: 250px;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 40px rgba(255, 255, 255, 0.018),
    0 0 0 80px rgba(255, 255, 255, 0.014);
  pointer-events: none;
}

.sidebar-brand,
.sidebar nav,
.sidebar-footer {
  position: relative;
  z-index: 1;
}

.sidebar-brand img {
  display: block;
  width: 100%;
  max-width: 224px;
  height: auto;
  object-fit: contain;
}

.product-context {
  margin: 21px 4px 0;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.product-context span {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  color: #d3edfb;
  background: rgba(0, 174, 255, 0.12);
  border: 1px solid rgba(0, 174, 255, 0.2);
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.product-context p {
  margin: 10px 0 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.sidebar nav {
  display: grid;
  gap: 7px;
  margin-top: 38px;
}

.nav-label {
  margin: 0 12px 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-btn {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.nav-btn::after {
  position: absolute;
  top: 50%;
  right: 11px;
  width: 5px;
  height: 5px;
  content: '';
  background: transparent;
  border-radius: 50%;
  transform: translateY(-50%);
}

.nav-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn:first-of-type svg {
  fill: currentColor;
  stroke: none;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.nav-btn.active {
  color: #fff;
  background: linear-gradient(100deg, rgba(11, 152, 211, 0.32), rgba(0, 174, 255, 0.11));
  border-color: rgba(0, 174, 255, 0.18);
  box-shadow: inset 3px 0 0 var(--us-blue-light);
}

.nav-btn.active::after {
  background: var(--us-blue-light);
  box-shadow: 0 0 12px rgba(0, 174, 255, 0.8);
}

.sidebar-footer {
  margin-top: auto;
}

.dispatch-card {
  display: grid;
  gap: 11px;
  padding: 17px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dispatch-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  color: #d3edfb;
  background: rgba(0, 174, 255, 0.14);
  border: 1px solid rgba(0, 174, 255, 0.18);
  border-radius: 11px;
}

.dispatch-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dispatch-card h2 {
  margin: 0;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.dispatch-card p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  line-height: 1.55;
}

.dispatch-card .dispatch-result {
  margin: 0;
  color: #d3edfb;
}

.secure-status {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 15px 4px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.secure-status span {
  width: 6px;
  height: 6px;
  background: #6bd0a9;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(107, 208, 169, 0.7);
}

.content {
  width: 100%;
  max-width: 1640px;
  min-width: 0;
  margin: 0 auto;
  padding: 38px clamp(26px, 3vw, 52px) 56px;
}

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

.topbar-title {
  min-width: 0;
}

.title-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.eyebrow,
.section-kicker {
  margin: 0 0 7px;
  color: var(--us-blue);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  color: var(--us-navy);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.topbar-title > p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--us-muted);
  font-size: 0.79rem;
  line-height: 1.6;
}

.topbar-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-shrink: 0;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 11px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.primary-btn svg,
.ghost-btn svg,
.danger-btn svg,
.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--us-blue), var(--us-blue-action));
  border: 1px solid var(--us-blue);
  box-shadow: 0 10px 22px rgba(9, 100, 138, 0.18);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #075172, var(--us-blue));
  box-shadow: 0 13px 26px rgba(9, 100, 138, 0.24);
  transform: translateY(-1px);
}

.sidebar .primary-btn {
  background: #fff;
  color: var(--us-navy);
  border-color: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.sidebar .primary-btn:hover {
  background: var(--us-blue-soft);
}

.ghost-btn {
  color: var(--us-navy);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--us-line-strong);
}

.ghost-btn:hover {
  color: var(--us-blue);
  background: #fff;
  border-color: rgba(9, 100, 138, 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.danger-btn {
  color: var(--danger);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(204, 35, 42, 0.2);
}

.danger-btn:hover {
  background: var(--danger-soft);
  border-color: rgba(204, 35, 42, 0.28);
}

.icon-btn {
  width: 42px;
  padding: 0;
  color: var(--us-muted);
  background: #fff;
  border: 1px solid var(--us-line);
}

.icon-btn:hover {
  color: var(--us-blue);
  border-color: rgba(9, 100, 138, 0.25);
  box-shadow: var(--shadow-sm);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none !important;
}

.full-width {
  width: 100%;
}

.mobile-menu,
.sidebar-overlay {
  display: none;
}

.view {
  display: none;
  animation: view-in 0.3s ease both;
}

.view.active {
  display: block;
}

.filter-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 10px 13px 10px 15px;
  color: var(--us-navy);
  background: var(--us-blue-soft);
  border: 1px solid rgba(9, 100, 138, 0.14);
  border-radius: 12px;
}

.filter-context {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 600;
}

.filter-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--us-blue-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(11, 152, 211, 0.12);
}

.stat-card-button {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

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

.section-intro {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 19px;
}

.section-intro h2 {
  margin: 0;
  color: var(--us-ink);
  font-size: clamp(1.05rem, 1.5vw, 1.26rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.section-intro > p {
  max-width: 520px;
  margin: 0 0 1px;
  color: var(--us-muted);
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 128px;
  padding: 22px;
  overflow: hidden;
  background: var(--us-paper);
  border: 1px solid var(--us-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.stat-card::after {
  position: absolute;
  right: -44px;
  bottom: -52px;
  width: 130px;
  height: 130px;
  content: '';
  background: radial-gradient(circle, rgba(9, 100, 138, 0.07), transparent 67%);
  border: 1px solid rgba(9, 100, 138, 0.05);
  border-radius: 50%;
}

.stat-card:hover {
  border-color: rgba(9, 100, 138, 0.18);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-copy {
  position: relative;
  z-index: 1;
}

.stat-copy span {
  display: block;
  color: var(--us-muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.4;
}

.stat-copy strong {
  display: block;
  margin-top: 7px;
  color: var(--us-navy);
  font-size: clamp(1.65rem, 2.3vw, 2.12rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.stat-copy small {
  display: block;
  margin-top: 8px;
  color: var(--us-faint);
  font-size: 0.58rem;
  line-height: 1.4;
}

.stat-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--us-blue);
  background: var(--us-blue-soft);
  border: 1px solid rgba(9, 100, 138, 0.1);
  border-radius: 14px;
}

.stat-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card.warning-stat .stat-icon {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(168, 100, 15, 0.1);
}

.stat-card.danger-stat .stat-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(204, 35, 42, 0.1);
}

.skeleton {
  min-height: 128px;
}

.skeleton::before {
  position: absolute;
  inset: 22px;
  content: '';
  background:
    linear-gradient(var(--us-line), var(--us-line)) 0 4px / 48% 10px no-repeat,
    linear-gradient(var(--us-line), var(--us-line)) 0 32px / 26% 30px no-repeat;
  border-radius: 6px;
  animation: skeleton-pulse 1.25s ease-in-out infinite alternate;
}

@keyframes skeleton-pulse {
  to {
    opacity: 0.38;
  }
}

.panel {
  overflow: hidden;
  background: var(--us-paper);
  border: 1px solid var(--us-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
  padding: 20px 23px;
  background:
    linear-gradient(90deg, rgba(234, 243, 251, 0.4), transparent 32%),
    #fff;
  border-bottom: 1px solid var(--us-line);
}

.panel-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

label.table-filter {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  color: var(--us-muted);
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

.table-filter select {
  min-width: 220px;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.68rem;
}

.panel-heading {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
}

.panel-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--us-blue);
  background: var(--us-blue-soft);
  border: 1px solid rgba(9, 100, 138, 0.1);
  border-radius: 13px;
}

.panel-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-heading h2 {
  margin: 0;
  color: var(--us-navy);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin: 4px 0 0;
  color: var(--us-muted);
  font-size: 0.65rem;
  line-height: 1.45;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-color: rgba(9, 100, 138, 0.25) transparent;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(9, 100, 138, 0.2);
  border: 2px solid #fff;
  border-radius: 999px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 17px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--us-line);
}

th {
  color: var(--us-muted);
  background: #fbfcfe;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.075em;
  line-height: 1.35;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: #32373c;
  font-size: 0.75rem;
  line-height: 1.5;
}

tbody tr {
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: rgba(234, 243, 251, 0.34);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td strong,
.cell-primary {
  color: var(--us-ink);
  font-weight: 600;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--us-muted);
  font-size: 0.68rem;
}

.serial-cell {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  color: var(--us-blue);
  background: var(--us-blue-soft);
  border-radius: 9px;
  font-weight: 600;
}

.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  text-transform: capitalize;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
}

.badge::before {
  width: 5px;
  height: 5px;
  content: '';
  background: currentColor;
  border-radius: 50%;
}

.badge.active {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(19, 131, 95, 0.12);
}

.badge.cancelled {
  color: var(--us-muted);
  background: #f0f2f5;
  border-color: rgba(102, 114, 130, 0.1);
}

.badge.expired {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(204, 35, 42, 0.1);
}

.badge.warning {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(168, 100, 15, 0.1);
}

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
}

.row-actions .ghost-btn,
.row-actions .danger-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.61rem;
  border-radius: 9px;
}

.row-actions .row-icon-btn {
  width: 34px;
  min-height: 34px;
  padding: 7px;
  border-radius: 9px;
}

.row-actions .row-icon-btn svg {
  width: 16px;
  height: 16px;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 54px 28px;
  color: var(--us-muted);
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

.empty-state::before {
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: 13px;
  content: '';
  background:
    radial-gradient(circle at center, var(--us-blue-soft) 0 48%, transparent 50%),
    linear-gradient(135deg, transparent 48%, rgba(9, 100, 138, 0.2) 49% 51%, transparent 52%);
  border: 1px solid rgba(9, 100, 138, 0.12);
  border-radius: 13px;
}

.loading-state {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  color: var(--us-muted);
  font-size: 0.7rem;
}

.loading-state span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 100, 138, 0.16);
  border-top-color: var(--us-blue);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--us-ink);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

dialog[open] {
  animation: modal-in 0.22s ease both;
}

dialog::backdrop {
  background: rgba(0, 44, 78, 0.62);
  backdrop-filter: blur(5px);
  animation: fade-in 0.2s ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

#modal-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
}

.modal-header {
  display: flex;
  flex: 0 0 auto;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 8% 0%, rgba(0, 174, 255, 0.11), transparent 13rem),
    #fff;
  border-bottom: 1px solid var(--us-line);
}

.modal-header .eyebrow {
  margin-bottom: 5px;
}

.modal-header h2 {
  margin: 0;
  color: var(--us-navy);
  font-size: 1.14rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  overflow-y: auto;
  background: #fbfcfe;
}

.new-employee-fields:not([hidden]) {
  display: contents;
}

label {
  display: grid;
  gap: 7px;
  color: #32373c;
  font-size: 0.67rem;
  font-weight: 500;
}

.label-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.label-row small {
  color: var(--us-faint);
  font-size: 0.56rem;
  font-weight: 400;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--us-ink);
  background: #fff;
  border: 1px solid var(--us-line-strong);
  border-radius: 11px;
  outline: none;
  font-size: 0.72rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

input::placeholder {
  color: var(--us-muted);
}

input:hover,
select:hover {
  border-color: rgba(9, 100, 138, 0.3);
}

input:focus,
select:focus {
  background: #fff;
  border-color: var(--us-blue);
  box-shadow: 0 0 0 4px rgba(9, 100, 138, 0.09);
}

input[readonly] {
  color: var(--us-muted);
  background: #f1f4f8;
  border-style: dashed;
  cursor: default;
}

.modal-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  padding: 17px 24px;
  background: #fff;
  border-top: 1px solid var(--us-line);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 48px));
  padding: 13px 17px 13px 42px;
  color: #fff;
  background:
    radial-gradient(circle at 8% 50%, rgba(0, 174, 255, 0.18), transparent 8rem),
    var(--us-navy);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  box-shadow: 0 18px 46px rgba(0, 44, 78, 0.28);
  font-size: 0.7rem;
  line-height: 1.5;
  animation: toast-in 0.25s ease both;
}

.toast::before {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 8px;
  height: 8px;
  content: '';
  background: #6bd0a9;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(107, 208, 169, 0.7);
  transform: translateY(-50%);
}

.toast[data-tone='error']::before {
  background: #ff7a80;
  box-shadow: 0 0 10px rgba(255, 122, 128, 0.7);
}

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

/* Authentication */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(520px, 1.08fr) minmax(430px, 0.92fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(32px, 4vw, 62px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 9% 2%, rgba(0, 174, 255, 0.21), transparent 28rem),
    radial-gradient(circle at 94% 92%, rgba(11, 152, 211, 0.3), transparent 30rem),
    linear-gradient(145deg, var(--us-navy) 0%, var(--us-navy-deep) 100%);
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-panel::before {
  right: -180px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 140px rgba(255, 255, 255, 0.012);
}

.auth-brand-panel::after {
  top: 29%;
  left: -90px;
  width: 190px;
  height: 190px;
}

.auth-brand-top,
.auth-brand-copy,
.auth-brand-footer {
  position: relative;
  z-index: 1;
}

.auth-brand-top {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.auth-brand-top img {
  width: min(300px, 68%);
  height: auto;
}

.auth-brand-top span {
  padding: 7px 11px;
  color: #d3edfb;
  border: 1px solid rgba(0, 174, 255, 0.25);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-brand-copy {
  width: min(680px, 100%);
  margin: auto 0;
  padding: 50px 0;
}

.auth-visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin-bottom: 34px;
}

.auth-shield {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  color: #fff;
  background: linear-gradient(145deg, rgba(0, 174, 255, 0.3), rgba(9, 100, 138, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transform: rotate(-4deg);
}

.auth-shield svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(4deg);
}

.auth-orbit {
  position: absolute;
  border: 1px solid rgba(0, 174, 255, 0.23);
  border-radius: 50%;
}

.orbit-one {
  inset: 5px;
  animation: orbit 12s linear infinite;
}

.orbit-one::before {
  position: absolute;
  top: 14px;
  right: 17px;
  width: 7px;
  height: 7px;
  content: '';
  background: var(--us-blue-light);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(0, 174, 255, 0.8);
}

.orbit-two {
  inset: 20px;
  border-style: dashed;
  opacity: 0.52;
  animation: orbit 18s linear infinite reverse;
}

@keyframes orbit {
  to {
    transform: rotate(360deg);
  }
}

.auth-kicker {
  margin: 0 0 14px;
  color: #a6ddf8;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.auth-brand-copy h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.45rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.auth-brand-copy > p:not(.auth-kicker) {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  line-height: 1.8;
}

.auth-feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.auth-feature-row span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 11px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-size: 0.61rem;
}

.auth-feature-row span::before {
  width: 5px;
  height: 5px;
  content: '';
  background: var(--us-blue-light);
  border-radius: 50%;
}

.auth-brand-footer {
  margin: 0;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-form-panel {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 100%;
  padding: clamp(28px, 5vw, 76px);
  background:
    radial-gradient(circle at 100% 0%, rgba(9, 100, 138, 0.075), transparent 25rem),
    linear-gradient(180deg, #fff, #fbfcfe);
}

.auth-form-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  content: '';
  background: linear-gradient(180deg, var(--us-blue), transparent 42%, var(--us-red));
  opacity: 0.75;
}

.auth-card {
  display: grid;
  gap: 19px;
  width: min(430px, 100%);
}

.auth-form-heading {
  margin-bottom: 10px;
}

.auth-form-logo {
  display: block;
  width: min(238px, 72%);
  height: auto;
  margin-bottom: 26px;
}

.auth-form-heading h2 {
  margin: 0;
  color: var(--us-navy);
  font-size: clamp(1.65rem, 2.5vw, 2.08rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.auth-form-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--us-muted);
  font-size: 0.72rem;
  line-height: 1.7;
}

.input-shell {
  position: relative;
  display: block;
}

.input-shell > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--us-faint);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transform: translateY(-50%);
}

.input-shell input {
  min-height: 52px;
  padding-left: 43px;
  background: #fff;
  border-color: rgba(0, 66, 116, 0.16);
  border-radius: 13px;
  font-size: 0.75rem;
}

.input-shell:focus-within > svg {
  color: var(--us-blue);
}

.auth-submit {
  justify-content: space-between;
  min-height: 52px;
  margin-top: 2px;
  padding: 12px 17px;
  border-radius: 13px;
}

.auth-error {
  margin: -5px 0 0;
  padding: 11px 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(204, 35, 42, 0.12);
  border-radius: 10px;
  font-size: 0.66rem;
  line-height: 1.5;
}

.auth-assurance {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
  padding-top: 18px;
  color: var(--us-faint);
  border-top: 1px solid var(--us-line);
  font-size: 0.61rem;
  line-height: 1.55;
}

.auth-assurance svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--success);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-copyright {
  position: absolute;
  bottom: 28px;
  margin: 0;
  color: var(--us-faint);
  font-size: 0.58rem;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 254px;
  }

  .sidebar {
    padding-inline: 18px;
  }

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

  .auth-shell {
    grid-template-columns: minmax(430px, 1fr) minmax(390px, 0.85fr);
  }

  .auth-brand-panel {
    padding: 38px;
  }
}

@media (max-width: 900px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: min(286px, calc(100vw - 56px));
    box-shadow: 22px 0 60px rgba(0, 44, 78, 0.28);
    transform: translateX(-105%);
    visibility: hidden;
    transition:
      transform 0.26s ease,
      visibility 0.26s ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    visibility: hidden;
    background: rgba(0, 44, 78, 0.52);
    border: 0;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  body.nav-open .sidebar-overlay {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .content {
    padding-top: 26px;
  }

  .auth-shell {
    display: block;
  }

  .auth-brand-panel {
    min-height: auto;
    padding: 30px;
  }

  .auth-brand-top img {
    width: min(260px, 65%);
  }

  .auth-brand-copy {
    padding: 66px 0 42px;
  }

  .auth-visual {
    display: none;
  }

  .auth-brand-copy h1 {
    max-width: 620px;
    font-size: clamp(2rem, 7vw, 3rem);
  }

  .auth-brand-footer {
    display: none;
  }

  .auth-form-panel {
    min-height: auto;
    padding-block: 56px 82px;
  }

  .auth-copyright {
    bottom: 28px;
  }
}

@media (max-width: 640px) {
  .content {
    padding: 22px 16px 38px;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 30px;
  }

  .topbar-title > p:last-child {
    display: none;
  }

  .topbar-actions {
    gap: 7px;
  }

  .topbar-actions .ghost-btn {
    width: 42px;
    padding: 0;
  }

  .topbar-actions .ghost-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.55rem;
  }

  .topbar h1 {
    font-size: 1.35rem;
  }

  .section-intro {
    display: block;
  }

  .section-intro > p {
    margin-top: 8px;
    text-align: left;
  }

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

  .stat-card {
    min-height: 112px;
  }

  .panel-header {
    align-items: flex-start;
    min-height: auto;
    padding: 18px;
  }

  .panel-header > .panel-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .panel-header > .primary-btn {
    width: 42px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .panel-header > .primary-btn svg {
    position: absolute;
    color: #fff;
  }

  .panel-icon {
    width: 38px;
    height: 38px;
  }

  .panel-heading p {
    max-width: 220px;
  }

  th,
  td {
    padding: 13px 14px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .modal-header {
    padding: 19px 20px;
  }

  .modal-actions {
    padding: 15px 20px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }

  .auth-brand-panel {
    padding: 24px 20px 28px;
  }

  .auth-brand-top img {
    width: min(220px, 68%);
  }

  .auth-brand-top span {
    padding: 6px 8px;
    font-size: 0.54rem;
  }

  .auth-brand-copy {
    padding: 56px 0 12px;
  }

  .auth-brand-copy > p:not(.auth-kicker) {
    margin-top: 16px;
  }

  .auth-feature-row {
    display: none;
  }

  .auth-form-panel {
    justify-items: stretch;
    padding: 42px 20px 72px;
  }

  .auth-card {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
