/* Copyright (c) 2026 alldun.app - Neil Dun & Nate Allen. All rights reserved. */
/* root.css - Single source of truth for all colours, surfaces & buttons */
:root {
  --brand-primary: #c8523b;         /* Rich deep salmon */
  --brand-primary-hover: #831843;
  --brand-tint: #fdf2f8;            /* Soft warm salmon tint for icon badges */
  --brand-secondary: #e46e57;       /* Deep royal blue for secondary actions */
  --bg-app: #f9f5f7;                /* Clean warm-neutral canvas */
  --bg-card: #ffffff;               /* Pure white card surface */
  --bg-header: rgba(255, 255, 255, 0.72);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;
  --border-color: #fce7f3;
  --danger-color: #dc2626;
  --danger-tint: #fef2f2;
  --warning-color: #d97706;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 8px 20px rgba(15, 23, 42, 0.1);
  --shadow-btn-primary: 0 1px 2px rgba(15, 23, 42, 0.16), 0 3px 8px rgba(200, 82, 59, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --shadow-btn-secondary: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: clip;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
}

/* App Shell */
#root {
  min-width: 320px;
}

.app-shell {
  min-width: 320px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 20px 24px 20px;
}

/* Modern Frosted Glass Top Bar — Locked Sticky to Top, Zero Height or Width Shift */
.app-header {
  width: 100%;
  background: var(--bg-header, rgba(255, 255, 255, 0.72)) !important;
  background: color-mix(in srgb, var(--bg-card, #ffffff) 72%, transparent) !important;
  backdrop-filter: blur(16px) saturate(175%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(175%) !important;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-top: none;
  border-left: 4px solid var(--brand-primary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 13px 18px;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
  margin-bottom: 18px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.app-header-title {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-header-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 5px;
  min-height: 24px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--text-muted);
}

.header-breadcrumbs.centered {
  justify-content: center;
}

.header-crumb-sep {
  color: var(--text-muted);
  opacity: 0.6;
}

.header-crumb-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 2px 8px;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.header-crumb-btn:hover {
  background: var(--brand-tint);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.header-crumb-btn:active {
  transform: translateY(1px) scale(0.98);
}

.header-crumb-current {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 2px 6px;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-user-pill {
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text-muted);
  margin-left: 2px;
}

.test-pill {
  background: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f7 100%);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 13px;
  min-height: 38px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-btn-secondary);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-btn:hover {
  background: var(--brand-tint);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

.nav-btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.1);
}

.nav-btn.active {
  background: var(--brand-tint);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: inset 0 1px 2px rgba(200, 82, 59, 0.14);
}

/* Responsive Landing Hero */
.landing-hero {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 32px;
}

.landing-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-tint);
  color: var(--brand-primary);
  border: 1px solid rgba(200, 82, 59, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
  max-width: 100%;
}

.landing-title {
  margin: 0 0 12px 0;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.landing-subtitle {
  margin: 0 0 24px 0;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 54ch;
  overflow-wrap: break-word;
}

.landing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.landing-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.landing-visual img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

@media (min-width: 769px) {
  .landing-visual img {
    max-width: 440px;
  }
}

/* Modern Icon Tile Grid */
.menu-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.menu-tile {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 14px;
}

.menu-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-primary);
}

.menu-tile:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.tile-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--brand-tint);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.menu-tile:hover .tile-icon-badge {
  background-color: var(--brand-primary);
  color: var(--text-on-primary);
}

.tile-icon-badge.danger {
  background-color: var(--danger-tint);
  color: var(--danger-color);
}

.menu-tile:hover .tile-icon-badge.danger {
  background-color: var(--danger-color);
  color: #ffffff;
}

.tile-body {
  flex: 1;
  min-width: 0;
}

.tile-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.tile-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

.tile-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Cards & Forms */
.card-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px; /* Prevents iOS Safari/Chrome auto-zoom */
  min-height: 46px;
  background-color: var(--bg-card);
  color: var(--text-main);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.06) 100%), var(--brand-primary);
  color: var(--text-on-primary);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 12px 18px;
  min-height: 46px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn-primary);
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18), 0 5px 12px rgba(200, 82, 59, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.24);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-app) 100%);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 15px;
  min-height: 46px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-btn-secondary);
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand-primary);
  background: var(--brand-tint);
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* Matching Rounded Footer Bar */
.app-footer {
  width: 100%;
  margin-top: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-card);
}

.footer-left, .footer-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--brand-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: opacity 0.15s ease;
}

.footer-link:hover {
  opacity: 0.8;
}

.footer-link.danger {
  color: var(--danger-color);
}

/* Legacy Backend HTML Viewport */
.legacy-viewport {
  overflow-x: auto;
}
.legacy-viewport table {
  width: 100%;
  border-collapse: collapse;
}
.legacy-viewport td, .legacy-viewport th {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-color);
}
.m1-roundedbut, .roundedbut {
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
}
.fgcred { color: var(--danger-color); font-weight: 600; }
.fgcblue { color: var(--brand-secondary); }
.bgcseagreen { background-color: var(--brand-primary); color: #fff; }
.bgcred { background-color: var(--danger-color); color: #fff; }
.bgcwhite { background-color: #ffffff; }
.bold { font-weight: 700; }
.alignc { text-align: center; }
.alignl { text-align: left; }
.hand { cursor: pointer; }

/* Mobile-Safe Modal Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
  overflow: hidden;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-width: min(560px, calc(100vw - 24px));
  width: 100%;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.25);
}

.modal-box video {
  max-width: 100%;
  max-height: 55dvh;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* Tablet & Mobile Phone Overrides */
@media (max-width: 768px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 16px;
    gap: 18px;
  }
  .landing-visual {
    order: -1;
  }
  .landing-visual img {
    max-width: 260px;
  }
  .landing-actions .btn-primary,
  .landing-actions .btn-secondary {
    flex: 1 1 130px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0 12px 20px 12px;
  }
  .app-header {
    padding: 11px 14px;
    min-height: 68px;
    top: 0 !important;
    margin-bottom: 14px;
  }
  .app-header-title {
    font-size: 1.02rem;
  }
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .menu-tile {
    padding: 16px;
  }
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}