:root{
  --bg:#f6f7fb; --card:#fff; --ink:#0f172a; --muted:#6b7280; --ring:#e5e7eb;
  --shadow:0 10px 30px rgba(0,0,0,.08); --radius:16px; --primary:#0ea5e9;
  --success:#10b981; --warn:#f59e0b; --danger:#ef4444; --ready:#22c55e;
  --paid:#8b5cf6; --delivered:#06b6d4;
}

*{box-sizing:border-box}
html,body{height:100%}

/* ⬇️ הרקע הראשי עובר ל־html */
html{
  background:
    radial-gradient(900px 500px at 85% -5%, #c7d2fe33 0%, transparent 60%),
    radial-gradient(700px 420px at 10% -10%, #93c5fd33 0%, transparent 65%),
    radial-gradient(900px 520px at 50% 110%, #bbf7d033 0%, transparent 60%),
    linear-gradient(180deg, #f7fafc 0%, #ffffff 35%, #f8fafc 100%);
  background-attachment: fixed;
}

/* ⬇️ גוף שקוף כדי שלא יכסו את הרקע (גם אם יש כללים אחרים) */
body{
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;
  color: var(--ink);
  margin: 0;
  background: transparent !important;
}

.wrap{max-width:1300px;margin:18px auto;padding:0 14px}

/* ===== Topbar + Glass ===== */
.topbar{
  display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;
  background: rgba(255,255,255,0.85);
  border:1px solid var(--ring);
  border-radius:var(--radius);
  padding:12px 14px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand{display:flex;align-items:center;gap:10px}
.logo{
  width:40px;height:40px;border-radius:12px;display:grid;place-items:center;
  background: conic-gradient(from 180deg at 50% 50%, #fff, #dbeafe, #fff);
  border:1px solid var(--ring);
}
h1{margin:0;font-size:22px}
.sub{color:var(--muted);font-size:12px}

.controls{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

/* ===== Buttons ===== */
.btn{
  border:1px solid var(--ring);
  padding:10px 14px; border-radius:12px; cursor:pointer; font-weight:700;
  background:#fff; color:var(--ink); box-shadow:var(--shadow);
  transition: transform .04s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.02);}
.btn:active { transform: translateY(1px);}
.btn.primary{
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  border-color: transparent; color: #fff;
}
.btn.success{background:var(--success);color:#fff;border-color:transparent}
.btn.danger{background:#fee2e2;border-color:#fecaca;color:#991b1b}
.btn.ghost{background:#ffffff;border-color:var(--ring)}
.btn.deliver{background:var(--delivered);color:#fff;border-color:transparent}

/* Sound toggle */
#soundToggle{background:#6b7280;color:#fff;border:none}
#soundToggle.on{background:#10b981}
#stopAlarm{display:none}

/* ===== Selects / Inputs ===== */
select, .search-input{
  border:1px solid var(--ring);
  border-radius:12px;
  padding:10px 12px;
  background: rgba(255,255,255,0.92);
  box-shadow:var(--shadow);
  backdrop-filter: blur(4px);
}

/* ===== Grid Columns ===== */
.cols{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-top:14px;
}
@media(max-width:1400px){.cols{grid-template-columns:repeat(4,1fr)}}
@media(max-width:1200px){.cols{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.cols{grid-template-columns:repeat(2,1fr)}}
@media(max-width:680px){.cols{grid-template-columns:1fr}}

/* כל הכרטיסיות עם Glass */
.col,
.summary .card,
.order{
  background: rgba(255,255,255,0.82);
  border:1px solid var(--ring);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.col{padding:12px;min-height:140px}
.col-title{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin:4px 0 10px;font-size:18px;font-weight:900
}
.col-title .badge{
  background:#f1f5f9;color:#0f172a;border-radius:999px;padding:4px 10px;font-size:12px;
  border:1px solid var(--ring);min-width:36px;text-align:center
}

.status-new .dot{background:var(--primary)}
.status-preparing .dot{background:var(--warn)}
.status-ready .dot{background:var(--ready)}
.status-delivered .dot{background:var(--delivered)}
.status-paid .dot{background:var(--paid)}
.dot{width:10px;height:10px;border-radius:999px;display:inline-block;margin-inline-start:6px}

/* ===== Order card ===== */
.order{
  border-radius:14px;padding:10px;margin-bottom:10px;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
  transition:transform .06s ease, box-shadow .15s ease
}
.order:hover{transform:translateY(-1px);box-shadow:0 10px 24px rgba(15,23,42,.1)}
.order .head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.order .who{font-weight:900;font-size:16px;line-height:1.3}
.order .meta{font-size:12px;color:var(--muted)}
.order .items{margin-top:6px;color:#0b1220}
.order .items div{padding:4px 0;border-bottom:1px dashed #eef2f7}
.order .actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.order .actions .btn{padding:8px 10px;border-radius:10px}

.note{
  margin-top:6px;padding:8px 10px;border-radius:10px;font-size:13px;line-height:1.4;
  border:1px dashed #d6dbe3;background:#f8fafc;color:#0f172a
}
.order-note{border-color:#93c5fd;background:#eff6ff}
.item-note{border-color:#fde68a;background:#fefce8}

/* ===== Summary cards ===== */
.summary{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px
}
.summary .card{
  display:flex;align-items:center;justify-content:space-between;padding:12px;border-radius:14px
}
.summary .title{font-weight:900;color:var(--ink)}
.summary .right{text-align:end}
.summary .amt{font-size:20px;font-weight:900}
.summary .sub{font-size:12px;color:var(--muted)}
.summary .paid .amt{color:var(--paid)}
.summary .deliv .amt{color:var(--delivered)}

/* ===== Clock ===== */
.clock{
  display:flex; flex-direction:column; justify-content:center;
  margin-inline-start:auto; padding-inline:12px; text-align:end; line-height:1.1;
}
.clock .time{font-size:2.4rem;font-weight:800;letter-spacing:.5px}
.clock .date{font-size:1rem;opacity:.8}
@media (max-width: 720px){
  .clock .time{font-size:1.8rem}
  .clock .date{font-size:.9rem}
}

/* ===== Toast ===== */
.toast{
  position:fixed;inset-inline-end:16px;inset-block-end:16px;
  background: linear-gradient(180deg,#10b981,#059669);
  color:#fff; padding:12px 14px;border-radius:14px;box-shadow:var(--shadow);
  display:none; z-index:9999; font-weight:900; min-width:200px; text-align:center
}

/* Focus ring */
:is(button,select,input):focus-visible{outline:none;box-shadow:0 0 0 4px rgba(14,165,233,.25)}

/* ===== Login (מודרני, רגוע, עם Glass) ===== */
.hidden{ display:none !important; }

.login-backdrop{
  position: fixed; inset: 0;
  display: none; /* JS toggles to flex */
  align-items: center; justify-content: center; z-index: 2000;
  background:
    radial-gradient(1000px 700px at 80% -10%, #a5b4fc40 0%, transparent 60%),
    radial-gradient(900px 600px at 15% 10%,  #7dd3fc40 0%, transparent 60%),
    radial-gradient(900px 620px at 50% 110%, #86efac40 0%, transparent 65%),
    linear-gradient(160deg, #eef2ff 0%, #f0f9ff 45%, #f7fee7 100%);
}

.login-card{
  width: min(92vw, 440px);
  background: rgba(255,255,255,0.78);
  border: 1px solid #e8eef6;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15,23,42,.10);
  padding: 22px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: login-pop .18s ease-out both;
}

@keyframes login-pop{
  from{ transform: translateY(10px) scale(.98); opacity:0 }
  to  { transform: translateY(0)    scale(1);   opacity:1 }
}

.login-head{ display:flex; align-items:center; gap:10px; margin-bottom:10px }
.login-head .logo{
  width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-size:18px;
  background: linear-gradient(180deg,#eef2ff,#e0e7ff);
  border: 1px solid #e5e7eb;
}
.login-card h2{ margin:0 0 8px; font-size:22px }
.login-card p { margin:0 0 14px; color:#546e7a }

.login-card .row{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px }
.login-card input{
  padding: 10px 12px; border: 1px solid #e6e9f2; border-radius: 12px; font-size: 15px;
  background: #ffffffcc;
}
.login-card .actions{ display:flex; gap:8px; margin-top:6px; align-items:center }
#authMsg{ color:#d32f2f; font-weight:700; min-height: 18px }
.login-foot{ display:flex; justify-content:space-between; align-items:center; margin-top:8px; color:#607d8b; font-size:13px }

/* ===== User badge + logout ליד הלוגו ===== */
.userbox{ display:flex; align-items:center; gap:8px }
.user-badge{
  display:none; align-items:center; gap:8px;
  background:#f3f4f6; border:1px solid var(--ring); padding:6px 10px; border-radius:999px;
  font-weight:800;
}
.user-badge .dot{ width:8px; height:8px; border-radius:999px; background: var(--muted) }
.user-badge .dot-on{ background: var(--success) }
.btn-logout{
  background:#fff; color:var(--danger); border:1px solid var(--danger);
  border-radius:12px; padding:6px 10px; font-weight:800; cursor:pointer;
}

/* ===== Toolbar bits ===== */
.toolbar{ margin:8px 0 14px; display:flex; gap:8px; flex-wrap:wrap }
.search-input{ min-width:230px }
.status-msg{ margin-inline-start:auto; color: var(--muted) }
