:root {
  /* Colors */
  --bg-body: #f3f4f6; /* light grey asphalt */
  --bg-surface: #ffffff;
  --bg-sidebar: #0b0f19; /* very dark blue-grey */
  --bg-sidebar-hover: #1a2235;
  
  --text-main: #111827;
  --text-muted: #6b7280;
  --text-inverse: #f9fafb;
  --text-inverse-muted: #9ca3af;
  
  --brand-primary: #e65100; /* Safety Amber */
  --brand-primary-hover: #ef6c00;
  --brand-primary-active: #ff9800;
  
  --border-color: #e5e7eb;
  --border-sidebar: #1f2937;
  
  --status-active: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-placeholder: #6366f1;
  
  /* Typography */
  --font-display: "Avenir Next", "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 3px solid rgba(230, 81, 0, 0.45);
  outline-offset: 2px;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app-layout {
    flex-direction: row;
  }
}

/* Mobile Header */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--bg-sidebar);
  color: var(--text-inverse);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) {
  .mobile-header { display: none; }
}

/* Sidebar Drawer */
.sidebar-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background-color: var(--bg-sidebar);
  z-index: 50;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.sidebar-drawer.is-open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .sidebar-drawer {
    position: sticky;
    top: 0;
    transform: none;
    width: 260px;
    height: 100dvh;
    border-right: 1px solid var(--border-sidebar);
  }
}

/* Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .sidebar-overlay { display: none; }
}

/* Sidebar Styling */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 1rem;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-inverse);
  letter-spacing: -0.02em;
}
.sidebar-brand .brand-mark {
  width: 28px;
  height: 28px;
  background-color: var(--brand-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-inverse-muted);
  padding: 1.5rem 1rem 0.5rem 1rem;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-inverse-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-inverse);
}
.nav-item.is-active {
  background-color: rgba(230, 81, 0, 0.15);
  color: var(--brand-primary);
}
.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}
.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-sidebar-hover);
  color: var(--text-inverse-muted);
  font-weight: 700;
}
.nav-item.is-placeholder .nav-badge {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-sidebar);
}

/* Main Content */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.content-wrapper {
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}
@media (min-width: 768px) {
  .content-wrapper { padding: 2.5rem; }
}

/* Page Headers */
.page-header {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.page-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}

/* Forms & Buttons */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.form-control,
.form-input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  outline: none;
  font-family: var(--font-body);
}
.form-control:focus,
.form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.15);
  background-color: #fff;
}
.form-control:hover,
.form-input:hover {
  border-color: #d1d5db;
}
.form-control::placeholder,
.form-input::placeholder { color: var(--text-inverse-muted); }
.form-control:disabled,
.form-input:disabled,
.form-control[readonly],
.form-input[readonly] {
  background-color: #f8fafc;
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.85;
}
.form-control.is-invalid,
.form-input.is-invalid {
  border-color: var(--status-error);
  background-color: #fffafa;
}
.form-control.is-invalid:focus,
.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Make select inputs style correctly */
select.form-control,
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1.2rem;
  padding-right: 2.5rem;
}
.form-control-file {
  cursor: pointer;
  padding: 0.45rem 0.65rem;
}
.form-control-file::file-selector-button {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin-right: 0.75rem;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
}
.form-control-file::file-selector-button:hover {
  background: var(--bg-surface);
  border-color: #cbd5e1;
}
.form-check-input {
  accent-color: var(--brand-primary);
  height: 1.15rem;
  margin-right: 0.45rem;
  vertical-align: -0.2rem;
  width: 1.15rem;
}
.form-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  min-height: 46px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: var(--font-display);
  outline: none;
}
.btn-sm {
  padding: 0.5rem 0.85rem;
  min-height: 40px;
  font-size: 0.85rem;
}
.btn:focus-visible { box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.3); }
.btn:active {
  transform: scale(0.97);
}
.btn-primary {
  background-color: var(--brand-primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  background-color: var(--brand-primary-active);
  transform: translateY(0);
}
.btn-secondary {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--bg-body);
  border-color: #d1d5db;
}
.btn-operational {
  background-color: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}
.btn-operational:hover {
  background-color: #ffedd5;
  border-color: #fb923c;
}
.btn-danger {
  background-color: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}
.btn-danger:active {
  background-color: #b91c1c;
  transform: translateY(0);
}
.btn-danger-outline {
  background-color: #fff;
  border: 1px solid #fca5a5;
  color: #b91c1c;
}
.btn-danger-outline:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
}
.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}
.btn-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-block;
}
.btn-link:hover { text-decoration: underline; }

.form-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
.search-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  position: sticky;
  bottom: 0;
  padding-bottom: 1.5rem;
  z-index: 10;
}
@media (max-width: 639px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn {
    width: 100%;
  }
}

.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.form-card > .form-group:last-of-type {
  margin-bottom: 0;
}

/* Cards */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-display);
}
.card-body { padding: 1.5rem; }

/* Grid Layouts */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-label svg {
  width: 16px; height: 16px;
  color: var(--brand-primary);
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .dashboard-grid { grid-template-columns: 2fr 1fr; }
}

/* Card Lists */
.card-list {
  display: flex;
  flex-direction: column;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background-color: var(--bg-body); }
.item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bg-error-light { background-color: rgba(239, 68, 68, 0.1); color: var(--status-error); }
.bg-warning-light { background-color: rgba(245, 158, 11, 0.1); color: var(--status-warning); }

.item-content { flex: 1; min-width: 0; }
.item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-body);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-active { background-color: rgba(16, 185, 129, 0.1); color: var(--status-active); }
.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--status-warning); }
.badge-neutral { background-color: #eef2f7; color: #475569; }
.badge-placeholder { background-color: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.35rem;
}

.eyebrow {
  color: var(--brand-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.readiness-panel {
  align-items: flex-start;
  background: linear-gradient(135deg, #111827, #1d2940);
  border-radius: var(--radius-lg);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  overflow: hidden;
  padding: 1.5rem;
  position: relative;
}

.readiness-panel::after {
  background: var(--brand-primary);
  border-radius: 50%;
  content: "";
  filter: blur(10px);
  height: 10rem;
  opacity: 0.12;
  position: absolute;
  right: -4rem;
  top: -5rem;
  width: 10rem;
}

.readiness-panel h2 {
  font-size: clamp(1.35rem, 5vw, 2rem);
  margin-bottom: 0.55rem;
}

.readiness-panel p {
  color: #cbd5e1;
  max-width: 44rem;
}

.readiness-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.readiness-list span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-size: 1.25rem;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.module-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-between;
  min-height: 13rem;
  padding: 1.25rem;
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.module-card::before {
  background: var(--module-accent, var(--brand-primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  content: "";
  height: 3px;
  left: -1px;
  position: absolute;
  right: -1px;
  top: -1px;
}

.module-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.module-card--blue { --module-accent: #2563eb; }
.module-card--teal { --module-accent: #0d9488; }
.module-card--violet { --module-accent: #7c3aed; }
.module-card--amber { --module-accent: #d97706; }
.module-card--red { --module-accent: #dc2626; }
.module-card--green { --module-accent: #059669; }
.module-card--cyan { --module-accent: #0891b2; }
.module-card--slate { --module-accent: #64748b; }

.module-card__top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.module-index {
  color: var(--module-accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
}

.module-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.45rem;
}

.module-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.module-link {
  color: var(--module-accent);
  font-size: 0.84rem;
  font-weight: 700;
}

.scope-note {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-lg);
  color: #7c2d12;
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
}

.scope-note p {
  font-size: 0.84rem;
  margin-top: 0.25rem;
}

@media (min-width: 640px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .readiness-panel {
    align-items: center;
    flex-direction: row;
    padding: 2rem;
  }
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

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

.data-table th, .data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-body);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-body);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width: 767px) {
  .table-wrapper {
    background: transparent;
    border: none;
    margin-bottom: 0;
  }
  
  .data-table {
    display: block;
  }
  
  .data-table thead {
    display: none;
  }
  
  .data-table tbody, .data-table tr {
    display: block;
  }
  
  .data-table tr {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    padding: 0.5rem;
  }
  
  .data-table tr:hover {
    background-color: var(--bg-surface);
  }
  
  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--bg-body);
    padding: 0.75rem 1rem;
  }
  
  .data-table td:last-child {
    border-bottom: none;
  }
  
  .data-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-right: 1rem;
    flex-shrink: 0;
  }
  
  .data-table td.actions-cell {
    justify-content: flex-end;
    gap: 0.5rem;
  }
  
  .data-table td.actions-cell::before {
    display: none;
  }
}

/* Detail Views */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

.detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  margin-top: 1.5rem;
}
.detail-grid .detail-card {
  margin-top: 0;
}

.detail-card h3 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.detail-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.detail-card-header h3 {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.danger-zone {
  border-color: #fca5a5;
  background-color: #fef2f2;
}
.danger-zone h3 {
  color: #ef4444;
  border-color: #fecaca;
}

.upload-form {
  margin-top: 1rem;
  background: var(--bg-body);
  padding: 1rem;
  border-radius: var(--radius-md);
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.detail-list dt {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.detail-list dd {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.9rem;
}
.media-card {
  gap: 1.5rem;
}
.media-card-header h3,
.media-section-heading h4,
.passport-panel h4,
.media-upload-heading h4 {
  margin: 0;
}
.passport-panel,
.passport-current-status {
  align-items: center;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}
.passport-panel h4,
.media-section-heading h4,
.media-upload-heading h4 {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 650;
}
.passport-panel .form-hint,
.media-section-heading .form-hint,
.media-upload-heading .form-hint,
.passport-current-status .form-hint {
  margin: 0.3rem 0 0;
}
.media-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.photos-panel {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}
.media-section-heading {
  margin-bottom: 0.9rem;
}
.photo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 0;
  overflow: hidden;
}
.photo-thumbnail-link {
  aspect-ratio: 4 / 3;
  background: var(--bg-body);
  display: block;
}
.photo-thumbnail-link:focus-visible {
  box-shadow: inset 0 0 0 3px var(--brand-primary);
  outline: none;
}
.photo-thumbnail {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}
.photo-card-body {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.7rem;
}
.photo-caption {
  color: var(--text-main);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}
.media-upload-form {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 1.25rem;
  padding: 1rem;
}
.media-upload-heading {
  margin-bottom: 1rem;
}
.confirmation-card {
  max-width: 640px;
}
.confirmation-photo {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 1.25rem 0 0;
  overflow: hidden;
}
.confirmation-photo img {
  display: block;
  max-height: 360px;
  object-fit: contain;
  width: 100%;
}
.confirmation-photo figcaption {
  color: var(--text-muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
  padding: 0.65rem 0.8rem;
}
@media (max-width: 639px) {
  .passport-panel,
  .passport-current-status {
    align-items: flex-start;
    flex-direction: column;
  }
  .media-actions {
    width: 100%;
  }
  .media-actions .btn {
    flex: 1 1 auto;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .media-upload-form {
    padding: 0.85rem;
  }
}

.actions-cell {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.actions-cell form {
  margin: 0;
}

/* Empty States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.75rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed #d1d5db;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
}
.empty-state > * {
  position: relative;
  z-index: 2;
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
  color: var(--text-inverse-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.empty-icon--blue { color: #2563eb; background: #eff6ff; }
.empty-icon--teal { color: #0d9488; background: #f0fdfa; }
.empty-icon--violet { color: #7c3aed; background: #f5f3ff; }
.empty-icon--amber { color: #d97706; background: #fffbeb; }
.empty-icon--red { color: #dc2626; background: #fef2f2; }
.empty-icon--green { color: #059669; background: #ecfdf5; }
.empty-icon--cyan { color: #0891b2; background: #ecfeff; }
.empty-icon--slate { color: #475569; background: #f1f5f9; }
.empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.empty-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--status-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.form-error {
  font-size: 0.8rem;
  color: var(--status-error);
  margin-top: 0.25rem;
  line-height: 1.4;
}

@media (max-width: 639px) {
  .content-wrapper {
    padding: 1rem;
  }
  .form-card,
  .detail-card {
    padding: 1rem;
  }
  .form-actions {
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .search-bar .form-control,
  .search-bar .form-input {
    flex: 1 1 100%;
    max-width: none !important;
  }
  .detail-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
  }
  .detail-list dd {
    overflow-wrap: anywhere;
    text-align: left;
  }
  .data-table td {
    align-items: flex-start;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .actions-cell .btn {
    flex: 1 1 auto;
  }
}

/* Login Page */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-sidebar);
  padding: 1.5rem;
  background-image: radial-gradient(circle at top right, #1a2235, #0b0f19);
}
.login-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.login-header {
  padding: 2.5rem 2rem 1rem 2rem;
  text-align: center;
}
.login-header .brand-mark {
  width: 48px;
  height: 48px;
  background-color: var(--brand-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto 1.5rem auto;
}
.login-header h1 {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.login-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.login-body { padding: 1rem 2rem 2.5rem 2rem; }

/* Utility Classes */
.mt-4 { margin-top: 1rem; }
.mobile-only { display: block; }
@media (min-width: 768px) {
  .md\:mt-0 { margin-top: 0; }
  .mobile-only { display: none; }
}

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