/* Savrsoft — the modern catering operating system */
:root {
  --bg: #f8f6f3;
  --panel: #ffffff;
  --ink: #24272a;
  --muted: #6b7280;
  --line: #e7e3dc;
  --brand: #d96a24;
  --brand-dark: #b4551b;
  --brand-soft: #fbeee1;
  --navy: #33566e;
  --accent: #e8912c;
  --danger: #b3423a;
  --good: #2f7a52;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(24, 22, 20, .07), 0 4px 16px rgba(24, 22, 20, .05);
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: #253442; color: #dde5ea;
  display: flex; flex-direction: column; padding: 18px 0;
  position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 8px; padding: 4px 18px 18px; }
.logo .mark { width: 32px; height: auto; flex-shrink: 0; }
.wm { font-size: 19px; font-weight: 800; color: #fff; letter-spacing: .2px; }
.wm em { font-style: normal; color: var(--accent); font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #c0ccd5; font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--accent); }
.sidebar .foot { margin-top: auto; padding: 14px 20px; font-size: 12.5px; color: #8da0ae; }
.sidebar .foot button { background: none; border: none; color: #b3c2cd; padding: 0; font-size: 12.5px; text-decoration: underline; }

.trial-banner {
  background: #fdf3e3; border: 1px solid #ecd3a8; color: #7a5410;
  padding: 9px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 14px;
}
.trial-banner a { color: var(--brand-dark); font-weight: 600; }
.trial-banner.locked { background: #fbf0ef; border-color: #e3c1be; color: var(--danger); }
.main { flex: 1; padding: 28px 34px 60px; max-width: 1120px; }

/* header */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* cards & tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; font-weight: 650; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4, .grid.cols-2 { grid-template-columns: 1fr; } .main { padding: 18px; } .sidebar { width: 64px; } .logo, .nav a .lbl, .sidebar .foot { display: none; } }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* stats */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.good { color: var(--good); }
.stat .value.bad { color: var(--danger); }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: #3d443f; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d4d2ca; border-radius: 7px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.field textarea { min-height: 90px; resize: vertical; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  border: 1px solid transparent; font-weight: 600; font-size: 14px;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--ink); border-color: #d4d2ca; }
.btn.secondary:hover { background: #f3f2ee; }
.btn.danger { background: #fff; color: var(--danger); border-color: #e3c1be; }
.btn.danger:hover { background: #fbf0ef; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: none; border: none; color: var(--muted); padding: 4px 6px; }
.btn.ghost:hover { color: var(--danger); }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge.quote { background: #fdf3e3; color: #96690f; }
.badge.confirmed { background: var(--brand-soft); color: var(--brand-dark); }
.badge.done { background: #e8e8e8; color: #555; }
.badge.cancelled { background: #f7e5e4; color: var(--danger); }
.badge.warn { background: #fdf3e3; color: #96690f; }

/* auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #253442 0%, #33566e 55%, #7a4a22 130%); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; padding: 34px; width: 420px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card .logo2 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.auth-card .logo2 .mark { width: 46px; height: auto; }
.auth-card .logo2 .wm { font-size: 26px; color: var(--ink); }
.auth-card .logo2 .wm em { color: var(--brand); }
.auth-card .tag { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.auth-switch { margin-top: 16px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(20,24,22,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 640px; max-width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.star { background: none; border: none; font-size: 18px; color: #c9c4ba; padding: 0 4px; line-height: 1; }
.star.on { color: var(--accent); }
.star:hover { color: var(--accent); }

.error-msg { background: #fbf0ef; color: var(--danger); border: 1px solid #e3c1be; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; }
.ok-msg { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #bcd8c8; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 12px; }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 14px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: none; padding: 9px 16px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.ing-line { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.ing-line input.qty { width: 70px; } .ing-line select.unit { width: 100px; } .ing-line input.name { flex: 1; }
.pnl-row { display: flex; justify-content: space-between; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.pnl-row.total { border-bottom: none; border-top: 2px solid var(--ink); font-weight: 700; font-size: 16px; margin-top: 4px; padding-top: 10px; }
.pnl-row .lbl { color: #3d443f; } .pnl-row.indent .lbl { padding-left: 18px; color: var(--muted); }

@media print {
  .sidebar, .no-print, .page-head .btn, .tabs { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: none; padding: 0; }
  body { background: #fff; }
}
