:root {
  --bg: #f4f4f1;
  --surface: rgba(255,255,255,.80);
  --surface-solid: #ffffff;
  --ink: #181816;
  --muted: #73736d;
  --muted-soft: #9a9a94;
  --line: rgba(24,24,22,.08);
  --line-strong: rgba(24,24,22,.13);
  --green: #2e8b57;
  --amber: #c47b14;
  --red: #c7463a;
  --blue: #3f6fa9;
  --shadow: 0 24px 74px rgba(32,30,24,.08), 0 3px 12px rgba(32,30,24,.04);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(255,255,255,.96), transparent 34rem),
    linear-gradient(180deg, #f7f7f4 0%, var(--bg) 72%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 42px 34px;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(247,247,244,.95) 60%, rgba(247,247,244,0));
  backdrop-filter: blur(18px);
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 13px;
  background: #20201e;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-mark svg { width: 24px; height: 24px; display: block; }
.brand-mark svg path {
  fill: none;
  stroke: #f6f6f1;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-text, .brand-login > div:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 17px; letter-spacing: -.025em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 5px; text-transform: uppercase; letter-spacing: .11em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill, .icon-button {
  height: 42px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(30,30,28,.03);
  backdrop-filter: blur(14px);
}
.live-pill { border-radius: 999px; display: flex; align-items: center; padding: 0 14px; gap: 8px; font-size: 12px; color: var(--muted); }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(46,139,87,.10); }
.live-pill span { letter-spacing: .12em; font-weight: 750; color: var(--green); }
.live-pill b { font-size: 13px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.icon-button { width: 42px; border-radius: 50%; display:grid; place-items:center; }
.icon-button svg { width:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

.content { padding-top: 38px; flex: 1; }
.hero-row { display:flex; align-items:flex-end; justify-content:space-between; gap:30px; margin-bottom:32px; }
.eyebrow { margin:0 0 9px; text-transform:uppercase; letter-spacing:.13em; font-size:11px; font-weight:780; color:var(--muted); }
h1,h2,h3,p { letter-spacing:-.025em; }
.health-headline {
  margin: 0;
  font-size: clamp(36px, 4vw, 56px);
  line-height: .98;
  font-weight: 650;
  letter-spacing: -.055em;
}
.health-primary, .health-secondary { display: inline; }
.health-secondary {
  font-weight: 620;
  color: #2a2a27;
}
.health-secondary::before {
  content: '·';
  margin: 0 .18em 0 .24em;
  color: var(--muted-soft);
  font-weight: 460;
}
.today-summary { display:flex; flex-direction:column; align-items:flex-end; gap:5px; padding-bottom:5px; }
.today-summary span, .muted { color:var(--muted); font-size:14px; }
.today-summary strong { font-size:20px; letter-spacing:-.035em; }

.machine-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.machine-card {
  appearance: none;
  width: 100%;
  text-align:left;
  border:1px solid var(--line);
  border-radius:var(--radius-xl);
  padding:27px;
  background:var(--surface);
  box-shadow:0 2px 12px rgba(32,30,24,.025);
  backdrop-filter:blur(16px);
  cursor:pointer;
  transition:transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
  min-width:0;
}
.machine-card:hover { transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--line-strong); background:rgba(255,255,255,.95); }
.machine-card:focus-visible { outline:3px solid rgba(63,111,169,.22); outline-offset:3px; }
.card-topline { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.card-topline h3 { margin:0; font-size:23px; letter-spacing:-.045em; }
.card-topline p { margin:6px 0 0; color:var(--muted); font-size:14px; }
.chevron { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:rgba(24,24,22,.04); font-size:16px; color:var(--muted); transition:.2s ease; }
.machine-card:hover .chevron { background:var(--ink); color:white; transform:rotate(8deg); }
.status-row { margin-top:23px; display:flex; align-items:center; gap:9px; min-height:21px; font-size:14px; }
.status-row i { flex:0 0 auto; width:9px; height:9px; border-radius:50%; background:var(--muted); }
.status-row strong { font-weight:740; }
.status-row span { color:var(--muted); }
.status-online i { background:var(--green); box-shadow:0 0 0 4px rgba(46,139,87,.09); }
.status-attention i { background:var(--amber); box-shadow:0 0 0 4px rgba(196,123,20,.10); }
.status-error i { background:var(--red); box-shadow:0 0 0 4px rgba(199,70,58,.09); }
.status-service i { background:var(--blue); }
.attention-note { margin-top:15px; padding:12px 13px; border-radius:14px; background:rgba(196,123,20,.08); color:#8b570c; font-size:13px; line-height:1.4; }
.card-kpis { display:grid; grid-template-columns:.8fr 1.2fr; gap:22px; margin:30px 0 26px; }
.card-kpis div { display:flex; flex-direction:column; min-width:0; }
.card-kpis strong { font-size:31px; font-weight:630; letter-spacing:-.055em; white-space:nowrap; font-variant-numeric: tabular-nums; }
.card-kpis span { color:var(--muted); font-size:14px; margin-top:4px; line-height:1.2; }
.mini-stock-list { display:grid; gap:19px; padding-top:22px; border-top:1px solid var(--line); }
.mini-stock-row { display:flex; justify-content:space-between; align-items:center; gap:12px; font-size:15px; margin-bottom:9px; }
.mini-stock-row span { color:#595954; font-weight:560; }
.mini-stock-row b { font-weight:700; font-variant-numeric: tabular-nums; }
.progress { height:12px; background:rgba(24,24,22,.075); border-radius:999px; overflow:hidden; }
.progress i { display:block; height:100%; border-radius:inherit; background:#6e6f6a; transition: width .35s ease; }
.mini-stock.warning .progress i, .drawer-stock.warning .progress i { background:var(--amber); }
.mini-stock.warning .mini-stock-row b { color:var(--amber); }
.card-footer { display:flex; justify-content:space-between; gap:16px; margin-top:23px; color:var(--muted); font-size:13px; border-top:1px solid var(--line); padding-top:18px; line-height:1.35; }
.card-footer span:first-child { font-weight:620; color:#62625d; }

.events-section { margin-top:60px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:18px; }
.section-heading h2, .section-heading h3 { margin:0; font-size:21px; letter-spacing:-.04em; }
.events-list { background:rgba(255,255,255,.58); border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden; }
.event-row { display:grid; grid-template-columns:10px 52px 105px 1fr; align-items:center; gap:13px; min-height:62px; padding:0 21px; border-bottom:1px solid var(--line); font-size:14px; }
.event-row:last-child { border-bottom:0; }
.event-dot { width:8px; height:8px; border-radius:50%; background:var(--muted); }
.event-warning { background:var(--amber); }
.event-online { background:var(--green); }
.event-service { background:var(--blue); }
.event-time { color:var(--muted); font-variant-numeric:tabular-nums; }
.event-copy { color:#5f5f5a; }

.site-footer { padding:48px 0 8px; text-align:center; color:#a1a19a; font-size:11px; letter-spacing:.01em; }

.drawer-backdrop { position:fixed; inset:0; z-index:40; background:rgba(30,29,26,.16); backdrop-filter:blur(7px); opacity:0; transition:opacity .26s ease; }
.drawer-backdrop.visible { opacity:1; }
.machine-drawer {
  position:fixed;
  z-index:50;
  top:12px;
  right:12px;
  bottom:12px;
  width:min(800px,calc(100vw - 24px));
  background:rgba(251,251,248,.97);
  border:1px solid rgba(255,255,255,.78);
  border-radius:30px;
  box-shadow:0 30px 100px rgba(27,26,22,.22);
  backdrop-filter:blur(30px);
  overflow:auto;
  overscroll-behavior:contain;
  transform:translateX(calc(100% + 24px));
  transition:transform .32s cubic-bezier(.2,.8,.2,1);
  padding:30px;
}
.machine-drawer.open { transform:translateX(0); }
body.drawer-open { overflow:hidden; }
.drawer-handle { display:none; }
.drawer-header { display:flex; justify-content:space-between; gap:30px; align-items:flex-start; padding:4px 2px 24px; }
.drawer-header h2 { margin:0; font-size:43px; letter-spacing:-.055em; }
.drawer-header .status-row { margin-top:14px; font-size:15px; }
.drawer-close { width:40px; height:40px; border:0; border-radius:50%; background:rgba(24,24,22,.06); font-size:28px; line-height:1; cursor:pointer; font-weight:300; }
.drawer-alert { padding:16px 17px; border-radius:16px; background:rgba(196,123,20,.09); border:1px solid rgba(196,123,20,.12); display:flex; gap:8px; flex-direction:column; margin-bottom:19px; }
.drawer-alert strong { font-size:13px; color:#8b570c; }
.drawer-alert span { font-size:14px; }
.drawer-kpis { display:grid; grid-template-columns:.7fr 1fr 1.2fr; gap:11px; margin:4px 0 35px; }
.drawer-kpis > div { min-height:128px; border-radius:21px; background:white; border:1px solid var(--line); padding:19px; display:flex; flex-direction:column; justify-content:flex-end; }
.drawer-kpis span, .drawer-kpis small { color:var(--muted); font-size:13px; }
.drawer-kpis strong { margin:auto 0 4px; font-size:28px; letter-spacing:-.05em; font-variant-numeric: tabular-nums; }
.drawer-section { border-top:1px solid var(--line); padding:30px 2px 31px; }
.section-heading.compact { margin-bottom:21px; }
.section-heading.compact h3 { font-size:20px; }
.drawer-stock-list { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.drawer-stock { border-radius:19px; border:1px solid var(--line); background:white; padding:18px; }
.drawer-stock-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.drawer-stock-head > div { display:flex; flex-direction:column; gap:5px; }
.drawer-stock-head span { color:var(--muted); font-size:13px; }
.drawer-stock-head strong { font-size:23px; letter-spacing:-.04em; font-variant-numeric: tabular-nums; }
.drawer-stock-head > b { font-size:14px; font-variant-numeric: tabular-nums; }
.progress.large { margin-top:17px; height:13px; }
.drawer-stock small { display:block; color:#96968f; font-size:11px; margin-top:10px; }
.two-column { display:grid; grid-template-columns:1fr 1fr; gap:30px; }
.health-list { background:white; border:1px solid var(--line); border-radius:19px; overflow:hidden; }
.health-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:16px 16px; border-bottom:1px solid var(--line); font-size:15px; min-height:58px; }
.health-row:last-child { border-bottom:0; }
.health-name { color:var(--muted); }
.health-state { display:flex; align-items:center; justify-content:flex-end; gap:9px; font-weight:690; text-align:right; }
.health-icon { width:22px; height:22px; flex:0 0 22px; border-radius:50%; display:grid; place-items:center; line-height:1; }
.health-icon svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2.1; stroke-linecap:round; stroke-linejoin:round; }
.health-success .health-icon { color:var(--green); background:rgba(46,139,87,.11); }
.health-success .health-state { color:#286f49; }
.health-warning .health-icon { color:#9b650f; background:rgba(196,123,20,.13); }
.health-warning .health-state { color:#8b570c; }
.health-neutral .health-icon { color:#676761; background:rgba(24,24,22,.07); }
.health-neutral .health-state { color:#54544f; }
.health-error .health-icon { color:var(--red); background:rgba(199,70,58,.12); }
.health-error .health-state { color:#a03c33; }

.drink-list { display:grid; gap:18px; }
.drink-row { display:grid; gap:8px; }
.drink-meta { display:flex; align-items:center; justify-content:space-between; gap:14px; font-size:14px; }
.drink-meta span { color:#595954; }
.drink-meta strong { font-weight:690; font-variant-numeric: tabular-nums; }
.drink-progress { height:11px; border-radius:999px; background:rgba(24,24,22,.065); overflow:hidden; }
.drink-progress i { display:block; height:100%; background:#72736d; border-radius:999px; }

.service-card { display:flex; align-items:center; justify-content:space-between; gap:25px; }
.service-card h3 { margin:0 0 6px; font-size:20px; }
.service-card p:last-child { margin:0; color:var(--muted); font-size:13px; max-width:450px; line-height:1.55; }
.service-card button { border:0; border-radius:999px; padding:12px 18px; background:rgba(24,24,22,.07); color:#999993; cursor:not-allowed; }

.login-body { display:grid; place-items:center; min-height:100vh; padding:24px; }
.login-shell { width:min(100%,430px); }
.login-card { background:rgba(255,255,255,.78); border:1px solid rgba(255,255,255,.88); box-shadow:var(--shadow); backdrop-filter:blur(22px); border-radius:30px; padding:35px; }
.brand-login { margin-bottom:47px; }
.login-copy h1 { margin:0; font-size:36px; letter-spacing:-.055em; }
.login-copy p { margin:10px 0 28px; color:var(--muted); font-size:14px; line-height:1.5; }
.login-form { display:grid; gap:14px; }
.login-form label { display:grid; gap:8px; }
.login-form label span { font-size:12px; color:var(--muted); font-weight:650; margin-left:3px; }
.login-form input { width:100%; height:50px; border-radius:14px; border:1px solid var(--line-strong); background:rgba(255,255,255,.80); padding:0 14px; color:var(--ink); outline:none; transition:.2s ease; font-size:15px; }
.login-form input:focus { border-color:rgba(24,24,22,.35); box-shadow:0 0 0 4px rgba(24,24,22,.045); }
.login-form button { height:50px; border:0; border-radius:14px; margin-top:5px; background:#20201e; color:#fff; font-weight:680; cursor:pointer; transition:.2s ease; }
.login-form button:hover { transform:translateY(-1px); background:#0e0e0d; }
.login-error { margin:-10px 0 18px; padding:12px 13px; border-radius:13px; background:rgba(199,70,58,.08); color:#a13a31; font-size:12px; display:flex; flex-direction:column; gap:4px; }
.login-error strong { font-weight:700; }
.login-footnote { text-align:center; margin:23px 0 0; color:#aaa9a2; font-size:10px; text-transform:uppercase; letter-spacing:.12em; }

@media (max-width: 980px) {
  .app-shell { padding:0 22px 34px; }
  .machine-grid { grid-template-columns:1fr; }
  .machine-card { display:grid; grid-template-columns:1.1fr .72fr 1.25fr; column-gap:28px; align-items:start; }
  .machine-card .card-topline, .machine-card .status-row, .machine-card .attention-note, .machine-card .card-footer { grid-column:1; }
  .machine-card .card-kpis { grid-column:2; grid-row:1 / span 4; margin:0; display:flex; flex-direction:column; gap:20px; }
  .machine-card .mini-stock-list { grid-column:3; grid-row:1 / span 5; padding-top:0; border-top:0; }
  .machine-card .card-footer { margin-top:19px; flex-direction:column; gap:5px; }
}

@media (max-width: 680px) {
  .app-shell { padding:0 16px 26px; }
  .topbar { height:77px; }
  .brand strong { font-size:16px; }
  .brand-text small { display:none; }
  .live-pill { padding:0 11px; }
  .live-pill b { display:none; }
  .content { padding-top:25px; }
  .hero-row { align-items:flex-start; flex-direction:column; gap:20px; margin-bottom:25px; }
  .health-headline { max-width:330px; font-size: clamp(34px, 10vw, 42px); line-height: 1.01; }
  .health-primary, .health-secondary { display:block; }
  .health-secondary { margin-top:.1em; font-size:.84em; font-weight:590; color:#3a3a36; }
  .health-secondary::before { content:none; }
  .today-summary { align-items:flex-start; padding:0; }
  .today-summary span { font-size:13px; }
  .today-summary strong { font-size:19px; }
  .machine-grid { gap:14px; }
  .machine-card { display:block; padding:23px; border-radius:25px; }
  .card-topline h3 { font-size:24px; }
  .card-topline p { font-size:13px; }
  .machine-card .card-kpis { margin:27px 0 24px; display:grid; grid-template-columns:.78fr 1.22fr; }
  .card-kpis strong { font-size:30px; }
  .card-kpis span { font-size:13px; }
  .machine-card .mini-stock-list { padding-top:20px; border-top:1px solid var(--line); gap:18px; }
  .mini-stock-row { font-size:14px; }
  .progress { height:13px; }
  .card-footer { flex-direction:column; gap:6px; font-size:12px; }
  .events-section { margin-top:44px; }
  .event-row { grid-template-columns:8px 44px 78px 1fr; padding:0 14px; gap:8px; font-size:12px; min-height:60px; }
  .site-footer { padding-top:38px; font-size:10px; line-height:1.45; }

  .machine-drawer { top:auto; left:0; right:0; bottom:0; width:100%; max-height:94vh; border-radius:28px 28px 0 0; padding:12px 18px 30px; transform:translateY(102%); }
  .machine-drawer.open { transform:translateY(0); }
  .drawer-handle { display:block; width:42px; height:5px; border-radius:999px; background:rgba(24,24,22,.14); margin:0 auto 17px; }
  .drawer-header { padding-top:0; }
  .drawer-header h2 { font-size:36px; }
  .drawer-header .status-row { font-size:14px; flex-wrap:wrap; }
  .drawer-kpis { grid-template-columns:1fr 1fr; }
  .drawer-kpis > div:last-child { grid-column:1 / -1; min-height:100px; }
  .drawer-kpis span, .drawer-kpis small { font-size:12px; }
  .drawer-kpis strong { font-size:26px; }
  .drawer-stock-list, .two-column { grid-template-columns:1fr; }
  .drawer-stock { padding:17px; }
  .drawer-stock-head span { font-size:13px; }
  .drawer-stock-head strong { font-size:22px; }
  .progress.large { height:14px; }
  .health-row, .drink-meta { font-size:14px; }
  .service-card { align-items:flex-start; flex-direction:column; }

  .login-card { padding:29px 23px; border-radius:25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; transition:none !important; }
}
