/**
 * File:     public/assets/css/app.css
 * Project:  Bistro Control (PHP/MySQL rewrite)
 * Version:  1.0.0
 * Updated:  2026-09-26
 *
 * Purpose:  Visual style ported 1:1 from the original React/Tailwind
 *           prototype (glassmorphism cards + neumorphism inset forms).
 *           Written as plain CSS (no build step / no Tailwind) so it
 *           runs on a bare PHP/MySQL shared host with zero tooling.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ------------------------------------------------------------------ */
/* Design tokens (colours copied from the original index.css theme)   */
/* ------------------------------------------------------------------ */
:root {
  --background: 41 47% 94%;
  --foreground: 220 24% 17%;
  --border: 38 24% 83%;
  --card: 42 41% 97%;
  --card-foreground: 220 24% 17%;
  --card-border: 38 24% 84%;

  --sidebar: 221 26% 17%;
  --sidebar-foreground: 40 38% 94%;
  --sidebar-border: 218 22% 26%;
  --sidebar-accent: 216 23% 24%;

  --primary: 42 91% 53%;
  --primary-foreground: 221 26% 17%;
  --secondary: 213 32% 90%;
  --secondary-foreground: 220 24% 17%;
  --muted: 39 25% 89%;
  --muted-foreground: 219 13% 45%;
  --accent: 189 46% 38%;
  --accent-foreground: 42 41% 97%;
  --destructive: 4 69% 52%;
  --destructive-foreground: 42 41% 97%;
  --input: 38 24% 78%;
  --ring: 189 46% 38%;

  --font-sans: 'Manrope', sans-serif;
  --font-serif: 'Space Grotesk', sans-serif;
  --font-mono: 'DM Mono', monospace;
  --radius: 1rem;
}

.dark {
  --background: 220 24% 11%;
  --foreground: 41 35% 94%;
  --border: 219 18% 25%;
  --card: 220 22% 15%;
  --card-foreground: 41 35% 94%;
  --card-border: 219 18% 28%;
  --sidebar: 221 29% 9%;
  --sidebar-foreground: 41 35% 94%;
  --sidebar-accent: 219 20% 17%;
  --muted: 219 18% 20%;
  --muted-foreground: 219 13% 62%;
  --secondary: 219 18% 20%;
  --secondary-foreground: 41 35% 94%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: hsl(var(--foreground));
  background:
    radial-gradient(circle at 86% 7%, hsl(var(--primary) / .11), transparent 26rem),
    radial-gradient(circle at 12% 86%, hsl(var(--accent) / .08), transparent 30rem),
    hsl(var(--background));
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Glass / neumorphism utilities                                      */
/* ------------------------------------------------------------------ */
.glass {
  background: linear-gradient(135deg, hsl(var(--card) / .82), hsl(var(--card) / .62));
  border: 1px solid hsl(var(--card-border) / .78);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .17), 0 2px 0 hsl(202 89% 53% / 0), 0 1px 2px -1px hsl(202 89% 53% / 0);
  backdrop-filter: blur(18px);
  border-radius: 1.5rem;
}
.neo-inset {
  box-shadow: inset 4px 4px 10px hsl(var(--foreground) / .07), inset -4px -4px 10px hsl(0 0% 100% / .32);
}
.dark .neo-inset {
  box-shadow: inset 4px 4px 12px hsl(0 0% 0% / .24), inset -3px -3px 8px hsl(0 0% 100% / .03);
}
.label-mono {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: hsl(var(--accent));
}
.font-display { font-family: var(--font-serif); }
.font-mono { font-family: var(--font-mono); }

/* ------------------------------------------------------------------ */
/* Layout shell                                                       */
/* ------------------------------------------------------------------ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: hsl(var(--sidebar));
  color: hsl(var(--sidebar-foreground));
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark {
  position: relative; display: inline-flex; height: 31px; width: 31px;
  align-items: center; justify-content: center; overflow: hidden;
  border-radius: 10px; background: hsl(var(--primary));
  box-shadow: inset 2px 2px 4px hsl(0 0% 100% / .22), inset -2px -2px 4px hsl(var(--foreground) / .14);
}
.brand-title { font-family: var(--font-serif); font-weight: 700; font-size: .9rem; line-height: 1.2; }
.brand-sub { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; opacity: .55; }

.nav-section-label {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; opacity: .45; padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; border-radius: 13px;
  padding: 10px 12px; color: hsl(var(--sidebar-foreground) / .62);
  font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: background-color .2s, color .2s, transform .2s;
}
.nav-item:hover { background: hsl(var(--sidebar-accent)); color: hsl(var(--sidebar-foreground)); transform: translateX(2px); }
.nav-item-active { background: hsl(var(--sidebar-accent)); color: hsl(var(--sidebar-foreground)); }
.nav-item .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--primary)); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid hsl(var(--border) / .6);
}
.content { padding: 24px 28px 48px; max-width: 1200px; }

.avatar {
  display: inline-flex; height: 31px; width: 31px; align-items: center;
  justify-content: center; border-radius: 11px; font-family: var(--font-mono);
  font-size: 9px; font-weight: 500; background: hsl(var(--accent) / .15); color: hsl(var(--accent));
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.button-primary, .button-secondary, .button-quiet, .button-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; cursor: pointer; font-size: .78rem; font-weight: 700;
  border: none; text-decoration: none;
  transition: transform .18s, background-color .18s, border-color .18s, opacity .18s;
}
.button-primary {
  min-height: 40px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); padding: 0 16px;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / .22), 0 5px 12px hsl(var(--primary) / .17);
}
.button-primary:hover { transform: translateY(-1px); filter: brightness(1.04); }
.button-primary:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-secondary {
  min-height: 40px; border: 1px solid hsl(var(--border)); background: hsl(var(--card) / .5);
  color: hsl(var(--foreground)); padding: 0 14px;
}
.button-secondary:hover { background: hsl(var(--secondary)); border-color: hsl(var(--accent) / .42); }
.button-icon {
  height: 34px; width: 34px; border: 1px solid hsl(var(--border));
  background: hsl(var(--card) / .5); color: hsl(var(--muted-foreground));
}
.button-icon:hover { color: hsl(var(--foreground)); background: hsl(var(--secondary)); transform: translateY(-1px); }

/* ------------------------------------------------------------------ */
/* Forms                                                               */
/* ------------------------------------------------------------------ */
label.field { display: block; margin-bottom: 14px; }
label.field span {
  display: block; margin-bottom: 6px; font-size: .72rem; font-weight: 600; color: hsl(var(--muted-foreground));
}
input:not([type='checkbox']):not([type='radio']), select, textarea {
  width: 100%; border: 1px solid hsl(var(--input)); border-radius: 12px;
  background: hsl(var(--background) / .45); color: hsl(var(--foreground));
  padding: 10px 13px; font-size: .82rem;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
input:hover, select:hover, textarea:hover { background: hsl(var(--background) / .72); }
input:focus, select:focus, textarea:focus {
  border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .13); outline: none;
}
textarea { resize: vertical; }

/* ------------------------------------------------------------------ */
/* Status pills / badges                                              */
/* ------------------------------------------------------------------ */
.status-pill {
  display: inline-flex; align-items: center; width: fit-content; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  padding: 4px 9px; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.status-good { background: hsl(145 45% 87%); color: hsl(148 47% 29%); }
.status-warn { background: hsl(var(--primary) / .18); color: hsl(35 82% 35%); }
.status-critical { background: hsl(var(--destructive) / .13); color: hsl(var(--destructive)); }
.dark .status-good { background: hsl(145 35% 22%); color: hsl(145 55% 68%); }

/* ------------------------------------------------------------------ */
/* Generic page bits                                                   */
/* ------------------------------------------------------------------ */
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-header h1 { font-family: var(--font-serif); font-size: 1.6rem; margin: 6px 0 4px; }
.section-header p { margin: 0; color: hsl(var(--muted-foreground)); font-size: .85rem; max-width: 60ch; }

.card { padding: 22px 24px; margin-bottom: 20px; }
.card h2 { font-family: var(--font-serif); font-size: 1.15rem; margin: 4px 0 0; }
.card-eyebrow { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }

.row {
  display: flex; align-items: center; gap: 12px; border: 1px solid hsl(var(--border) / .7);
  background: hsl(var(--background) / .35); border-radius: 16px; padding: 14px; margin-bottom: 10px;
}
.row .icon-box {
  flex-shrink: 0; height: 38px; width: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: hsl(var(--secondary)); color: hsl(var(--accent)); font-family: var(--font-mono); font-size: .7rem;
}
.row .row-title { font-size: .85rem; font-weight: 600; margin: 0; }
.row .row-detail { font-size: .72rem; color: hsl(var(--muted-foreground)); margin: 2px 0 0; }
.row .row-value { font-family: var(--font-mono); font-size: .78rem; font-weight: 700; margin-left: auto; }

.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid-2 { grid-template-columns: 1.1fr 0.9fr; } }

.empty-state { text-align: center; padding: 32px 16px; color: hsl(var(--muted-foreground)); }
.empty-state strong { display: block; color: hsl(var(--foreground)); margin-bottom: 4px; }

.flash { border-radius: 12px; padding: 10px 14px; font-size: .8rem; margin-bottom: 16px; }
.flash-error { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); border: 1px solid hsl(var(--destructive) / .3); }
.flash-success { background: hsl(145 45% 87%); color: hsl(148 47% 29%); border: 1px solid hsl(148 40% 60%); }

/* ------------------------------------------------------------------ */
/* Login page                                                         */
/* ------------------------------------------------------------------ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; padding: 32px 30px; }
.login-card h1 { font-family: var(--font-serif); font-size: 1.4rem; margin: 14px 0 4px; }
.login-card p { color: hsl(var(--muted-foreground)); font-size: .82rem; margin: 0 0 22px; }

@media (max-width: 800px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 18px 16px 40px; }
}
