@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
  --cream: #FBF7F0;
  --card: #ffffff;
  --ink: #241a12;
  --muted: #8a7d6e;
  --line: #ece3d6;
  --gold: #C9A35A;
  --green: #0F3D2E;
  --terra: #B85C38;
  /* status */
  --ok: #3f7d5a;     /* liberă */
  --warn: #E0A526;   /* de strâns */
  --call: #C0392B;   /* cheamă ospătar */
  --bill: #1F8A8A;   /* nota */
  --shadow: 0 6px 24px rgba(36,26,18,.08);
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.5;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; margin: 0; letter-spacing: -.01em; }

a { color: inherit; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }

/* ---------- Header ---------- */
.appbar {
  background: var(--green);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.appbar .brand { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-size: 19px; }
.appbar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.appbar .tools { display: flex; align-items: center; gap: 10px; }
.appbar a, .appbar button { color: #fff; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.pill:hover { background: rgba(255,255,255,.24); }
.pill.alert { background: var(--terra); border-color: transparent; }

/* ---------- Buttons ---------- */
.btn {
  border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700;
  border-radius: 12px; padding: 12px 16px; transition: transform .08s ease, box-shadow .15s ease, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); color: #3a2c10; }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- CLIENT (masa.html) ---------- */
.client { min-height: 100vh; display: flex; flex-direction: column; }
.client-hero { background: var(--green); color: #fff; padding: 30px 22px 26px; text-align: center; }
.client-hero .name { font-family: 'Fraunces', serif; font-size: 24px; color: var(--gold); }
.client-hero .masa { font-size: 56px; font-family: 'Fraunces', serif; font-weight: 700; line-height: 1.05; margin-top: 6px; }
.client-hero .sub { opacity: .85; margin-top: 4px; }
.client-actions { padding: 18px; display: grid; gap: 12px; max-width: 460px; width: 100%; margin: 0 auto; flex: 1; }
.action {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px; cursor: pointer; font-size: 18px; font-weight: 700; font-family: inherit;
  color: var(--ink); box-shadow: var(--shadow); transition: transform .08s, border-color .15s;
}
.action:active { transform: scale(.98); }
.action .emoji { font-size: 28px; width: 40px; text-align: center; }
.action .arrow { margin-left: auto; color: var(--muted); }
.action.done { border-color: var(--ok); background: #f2faf5; }
.action.done .arrow { color: var(--ok); font-weight: 700; }
.action.menu { background: var(--green); color: #fff; }
.action.menu .arrow { color: rgba(255,255,255,.7); }
.client-foot { text-align: center; color: var(--muted); padding: 16px; font-size: 13px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); z-index: 60; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- PANOU (panou.html) ---------- */
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: 'DM Sans',sans-serif; font-weight: 700; margin: 22px 4px 12px; }

.feed { display: grid; gap: 10px; }
.feed-empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); }
.req {
  display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); border-left: 6px solid var(--line);
}
.req .ricon { font-size: 24px; }
.req .rmain { flex: 1; min-width: 0; }
.req .rmasa { font-weight: 700; font-size: 16px; }
.req .rlabel { color: var(--muted); font-size: 14px; }
.req .rtime { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: 14px; margin-right: 4px; }
.req.urgent { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: var(--shadow);} 50%{ box-shadow: 0 0 0 4px rgba(192,57,43,.18);} }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.table-card {
  background: #fff; border-radius: 14px; padding: 14px; box-shadow: var(--shadow);
  border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; position: relative;
}
.table-card .thead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.table-card .tnr { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; white-space: nowrap; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.status-libera { background: #edf6f0; color: var(--ok); }
.status-ocupata { background: #f1ece4; color: #8a6d4a; }
.status-debarasare { background: #fdf3dd; color: #a87a14; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #fff; padding: 4px 8px; border-radius: 8px; }
.table-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }

/* ---------- STATISTICI ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat-card .k { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .v { font-family: 'Fraunces', serif; font-size: 34px; font-weight: 700; margin-top: 6px; }
.stat-card .v small { font-size: 16px; color: var(--muted); font-family: 'DM Sans'; }
.panel { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; background: linear-gradient(var(--gold), #e3c486); border-radius: 8px 8px 0 0; min-height: 3px; transition: height .4s; position: relative; }
.bar span { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; }
.bar-x { font-size: 11px; color: var(--muted); }
.rowlist { display: grid; gap: 8px; }
.rowlist .row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rowlist .row:last-child { border-bottom: none; }

/* ---------- HUB (index.html) ---------- */
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin: 18px 0; }
.hub-card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--line); text-decoration: none; display: block; transition: transform .1s; }
.hub-card:hover { transform: translateY(-3px); }
.hub-card .hicon { font-size: 32px; }
.hub-card h3 { margin: 10px 0 4px; font-size: 22px; }
.hub-card p { color: var(--muted); margin: 0; font-size: 14px; }
.table-links { display: flex; flex-wrap: wrap; gap: 8px; }
.table-links a { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-decoration: none; font-weight: 700; box-shadow: var(--shadow); }
.table-links a:hover { border-color: var(--gold); }
.note { background: #fff7e8; border: 1px solid #f0e0bd; color: #8a6d2a; border-radius: 12px; padding: 12px 16px; font-size: 14px; }

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .wrap { padding: 14px; }
}
