/* Presentation layer for the compiled React app. Keep data logic in js/ and api/. */
:root {
  --tc-font: "Inter", "Segoe UI", Arial, sans-serif;
  --tc-ink: #1a1a1a;
  --tc-muted: #69645c;
  --tc-border: #e2dacb;
  --tc-canvas: #f5f0e8;
  --tc-surface: #ffffff;
  --tc-soft: #f2ecdf;
  --tc-accent: #8b6800;
  --tc-accent-soft: #fbf3d9;
  --tc-gold: #8b6800;
  --tc-brand: #d19c00;
  --tc-brand-hover: #bf8f00;
  --tc-header: #f5ebe0;
  --tc-focus: #d19c0033;
  --tc-deep: #20201d;
  --tc-deep-soft: #2f2c26;
  --tc-info: #285568;
  --tc-success: #236550;
  --tc-danger: #a6423a;
}

html, body, #root { max-width: 100%; font-family: var(--tc-font); letter-spacing: 0; }
html, body { overflow-x: hidden; }
body { margin: 0; background: #f4efe7; color: var(--tc-ink); -webkit-font-smoothing: antialiased; }
#root *, #root *::before, #root *::after { letter-spacing: 0; }
#root .font-display, #root [class~="lg:font-display"] { font-family: var(--tc-font); }
#root h1, #root h2, #root h3 { line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
#root h1 { font-size: 24px; }
#root h2 { font-size: 22px; }
#root h3 { font-size: 17px; }
#root p { line-height: 1.6; }
#root .text-gray-400 { color: #78736b; }
#root .text-gray-500, #root .text-gray-600 { color: var(--tc-muted); }
#root .text-vagos-dark, #root .text-gray-700, #root .text-gray-800 { color: var(--tc-ink); }
#root .text-vagos-gold, #root .text-vagos-gold-dark { color: var(--tc-gold); }
#root .text-gold-gradient { color: var(--tc-gold); background: none; -webkit-text-fill-color: currentColor; }
#root .min-h-screen.bg-gradient-to-br { background: #f4efe7; }
#root [class~="bg-vagos-beige"], #root [class~="bg-vagos-beige/30"],
#root [class~="bg-vagos-beige/40"], #root [class~="bg-vagos-beige/60"] { background: var(--tc-soft); }
#root [class~="border-black/5"], #root [class~="border-vagos-gold/20"],
#root [class~="border-vagos-gold/30"], #root .border-gray-200 { border-color: var(--tc-border); }
#root .rounded-xl, #root .rounded-xl2, #root .rounded-xl3 { border-radius: 8px; }
#root .shadow-soft, #root .shadow-medium { box-shadow: 0 10px 30px rgba(32, 32, 29, .06); }
#root .shadow-gold { box-shadow: none; }
#root .card-hover { transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease; }
#root .card-hover:hover { transform: none; border-color: #c8b481; box-shadow: 0 12px 28px rgba(32, 32, 29, .08); }
#root .animate-fadeIn, #root .animate-fadeInUp, #root .stagger > * { animation: none; }
#root .absolute.blur-3xl { display: none; }

/* Shared controls, including controls inserted by the existing password patches. */
#root button { font-size: 14px; font-weight: 550; text-transform: none; }
#root button:not(.rounded-full) { border-radius: 6px; }
#root button:disabled { cursor: not-allowed; }
#root button svg { flex-shrink: 0; }
#root button:has(> svg):not(:has(> span)) { min-width: 32px; }
#root .card-hover p { overflow-wrap: anywhere; }
#root .card-hover > .flex:has(h3) { gap: 8px; }
#root .card-hover > .flex:has(h3) > div:last-child:has(button) { flex-shrink: 0; }
#root .btn-gold {
  background: var(--tc-brand); color: var(--tc-ink); box-shadow: inset 0 -1px 0 rgba(26, 26, 26, .18); border-radius: 6px;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
#root .btn-gold:hover { background: var(--tc-brand-hover); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(139, 104, 0, .18); }
#root button.bg-green-500 { background: var(--tc-success); }
#root button.bg-green-500:hover { background: #194c3b; }
#root button.bg-gray-500 { background: #69645c; }
#root button.bg-vagos-gold { background: var(--tc-brand); color: var(--tc-ink); }
#root button.bg-blue-500 { background: var(--tc-info); }
#root :is(input, select, textarea):not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
  min-height: 44px; border-radius: 6px; background-color: var(--tc-surface);
  border-color: #d7cdbb; font-family: var(--tc-font); font-size: 14px;
  color: var(--tc-ink); transition: border-color 150ms ease, box-shadow 150ms ease;
}
#root input::placeholder, #root textarea::placeholder { color: #827b70; }
#root input[type="radio"], #root input[type="checkbox"] { accent-color: var(--tc-accent); }
#root .peer:checked ~ [class~="peer-checked:bg-vagos-gold"],
#root .peer:checked ~ [class~="peer-checked:bg-yellow-500"] { background-color: var(--tc-accent); }
#root :is(input, select, textarea):focus {
  border-color: var(--tc-accent); outline: none; box-shadow: 0 0 0 3px var(--tc-focus);
}
#root :is(button, a, summary):focus-visible { outline: 2px solid var(--tc-accent); outline-offset: 3px; }
#root label { line-height: 1.5; }
#root main { min-width: 0; }
#root main > .space-y-6 > .bg-white:not(.card-hover) {
  border-radius: 8px; box-shadow: 0 8px 24px rgba(32, 32, 29, .05); border: 1px solid var(--tc-border); background: rgba(255, 255, 255, .78);
}
#root main .grid { min-width: 0; }
#root main .grid > * { min-width: 0; }
#root main .text-3xl.font-bold { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
#root main .bg-gradient-to-br:not(.min-h-screen) { background: #f6f1e8; }
#root main .bg-gradient-to-br > svg { color: var(--tc-accent); }
#root main .text-sm { line-height: 1.5; }
#root main .text-xs { line-height: 1.45; }

/* Application shell and navigation. */
#root header {
  background: rgba(245, 235, 224, .96); border-bottom: 1px solid var(--tc-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .72); backdrop-filter: blur(10px);
}
#root header h1 { font-size: 18px; }
#root header p { font-size: 12px; margin-top: 3px; }
#root header .font-display.leading-none { font-size: 26px; font-weight: 750; color: var(--tc-ink); }
#root header .py-6 { padding-block: 18px; }
#root header :has(> #btnPT) { border: 1px solid var(--tc-border); border-radius: 6px; background: var(--tc-soft); }
#root #btnPT, #root #btnEN { border-radius: 4px; min-height: 28px; font-size: 11px; }
#root header .rounded-full:has(> svg) { background: transparent; border-radius: 6px; }
#root aside { background: var(--tc-deep); border-right: 1px solid #3a352d; box-shadow: 10px 0 30px rgba(32, 32, 29, .08); }
#root aside > div { padding: 24px 14px; }
#root aside .font-display { font-size: 28px; font-weight: 700; }
#root aside .text-gold-gradient { color: #e0c284; }
#root aside .text-gray-400 { color: #aaa398; }
#root aside nav { display: grid; gap: 7px; }
#root aside nav button { min-height: 46px; padding: 11px 14px; font-size: 13px; border-radius: 8px; }
#root aside nav button:not(.bg-gradient-to-r) { color: #d1cbc1; }
#root aside nav button.bg-gradient-to-r { background: var(--tc-brand); color: var(--tc-ink); box-shadow: inset 0 -1px 0 rgba(26, 26, 26, .2); }
#root aside nav button:hover { background: var(--tc-deep-soft); color: #ffffff; }
#root aside nav button.bg-gradient-to-r:hover { background: var(--tc-brand-hover); color: var(--tc-ink); }
#root aside nav button span { line-height: 1.4; }
#root aside nav svg { width: 18px; height: 18px; }
#root aside .text-vagos-gold-light { color: #d6c196; }
#root footer { background: transparent; color: var(--tc-muted); border-top: 1px solid var(--tc-border); padding-block: 16px; }
#root footer a { color: var(--tc-gold); }
#root footer p { font-size: 11px; }

/* Tables and inline editors retain their existing content and actions. */
#root table { width: 100%; font-size: 13px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#root th { background: #ede5d7; color: var(--tc-muted); font-size: 11px; font-weight: 650; text-transform: uppercase; padding: 12px 16px; }
#root td { border-bottom: 1px solid var(--tc-border); padding: 14px 16px; }
#root tbody tr:hover { background: #faf7ef; }
#root main .grid > .bg-white,
#root main .space-y-6 > .grid > .bg-white,
#root main .grid > .card-hover {
  border-color: var(--tc-border);
  background: rgba(255, 255, 255, .86);
}
#root main .grid > .bg-white:has(.text-3xl.font-bold) {
  border-left: 4px solid var(--tc-brand);
}
#root main .grid > .bg-white:has(.text-3xl.font-bold) .text-3xl.font-bold {
  font-size: 30px;
}
#root main .grid > .bg-white:has(.text-3xl.font-bold) svg {
  color: var(--tc-accent);
}
#root td button { font-size: 12px; }
#root .tc-teacher-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#root .tc-teacher-rates span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--tc-border); border-radius: 6px; background: var(--tc-soft); }
#root .tc-teacher-rates small { color: var(--tc-muted); font-size: 11px; }
#root .tc-teacher-rates strong { color: var(--tc-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
#root [role="dialog"] { max-height: calc(100dvh - 32px); overflow-y: auto; }
#root [data-login-password-toggle] { margin-top: 20px; padding: 10px 0; border-top: 1px solid var(--tc-border); border-radius: 0; }
#root .min-h-screen:has(form #password) { padding: 80px 20px 32px; align-items: center; }
#root .max-w-md:has(form #password) { background: white; border-radius: 8px; border: 1px solid var(--tc-border); box-shadow: 0 12px 40px #2027250a; }
#root .max-w-md:has(form #password) h2 { font-size: 24px; }
#root .max-w-md:has(form #password) .text-4xl { font-size: 36px; }

::-webkit-scrollbar-track { background: var(--tc-canvas); }
::-webkit-scrollbar-thumb { background: #cbbd9d; border: 2px solid var(--tc-canvas); }
::-webkit-scrollbar-thumb:hover { background: #a99157; }

#root .tc-brand { display: flex; flex-shrink: 0; }
#root .tc-brand > span { display: none; }
#root .tc-brand img { width: 124px; height: 58px; object-fit: contain; }
#root .max-w-md .tc-brand img { width: 164px; height: 77px; }
#root .tc-legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 20px 0 0; font-size: 12px; }
#root .tc-legal-links a { color: var(--tc-gold); text-underline-offset: 3px; }
#root .tc-legal-links a:hover { text-decoration: underline; }

@media (min-width: 1024px) {
  #root:has(aside) main { padding: 30px 34px; }
  #root:has(aside) header { padding: 18px 32px; }
}

@media (max-width: 1023px) {
  /* The eight existing destinations become a scrollable bottom navigation. */
  #root aside {
    top: auto; bottom: 0; height: auto; width: 100%; max-width: 100%;
    transform: none !important; border: 0; border-top: 1px solid #443b2b;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #root aside > div { padding: 8px; }
  #root aside > div > div { display: none; }
  #root aside nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
  #root aside nav button { width: auto; flex: 1 0 78px; padding: 8px 6px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
  #root aside nav button span { display: block; margin: 0; font-size: 10px; white-space: nowrap; }
  #root aside nav button > div { display: none; }
  #root aside nav button.bg-gradient-to-r { box-shadow: none; }
  #root aside + div { padding-top: 82px; padding-bottom: 96px; }
  #root:has(aside) header { min-height: 76px; }
  #root aside nav { scrollbar-width: none; overscroll-behavior-inline: contain; }
  #root aside nav::-webkit-scrollbar { display: none; }
  #root aside + div { min-width: 0; width: 100%; }
  #root:has(aside) main form > .md\:col-span-2.flex.space-x-3 {
    position: fixed; left: 16px; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 35;
    margin: 0; padding: 12px; border: 1px solid var(--tc-border); border-radius: 8px;
    background: var(--tc-surface); box-shadow: 0 -8px 24px rgba(26, 26, 26, .12);
  }
  #root:has(aside) main form > .md\:col-span-2.flex.space-x-3 > * { margin-left: 0; }
  #root:has(aside) main form > .md\:col-span-2.flex.space-x-3 { display: flex; flex-wrap: wrap; gap: 10px; }
  #root:has(aside) main form > .md\:col-span-2.flex.space-x-3 > button { flex: 1 1 120px; }
  #root:has(aside) main form:has(> .md\:col-span-2.flex.space-x-3) { padding-bottom: 72px; }
}

@media (max-width: 640px) {
  #root h1 { font-size: 22px; }
  #root h2 { font-size: 20px; }
  #root header h1 { font-size: 14px !important; }
  #root header > .max-w-7xl { padding-inline: 16px; }
  #root header .py-6 { padding-block: 14px; }
  #root header .flex.items-center:has(h1) { width: auto; flex: 1 1 230px; }
  #root header .flex.items-center.gap-3 { width: auto; margin-left: auto; }
  #root header .font-display.leading-none { font-size: 22px; }
  #root:has(aside) header > div { gap: 8px; }
  #root:has(aside) header h1 { max-width: 170px; }
  #root main > .space-y-6 > .flex.justify-between { flex-wrap: wrap; gap: 12px; }
  #root main .flex.justify-between > h2 { min-width: 0; }
  #root main .flex:has(> h3) { flex-wrap: wrap; gap: 12px; }
  #root main .flex:has(> h3) > h3 { flex: 1 0 100%; }
  #root main .flex.items-center:has(> button.btn-gold) { flex-wrap: wrap; gap: 8px; }
  #root main .flex.items-center:has(> button.btn-gold) > * { margin-left: 0; }
  #root main .flex:has(> h3) > .flex { flex: 1 1 100%; min-width: 0; max-width: 100%; flex-wrap: wrap; gap: 8px; margin-left: 0; }
  #root main .flex:has(> h3) > .flex > * { margin-left: 0; }
  #root main .grid-cols-7 { overflow-x: auto; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; padding-bottom: 12px; }
  #root main [class~="lg:grid-cols-4"], #root main [class~="md:grid-cols-4"]:not(.text-sm) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #root main [class~="lg:grid-cols-4"] > div, #root main [class~="md:grid-cols-4"]:not(.text-sm) > div { padding: 14px; }
  #root main [class~="md:grid-cols-4"]:not(.text-sm) > div > .flex { align-items: flex-start; flex-direction: column; gap: 10px; }
  #root main [class~="md:grid-cols-4"]:not(.text-sm) > div > .flex > * { margin-left: 0; }
  #root :is(input, select, textarea):not([type="radio"]):not([type="checkbox"]) { font-size: 16px; }
  #root td, #root th { padding: 10px; }
  #root main div:has(> table) { overflow-x: auto; }
  #root main table { min-width: 600px; }
  #root:has(aside) header h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #root main .border.border-gray-200.rounded-lg.p-4:has(.flex.space-x-2 > button.bg-green-100) > .flex.items-center.justify-between {
    align-items: stretch; flex-direction: column; gap: 14px;
  }
  #root main .border.border-gray-200.rounded-lg.p-4:has(.flex.space-x-2 > button.bg-green-100) > .flex.items-center.justify-between > div { min-width: 0; }
  #root main .border.border-gray-200.rounded-lg.p-4:has(.flex.space-x-2 > button.bg-green-100) .flex.space-x-2 {
    width: 100%; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  }
  #root main .border.border-gray-200.rounded-lg.p-4:has(.flex.space-x-2 > button.bg-green-100) .flex.space-x-2 > * { margin-left: 0; }
  #root main .border.border-gray-200.rounded-lg.p-4:has(.flex.space-x-2 > button.bg-green-100) h4 { overflow-wrap: anywhere; }
  #root main .h-96 { height: auto; min-height: 260px; }
}

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