@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700;9..40,800&family=Outfit:wght@600;700;800&display=swap");

:root {
  --ember: #ff5c24;
  --ember-deep: #e03a00;
  --ink: #12151c;
  --ink-soft: #2a3140;
  --muted: #6b7385;
  --line: rgba(18, 21, 28, 0.12);
  --bg0: #c9d2de;
  --bg1: #e7edf5;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --green: #0d8a56;
  --danger: #d12b2b;
  --sky: #1f6f8f;
  --shadow: 0 28px 70px rgba(12, 16, 28, 0.16);
  --shadow-soft: 0 14px 36px rgba(12, 16, 28, 0.09);
  --radius: 26px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Outfit", var(--font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rim: linear-gradient(135deg, rgba(255, 92, 36, 0.95), rgba(240, 180, 41, 0.55), rgba(31, 111, 143, 0.35));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(900px 560px at -8% -20%, rgba(255, 92, 36, 0.26), transparent 55%),
    radial-gradient(820px 520px at 108% -10%, rgba(31, 111, 143, 0.2), transparent 52%),
    linear-gradient(165deg, #f4f7fb 0%, #e8eef6 42%, #d3dce8 100%);
  background-attachment: fixed;
  letter-spacing: -0.015em;
}
body.desk-dark {
  --bg0: #07090e;
  --bg1: #0d1118;
  --ink: #f4f6fb;
  --ink-soft: #d7dde8;
  --muted: #9aa3b5;
  --line: rgba(255, 255, 255, 0.1);
  --surface: rgba(20, 24, 34, 0.82);
  --surface-solid: #151a24;
  --shadow: 0 22px 56px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.3);
  background:
    radial-gradient(900px 560px at -10% -25%, rgba(255, 92, 36, 0.26), transparent 55%),
    radial-gradient(780px 480px at 110% -5%, rgba(31, 111, 143, 0.2), transparent 52%),
    linear-gradient(168deg, #10151f 0%, #0a0d13 48%, #07090e 100%);
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.brand, h1, h2, .desk-title {
  font-family: var(--display);
  letter-spacing: -0.05em;
}
.brand { font-weight: 800; }

.shell-header, .desk-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 10px 40px rgba(12, 16, 28, 0.05);
}
.desk-header .brand {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 0.92;
}
.desk-sub {
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
  margin-top: 4px;
}

.desk-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 12px 22px 4px;
  scrollbar-width: none;
  position: sticky;
  top: 68px;
  z-index: 25;
  background: linear-gradient(180deg, rgba(236, 241, 248, 0.95), rgba(236, 241, 248, 0.72));
  backdrop-filter: blur(12px);
}
.desk-tabs::-webkit-scrollbar { display: none; }
.desk-tabs button,
.desk-tabs a {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 750;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.desk-tabs button:hover,
.desk-tabs a:hover { transform: translateY(-1px); }
.desk-tabs button.active,
.desk-tabs a.active {
  background: linear-gradient(135deg, #151821, #2a3140);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 26px rgba(18, 21, 28, 0.22);
}

.desk-panel { display: none; animation: desk-rise 0.4s ease both; }
.desk-panel.active { display: block; }
@keyframes desk-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.desk-wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 12px 0 48px;
}

.panel, .col, section.card-block, #login, .menu .panel, .surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.surface-strong {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-block {
  position: relative;
  margin: 0 0 18px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.section-block::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--rim);
}
.section-block > h2 {
  margin: 0 0 6px;
  font-size: 26px;
}
.section-block > .lede {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 500;
  max-width: 52ch;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.tool-grid .ghost, .tool-grid button {
  width: 100%;
  justify-content: center;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 14px;
  font-weight: 750;
}
.primary {
  background: linear-gradient(135deg, #ff7a3d, var(--ember) 45%, var(--ember-deep));
  color: #fff;
  box-shadow: 0 12px 28px rgba(224, 58, 0, 0.3);
}
.ghost {
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  border: 1px solid var(--line);
}
.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f2c3bf;
}
label { display: block; margin: 12px 0; color: var(--muted); font-weight: 650; }
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #d0d8e4;
  background: linear-gradient(180deg, #fff, #f7f9fc);
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }

.banner {
  font-family: var(--display);
  font-weight: 800;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 16px;
  letter-spacing: -0.02em;
}
.banner.own {
  color: #7a2e12;
  background: linear-gradient(135deg, #ffe2d1, #fff7f2);
}
.banner.platform {
  color: #145c38;
  background: linear-gradient(135deg, #d9f5e5, #f3fcf7);
}
.kitchen-note {
  background: linear-gradient(135deg, #fff1e6, #fffaf5);
  border-left: 4px solid var(--ember);
  padding: 10px 12px;
  border-radius: 12px;
  margin: 8px 0;
}
.card.overdue {
  outline: 2px solid var(--danger);
  background: #fff8f7;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.stat {
  position: relative;
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(255, 92, 36, 0.12), transparent 60%),
    linear-gradient(180deg, #fff, #f4f7fb);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--rim);
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.03em;
}
.stat span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
table { width: 100%; border-collapse: collapse; }
td, th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.login-card {
  max-width: 440px;
  margin: 10vh auto;
  background: linear-gradient(180deg, #fff, #f7f9fc);
  padding: 32px;
  border-radius: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--rim);
}
.login-card h1 {
  margin: 0 0 8px;
  font-size: 40px;
}
.tabs button.active {
  background: var(--ink);
  color: #fff;
}
#alarm-banner {
  margin: 0 16px 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d12b2b, #ff5c24);
  color: #fff;
  font-weight: 800;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.group-title {
  margin: 18px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
}
.chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 750;
}
.chip.active {
  background: linear-gradient(135deg, var(--ember), var(--ember-deep));
  color: #fff;
  border-color: transparent;
}

.courier-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  font-weight: 700;
}
.courier-pill .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(13, 138, 86, 0.2);
}
.courier-pill.busy .dot {
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 92, 36, 0.22);
}
#map iframe {
  border-radius: 20px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-soft);
}

body.desk-dark .desk-header,
body.desk-dark .desk-tabs,
body.desk-dark .section-block,
body.desk-dark .surface-strong,
body.desk-dark .login-card,
body.desk-dark .panel,
body.desk-dark .stat,
body.desk-dark .courier-pill {
  background: linear-gradient(180deg, rgba(28, 34, 48, 0.96), rgba(18, 22, 32, 0.94));
  color: #f4f6fb;
  border-color: rgba(255, 255, 255, 0.08);
}
body.desk-dark .desk-tabs {
  background: rgba(10, 13, 20, 0.92);
}
body.desk-dark .desk-tabs a.active {
  background: linear-gradient(135deg, #ff7a3d, #e03a00);
  color: #fff;
}
body.desk-dark input,
body.desk-dark select,
body.desk-dark textarea {
  background: #0d1118;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
body.desk-dark .ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #f4f6fb;
  border-color: rgba(255, 255, 255, 0.1);
}
body.desk-dark .muted,
body.desk-dark .desk-sub { color: #9aa3b5; }

@media (max-width: 720px) {
  .desk-wrap { width: calc(100% - 16px); }
  .section-block { padding: 16px; }
  .desk-header { padding: 12px 14px; }
  .desk-tabs { padding-left: 14px; padding-right: 14px; top: 60px; }
}
