/* ==========================================================================
   Osteria Fiamma — admin console. Functional light UI, same brand accent.
   ========================================================================== */
:root {
  --ink: #241c16;
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --line: #e2d9c8;
  --muted: #7c7060;
  --red: #d43d20;
  --red-deep: #a92d13;
  --green: #1d7a44;
  --amber: #b07a1d;
  --char: #161210;
  --sans: 'Archivo', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
svg { width: 18px; height: 18px; }

/* ---- login ---- */
.login-page { min-height: 100dvh; display: grid; place-items: center; background: var(--char); padding: 24px; }
.login-card { background: var(--surface); border-radius: var(--radius); padding: 2.6rem; width: 100%; max-width: 400px; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand small { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.4em; text-transform: uppercase; color: var(--muted); display: block; }
.login-brand strong { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 2.2rem; padding-bottom: 0.15em; display: block; }
.login-brand span { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100dvh; }
.side { background: var(--char); color: #e9e1d3; padding: 1.6rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; position: sticky; top: 0; height: 100dvh; }
.side-brand { padding: 0 0.8rem 1.4rem; }
.side-brand small { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.38em; text-transform: uppercase; color: #9d8f7e; display: block; }
.side-brand strong { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 1.6rem; }
.side a.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.65rem 0.8rem; border-radius: 8px;
  text-decoration: none; font-weight: 500; font-size: 0.9rem; color: #b9ac9b;
  transition: background 0.2s ease, color 0.2s ease;
}
.side a.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.side a.nav-item.active { color: #fff; background: rgba(212, 61, 32, 0.28); }
.side a.nav-item .pill { margin-left: auto; }
.side-foot { margin-top: auto; padding: 0.8rem; display: flex; flex-direction: column; gap: 0.6rem; }
.side-foot a, .side-foot button {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #b9ac9b;
  background: none; border: 0; text-decoration: none; padding: 0.3rem 0;
}
.side-foot a:hover, .side-foot button:hover { color: #fff; }

.main { padding: 2rem 2.4rem 4rem; max-width: 1200px; }
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; flex-wrap: wrap; }
.topbar h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar .sub { color: var(--muted); font-size: 0.88rem; }

/* ---- cards, stats ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.stat b { display: block; font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stat.hot { border-color: var(--red); }
.stat.hot b { color: var(--red); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.6rem; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 1rem; font-weight: 700; }
.panel-body { padding: 1.3rem; }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0.8rem 1.3rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: 0.85rem 1.3rem; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.9rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #faf6ec; }
.tbl .mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl .dim { color: var(--muted); font-size: 0.82rem; }
.tbl-scroll { overflow-x: auto; }

/* ---- badges, pills ---- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.pill-pending { background: #f6e8cf; color: var(--amber); }
.pill-confirmed { background: #dcefe2; color: var(--green); }
.pill-declined, .pill-cancelled, .pill-no_show { background: #f4dcd6; color: var(--red-deep); }
.pill-completed { background: #e5e1d8; color: var(--muted); }
.pill-count { background: var(--red); color: #fff; }
.pill-off { background: #f4dcd6; color: var(--red-deep); }
.pill-on { background: #dcefe2; color: var(--green); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 0.85rem; text-decoration: none; transition: all 0.2s ease; background: var(--char); color: #fff; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(20, 14, 8, 0.18); }
.btn:active { transform: translateY(0); }
.btn-red { background: var(--red); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: var(--ink); box-shadow: none; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; border-radius: 6px; }
.btn-ghost-danger { background: none; border: 0; color: var(--red-deep); padding: 0.35rem 0.5rem; font-size: 0.78rem; font-weight: 600; }
.btn-ghost-danger:hover { text-decoration: underline; }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.row-actions form { display: inline; }

/* ---- forms ---- */
.input, select.input, textarea.input { width: 100%; padding: 0.65rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: var(--ink); }
.input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(212, 61, 32, 0.12); }
.f-label { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.35rem; }
.f-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.f-grid .full { grid-column: 1 / -1; }
.f-row { margin-bottom: 1rem; }
.check { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; font-weight: 500; }
.form-msg { padding: 0.8rem 1.1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1.2rem; }
.form-msg.ok { background: #dcefe2; color: var(--green); }
.form-msg.err { background: #f4dcd6; color: var(--red-deep); }

/* ---- filters ---- */
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.filters a { padding: 0.4rem 0.95rem; border-radius: 99px; border: 1px solid var(--line); font-size: 0.8rem; font-weight: 600; text-decoration: none; color: var(--muted); transition: all 0.2s ease; }
.filters a:hover { color: var(--ink); border-color: var(--ink); }
.filters a.on { background: var(--char); border-color: var(--char); color: #fff; }

/* ---- menu admin ---- */
.cat-block { margin-bottom: 1.6rem; }
.cat-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.cat-head h2 { font-size: 1.05rem; font-weight: 700; }
.cat-head .dim { color: var(--muted); font-size: 0.82rem; }
details.editor { border-top: 1px solid var(--line); }
details.editor summary { cursor: pointer; padding: 0.7rem 1.3rem; font-size: 0.82rem; font-weight: 600; color: var(--muted); list-style: none; }
details.editor summary::-webkit-details-marker { display: none; }
details.editor summary:hover { color: var(--ink); background: #faf6ec; }
details.editor .panel-body { border-top: 1px solid var(--line); background: #faf7ef; }

/* ---- messages ---- */
.msg { border-bottom: 1px solid var(--line); padding: 1.1rem 1.3rem; }
.msg:last-child { border-bottom: 0; }
.msg.unread { border-left: 3px solid var(--red); background: #fdf9f0; }
.msg-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.msg-head b { font-size: 0.95rem; }
.msg-head time { color: var(--muted); font-size: 0.8rem; }
.msg-sub { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.msg-body { color: #4d453a; font-size: 0.9rem; white-space: pre-line; max-width: 75ch; }
.msg-actions { display: flex; gap: 0.6rem; margin-top: 0.7rem; flex-wrap: wrap; align-items: center; }
.msg-contact { color: var(--muted); font-size: 0.82rem; }

/* ---- hours grid (settings) ---- */
.hours-grid { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 0.5rem 0.8rem; align-items: center; max-width: 560px; }
.hours-grid .hg-day { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hours-grid .hg-pair { display: flex; align-items: center; gap: 0.4rem; }
.hours-grid .hg-pair input { padding: 0.45rem 0.5rem; }
.hours-grid .hg-head { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 2.6rem 1rem; }
.empty svg { width: 34px; height: 34px; margin: 0 auto 0.7rem; display: block; color: var(--line); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-brand { padding: 0 0.8rem; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .main { padding: 1.4rem 1.2rem 3rem; }
}
