:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .08);
  --paper: rgba(255, 255, 255, .86);
  --paper-solid: #ffffff;
  --page: #eef1f4;
  --green: #1f9d55;
  --green-tint: rgba(31, 157, 85, .12);
  --amber: #c56a00;
  --amber-tint: rgba(197, 106, 0, .12);
  --red: #d70015;
  --red-tint: rgba(215, 0, 21, .10);
  --blue: #0066cc;
  --blue-tint: rgba(0, 102, 204, .10);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 1px rgba(0, 0, 0, .03), 0 10px 26px rgba(0, 0, 0, .07);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, .04), 0 18px 40px rgba(0, 0, 0, .11);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .04), 0 24px 64px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 12% -12%, rgba(90, 150, 255, .10), transparent 60%),
    radial-gradient(900px 480px at 100% 0%, rgba(70, 205, 155, .10), transparent 55%),
    var(--page);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Helvetica, Arial, sans-serif;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.01em;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-form {
  width: min(390px, 100%);
  padding: 34px 30px;
  display: grid;
  gap: 20px;
  background: var(--paper);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.login-form h1 { margin: 4px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.eyebrow, .identity p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.login-form label, .header-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
input, select {
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  color: var(--ink);
  background: rgba(0, 0, 0, .035);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:focus, select:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 102, 204, .14); }
.login-form button {
  min-height: 44px;
  color: #fff;
  background: linear-gradient(180deg, #22b366, var(--green));
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 8px 18px rgba(31, 157, 85, .28);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.login-form button:hover { filter: brightness(1.04); }
.login-form button:active { transform: scale(.98); box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 4px 10px rgba(31, 157, 85, .25); }
.form-error { min-height: 18px; margin: -6px 0; color: var(--red); font-size: 12px; }

.kitchen-logo {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 12px;
}
.login-form .kitchen-logo { width: 52px; height: 52px; border-radius: 14px; }

.kitchen-lock {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  background: rgba(0, 0, 0, .045);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}
.kitchen-lock-tag {
  padding: 3px 9px;
  background: var(--green);
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.kitchen-header {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 84px;
  padding: 12px clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: .5px solid var(--line);
}
.identity { min-width: 0; display: flex; align-items: center; gap: 13px; }
.identity h1 { margin: 2px 0 0; overflow: hidden; font-size: 21px; font-weight: 700; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.header-controls { display: flex; align-items: end; gap: 16px; }
.header-controls label { min-width: 210px; }
.header-controls select {
  min-height: 38px;
  padding-right: 30px;
  background: rgba(0, 0, 0, .04) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" fill="none" stroke="%236e6e73" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 11px center;
  border: 1px solid var(--line);
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
}
#kitchen-clock {
  min-width: 78px;
  padding: 6px 12px;
  color: var(--ink);
  background: rgba(0, 0, 0, .045);
  border-radius: 999px;
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.kitchen-content { width: min(1500px, 100%); margin: 0 auto; padding: 26px clamp(18px, 4vw, 54px) 50px; }
.kitchen-status { min-height: 34px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.kitchen-status > div { display: flex; align-items: center; gap: 9px; }
.kitchen-status strong { color: var(--ink); font-size: 14px; font-weight: 650; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint);
  animation: live-pulse 2.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--green-tint); }
  50% { box-shadow: 0 0 0 7px rgba(31, 157, 85, .05); }
}

.dlc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dlc-card {
  min-width: 0;
  min-height: 238px;
  padding: 19px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: .5px solid var(--line);
  border-top: 3px solid #a6aeaa;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease;
}
.dlc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.dlc-card.expired { border-top-color: var(--red); }
.dlc-card.urgent { border-top-color: #d4581e; }
.dlc-card.soon { border-top-color: var(--amber); }
.dlc-card.valid { border-top-color: var(--green); }
.dlc-card.pending { border-top-color: var(--blue); }
.card-top, .card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status {
  padding: 4px 10px;
  color: var(--muted);
  background: rgba(0, 0, 0, .045);
  border: none;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.expired .status, .urgent .status { color: var(--red); background: var(--red-tint); }
.soon .status { color: var(--amber); background: var(--amber-tint); }
.valid .status { color: var(--green); background: var(--green-tint); }
.pending .status { color: var(--blue); background: var(--blue-tint); }
.restaurant { max-width: 55%; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dlc-card h2 { margin: 20px 0 6px; overflow-wrap: anywhere; font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.countdown { margin: auto 0 18px; color: var(--ink); font-size: 33px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.countdown small { margin-top: 7px; display: block; color: var(--muted); font-size: 11px; font-weight: 550; letter-spacing: 0; }
.card-bottom { padding-top: 12px; border-top: .5px solid var(--line); color: var(--muted); font-size: 11px; }
.card-bottom strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.remove-dlc {
  width: 100%;
  min-height: 40px;
  margin-top: 14px;
  color: var(--red);
  background: var(--red-tint);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 650;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.remove-dlc:hover { color: #fff; background: var(--red); }
.remove-dlc:active { transform: scale(.98); }
.remove-dlc:focus-visible { outline: 3px solid rgba(215, 0, 21, .22); outline-offset: 2px; }
.remove-dlc:disabled { opacity: .55; cursor: wait; }
.empty-state {
  min-height: 300px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .5);
  border: 1px dashed rgba(0, 0, 0, .14);
  border-radius: var(--radius-lg);
}

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: .5px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 680px) {
  .kitchen-header { padding: 12px 14px; align-items: stretch; flex-direction: column; gap: 12px; }
  .header-controls { align-items: end; }
  .header-controls label { min-width: 0; flex: 1; }
  .kitchen-content { padding: 18px 12px 34px; }
  .dlc-grid { grid-template-columns: 1fr; gap: 10px; }
  .dlc-card { min-height: 210px; }
  .kitchen-status { align-items: flex-start; }
  .toast { top: auto; bottom: 18px; right: 18px; transform: translateY(8px); }
  .toast.show { transform: translateY(0); }
}

@media (min-width: 1500px) {
  .dlc-grid { grid-template-columns: repeat(4, minmax(280px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
