@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
  /* Brand & Core Palette */
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #38bdf8;
  --primary-soft: #f0f9ff;
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  --primary-gradient-hover: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  --primary-glow: rgba(2, 132, 199, 0.22);

  /* Surface & Background */
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --panel: #ffffff;
  --panel-elevated: #ffffff;
  --panel-glass: rgba(255, 255, 255, 0.88);

  /* Typography */
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;

  /* Borders & Dividers */
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --line-strong: #cbd5e1;

  /* Feedback Colors */
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --success: #10b981;
  --success-dark: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecdd3;
  --info: #3b82f6;
  --info-soft: #eff6ff;

  /* Geometry & Shadows */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.09), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 10px 25px -3px rgba(2, 132, 199, 0.25);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(37, 99, 235, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Plus Jakarta Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-normal);
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sticky Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: var(--panel-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  transition: all var(--transition-normal);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--text);
  position: relative;
}

.brand::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-gradient);
  box-shadow: 0 2px 8px var(--primary-glow);
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.92;
}

.nav,
.admin-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a,
.admin-nav a,
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  background: transparent;
  border: 1px solid transparent;
}

.nav a:hover,
.admin-nav a:hover,
.link-button:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: rgba(2, 132, 199, 0.15);
}

.notification-link {
  position: relative;
}

.notification-count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--warning);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
  animation: pulseBadge 2.5s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.link-button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* Page Layout Container */
.page {
  width: min(1200px, calc(100% - 40px));
  margin: 32px auto 64px;
  animation: fadeIn 0.3s ease-out;
}

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

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 32px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.4);
}

.footer a {
  transition: color var(--transition-normal);
  position: relative;
}

.footer a:hover {
  color: var(--primary);
}

/* Grids & Layouts */
.hero-band,
.auth-layout,
.detail-layout,
.split-layout,
.stacked-layout,
.install-layout,
.landing-hero,
.landing-strip {
  display: grid;
  gap: 28px;
  align-items: start;
}

.hero-band {
  grid-template-columns: 1fr;
  margin-bottom: 28px;
  align-items: center;
}

.equipment-list-title {
  text-align: left;
  letter-spacing: -0.025em;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 4px;
}

.auth-layout,
.detail-layout,
.split-layout,
.stacked-layout,
.install-layout,
.landing-hero,
.landing-strip {
  grid-template-columns: minmax(0, 1fr);
}

.install-layout {
  max-width: 860px;
  margin: 0 auto;
}

.install-copy {
  text-align: center;
  margin-bottom: 12px;
}

.install-form fieldset {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
}

.install-form legend {
  padding: 0 10px;
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 0.95rem;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

/* Landing Page Hero & Cards */
.landing-hero {
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-items: center;
  gap: clamp(24px, 5vw, 44px);
  padding: clamp(36px, 6vw, 68px) clamp(24px, 5vw, 56px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.88), transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(37, 99, 235, 0.78), transparent 45%),
    linear-gradient(135deg, #0b192c 0%, #1e293b 100%);
  color: #fff;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.landing-copy {
  max-width: 700px;
  text-align: center;
}

.landing-copy h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  max-width: 640px;
  margin: 0 auto;
  color: rgba(241, 245, 249, 0.92);
  font-size: 1.08rem;
  line-height: 1.65;
}

.login-card {
  width: 100%;
  max-width: 440px;
  justify-self: center;
  padding: 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform var(--transition-normal);
}

.login-card:hover {
  transform: translateY(-2px);
}

.login-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.landing-strip {
  grid-template-columns: 1fr;
  margin-top: 28px;
  gap: 20px;
}

.landing-strip div {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.landing-strip div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0.8;
}

.landing-strip div:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.landing-strip strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.landing-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h1 {
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

/* Notification Items */
.notification-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.notification-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
  max-width: 320px;
}

.notification-help {
  margin: 0;
  text-align: right;
  font-size: 0.85rem;
}

.notification-item {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
  text-decoration: none;
}

.notification-item:hover {
  transform: translateX(3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.notification-item.unread {
  border-color: rgba(2, 132, 199, 0.45);
  background: var(--primary-soft);
  position: relative;
}

.notification-item.unread::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.notification-item strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.notification-item span {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.notification-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Panels, Cards & Surfaces */
.panel,
.equipment-card,
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.panel {
  padding: 26px clamp(18px, 3vw, 32px);
  background: #ffffff;
}

[hidden] {
  display: none !important;
}

.narrow {
  max-width: 740px;
  margin-inline: auto;
}

h1, h2, h3 {
  margin: 0 0 14px;
  line-height: 1.25;
  color: var(--text);
  font-weight: 800;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.panel h1,
.panel h2 {
  margin-bottom: 16px;
}

.equipment-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  line-height: 1.35;
}

.eyebrow {
  display: inline-block;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.muted,
.empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  font-weight: 600;
}

.meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Filters & Forms */
.filter-bar,
.form-stack {
  display: grid;
  gap: 16px;
}

.filter-bar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  align-items: center;
}

.filter-bar.compact {
  grid-template-columns: minmax(180px, 320px) auto;
  align-items: end;
  margin-bottom: 20px;
}

.filter-bar label:not(.check-row) {
  color: var(--muted);
  font-size: 0.88rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}

.panel-head p {
  margin: 4px 0 0;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text);
  background: #ffffff;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

input[type="file"] {
  padding: 10px;
  background: var(--bg-subtle);
  border-style: dashed;
  cursor: pointer;
}

.file-actions {
  display: grid;
  gap: 12px;
}

/* Camera Modal */
.camera-modal[hidden] {
  display: none;
}

.camera-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
}

.camera-dialog {
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.camera-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-button:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--line-strong);
}

.camera-dialog video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: #0f172a;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.camera-status {
  min-height: 24px;
  margin: 12px 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  border-radius: var(--radius-xs);
  accent-color: var(--primary);
}

/* Modern Buttons */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  background: #ffffff;
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
  user-select: none;
}

.button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--bg-subtle);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button.primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-sm), 0 2px 8px var(--primary-glow);
}

.button.primary:hover:not(:disabled) {
  background: var(--primary-gradient-hover);
  color: #ffffff;
  box-shadow: var(--shadow-md), 0 4px 12px var(--primary-glow);
}

.button.danger {
  border-color: var(--danger-border);
  color: var(--danger);
  background: #ffffff;
}

.button.danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger-dark);
}

.button.small {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 0.84rem;
  border-radius: var(--radius-xs);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Equipment Grid & Cards */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.equipment-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.equipment-card:hover {
  border-color: rgba(2, 132, 199, 0.4);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(2, 132, 199, 0.2);
  transform: translateY(-4px);
}

.equipment-card a {
  display: grid;
  grid-template-rows: 190px 1fr;
  min-height: 100%;
}

.equipment-card img {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.equipment-card:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.card-body p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 6px 0 14px;
  flex-grow: 1;
}

.availability {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  background: var(--success-soft);
  color: var(--success-dark);
  border: 1px solid var(--success-border);
  font-weight: 800;
  font-size: 0.88rem;
  margin-right: 6px;
}

.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 190px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
}

.image-placeholder::after {
  content: "📦";
  font-size: 2.2rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 6px;
}

.image-placeholder.large {
  min-height: 380px;
}

.image-placeholder.large::after {
  font-size: 3.5rem;
}

.detail-media {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #f1f5f9;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  min-height: 380px;
}

.current-photo {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.current-photo img {
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* Dashboard Metrics & Stats */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 20px 0 28px;
}

.stat {
  padding: 22px;
  color: inherit;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

.stat:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat span {
  display: block;
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.stat.action-stat span {
  font-size: 1.3rem;
  color: var(--primary);
}

.stat p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

.stat small {
  display: block;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Detail List */
.detail-list {
  display: grid;
  gap: 12px;
  margin: 0 0 24px;
}

.detail-list div {
  display: grid;
  grid-template-columns: minmax(140px, 0.4fr) 1fr;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}

.detail-list dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

/* Admin Tabs */
.admin-nav {
  margin-bottom: 24px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  display: inline-flex;
  gap: 4px;
  box-shadow: var(--shadow-xs);
}

.admin-nav a {
  padding: 7px 16px;
  font-size: 0.88rem;
}

/* Modern Data Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

td {
  border-bottom: 1px solid var(--line-light);
  font-size: 0.92rem;
}

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

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: #f8fafc;
}

td strong + small {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
}

.table-thumb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.table-thumb.missing {
  padding: 6px;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 4px 11px;
  font-weight: 700;
  font-size: 0.8rem;
  background: #f1f5f9;
  color: var(--text-secondary);
  border: 1px solid var(--line);
}

.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.pending {
  background: var(--warning-soft);
  color: var(--warning-dark);
  border-color: var(--warning-border);
}

.badge.approved,
.badge.fulfilled {
  background: var(--success-soft);
  color: var(--success-dark);
  border-color: var(--success-border);
}

.badge.cancelled {
  background: var(--danger-soft);
  color: var(--danger-dark);
  border-color: var(--danger-border);
}

/* Actions & Button Groups */
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.end-actions {
  justify-content: flex-end;
}

.pagination,
.messages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

/* Messages & Alerts */
.message,
.form-status {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.form-status:empty {
  display: none;
}

.message.error,
.form-status.error {
  background: var(--danger-soft);
  color: var(--danger-dark);
  border-color: var(--danger-border);
}

.message.success,
.form-status.success {
  background: var(--success-soft);
  color: var(--success-dark);
  border-color: var(--success-border);
}

/* Legal & Settings */
.legal-content {
  white-space: normal;
  line-height: 1.7;
}

.settings-list {
  display: grid;
  grid-template-columns: minmax(140px, 240px) 1fr;
  gap: 12px 20px;
  margin: 16px 0;
}

.settings-list dt {
  font-weight: 700;
  color: var(--muted);
}

.settings-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.settings-panel {
  margin-top: 24px;
}

.settings-meta {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}

.settings-meta p {
  margin: 0;
}

.profile-password-form {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.tabs {
  display: grid;
  gap: 24px;
}

/* Responsive Media Queries */
@media (min-width: 780px) {
  .hero-band {
    grid-template-columns: 1fr minmax(360px, 480px);
    align-items: end;
  }

  .auth-layout {
    grid-template-columns: 1fr 440px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1.1fr) 460px;
    align-items: start;
  }

  .split-layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .split-layout.wide {
    grid-template-columns: 440px minmax(0, 1fr);
  }

  .landing-hero {
    grid-template-columns: 1.1fr 440px;
    text-align: left;
  }

  .landing-copy {
    text-align: left;
  }

  .lead {
    margin: 0;
  }

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

  .form-grid {
    grid-template-columns: 1fr 140px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 18px;
  }

  .nav {
    gap: 4px;
  }

  .nav a,
  .link-button {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .page {
    width: min(100% - 24px, 1200px);
    margin-top: 20px;
  }

  .footer {
    flex-direction: column;
    gap: 14px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar.compact,
  .panel-head,
  .detail-list div {
    grid-template-columns: 1fr;
  }

  .settings-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .settings-list dt {
    margin-top: 8px;
  }

  h1 {
    font-size: 1.85rem;
  }
}
