:root{
  --bg:#0b1220;
  --panel:#152238;
  --panel2:#1b2a42;
  --border:#2a3a52;
  --text:#f4f7fb;
  --muted:#91a3ba;
  --primary:#ffab00;
  --green:#31d67b;
  --purple:#ad70f4;
  --blue:#369cff;
  --cyan:#3ad7e3;
  --shadow:0 14px 34px rgba(0,0,0,.18);
}

*{box-sizing:border-box}
html{color-scheme:dark}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
button,input,select{font:inherit}
a{color:inherit;text-decoration:none}
svg{width:20px;height:20px}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:220px 1fr;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:20px 14px 16px;
  background:linear-gradient(180deg,#0f192a,#0b1423);
  border-right:1px solid rgba(255,255,255,.05);
  display:flex;
  flex-direction:column;
  z-index:20;
}

.brand{
  padding:14px 8px 22px;
  border-bottom:1px solid rgba(255,255,255,.06);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.brand-logo{
  width:126px;
  height:auto;
  max-height:none;
  display:block;
  margin:0 auto 12px;
  object-fit:contain;
  object-position:center;
}

.brand span{
  display:block;
  color:var(--primary);
  font-weight:800;
  font-size:18px;
  line-height:1.2;
  margin:0;
  text-align:center;
}

.nav{
  display:grid;
  gap:5px;
  margin-top:20px;
}

.nav-item,
.sidebar-footer button{
  width:100%;
  min-height:44px;
  padding:0 12px;
  display:flex;
  align-items:center;
  gap:12px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#d8e1ec;
  cursor:pointer;
  text-align:left;
}

.nav-item:hover,
.sidebar-footer button:hover{
  background:rgba(255,255,255,.05);
}

.nav-item.active{
  background:#1b2a3e;
  color:var(--primary);
  font-weight:700;
}

.nav-item svg,
.sidebar-footer button svg{
  width:19px;
  height:19px;
  flex:0 0 auto;
}

.sidebar-footer{
  margin-top:auto;
  display:grid;
  gap:5px;
  border-top:1px solid rgba(255,255,255,.06);
  padding-top:13px;
}

.sidebar-footer small{
  color:#6f8198;
  padding:10px 12px 0;
}

main{
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  min-height:88px;
  padding:18px 28px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  background:rgba(11,18,32,.78);
  backdrop-filter:blur(16px);
  position:sticky;
  top:0;
  z-index:10;
}

.topbar h1{
  margin:0;
  font-size:26px;
  letter-spacing:-.03em;
}

.topbar p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.title-wrap,
.user-area{
  display:flex;
  align-items:center;
  gap:12px;
}

.user-area{gap:10px}

.avatar{
  width:42px;
  height:42px;
  border-radius:50%;
  background:linear-gradient(135deg,#d5dbe3,#79879b);
  color:#101827;
  display:grid;
  place-items:center;
  font-weight:800;
}

.user-copy{
  display:grid;
  gap:2px;
}

.user-copy span{
  color:var(--muted);
  font-size:12px;
}

.bell,
.mobile-menu{
  position:relative;
  width:42px;
  height:42px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  display:grid;
  place-items:center;
  cursor:pointer;
}

.bell b{
  position:absolute;
  top:-6px;
  right:-5px;
  background:var(--primary);
  color:#111827;
  border-radius:999px;
  font-size:10px;
  min-width:18px;
  height:18px;
  display:grid;
  place-items:center;
}

.mobile-menu{display:none}

.page{
  padding:20px 24px 28px;
}

.summary-grid{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
}

.summary-grid>article{
  min-height:110px;
  padding:17px;
  border:1px solid var(--border);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(255,255,255,.025),transparent),var(--panel);
  display:flex;
  gap:13px;
  box-shadow:var(--shadow);
}

.summary-grid article>div:last-child{display:grid}

.summary-grid span{
  color:#c8d2df;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:10px;
  font-weight:700;
}

.summary-grid strong{
  font-size:28px;
  margin:5px 0 8px;
}

.summary-grid a,
.panel header a,
.panel footer a{
  color:#4aa3ff;
  font-size:12px;
}

.icon{
  width:46px;
  height:46px;
  border-radius:50%;
  display:grid;
  place-items:center;
  border:1px solid currentColor;
  flex:0 0 auto;
}

.blue{color:#4ba3ff}
.green{color:#3ddc83}
.purple{color:#b97cff}
.amber{color:#ffae2b}
.cyan{color:#3ad7e3}
.slate{color:#b8c7da}

.icon.blue{background:rgba(47,140,255,.15)}
.icon.green{background:rgba(39,194,108,.14)}
.icon.purple{background:rgba(155,93,229,.14)}
.icon.amber{background:rgba(245,158,11,.14)}
.icon.cyan{background:rgba(34,199,214,.13)}
.icon.slate{background:rgba(148,163,184,.12)}

.dashboard-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,1fr) minmax(320px,.95fr);
  gap:16px;
  align-items:stretch;
}

.panel{
  border:1px solid var(--border);
  border-radius:12px;
  background:linear-gradient(180deg,rgba(255,255,255,.02),transparent),var(--panel);
  overflow:hidden;
  box-shadow:var(--shadow);
}

.panel header{
  min-height:54px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--border);
}

.panel h2{
  margin:0;
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.02em;
}

.panel header select{
  background:var(--panel2);
  border:1px solid var(--border);
  border-radius:7px;
  padding:7px 9px;
}

.panel footer{
  min-height:48px;
  padding:0 16px;
  border-top:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.panel footer button{
  border:0;
  background:transparent;
  color:#4aa3ff;
  cursor:pointer;
}

.panel footer.center{justify-content:center}

.fermentations{grid-column:1}
.chart{grid-column:2}
.tasks{grid-column:3}
.inventory{grid-column:1}
.package{grid-column:2}
.alerts{grid-column:3}
.vessels{grid-column:1/4}

.ferment-row{
  min-height:92px;
  padding:14px 16px;
  display:grid;
  grid-template-columns:46px minmax(160px,1fr) 70px 82px auto;
  align-items:center;
  gap:12px;
  border-bottom:1px solid var(--border);
}

.round{
  width:42px;
  height:42px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.05);
}

.batch{
  display:grid;
  gap:4px;
}

.batch span,
.batch small,
.metric span{
  color:var(--muted);
  font-size:11px;
}

.metric{
  display:grid;
  gap:2px;
}

.metric strong{font-size:17px}

.metric span{
  text-transform:uppercase;
  font-size:10px;
}

.pill{
  padding:6px 9px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  font-style:normal;
  white-space:nowrap;
}

.pill.green{background:rgba(39,194,108,.18)}
.pill.purple{background:rgba(155,93,229,.18)}
.pill.blue{background:rgba(47,140,255,.18)}

.legend{
  display:flex;
  gap:16px;
  padding:12px 16px 0;
  color:#c8d2df;
  font-size:10px;
  flex-wrap:wrap;
}

.legend span{
  display:flex;
  align-items:center;
  gap:6px;
}

.dot{
  width:9px;
  height:9px;
  border-radius:2px;
  display:inline-block;
}

.dot.green{background:var(--green)}
.dot.purple{background:var(--purple)}
.dot.blue-dot{background:var(--blue)}

.chart>svg{
  width:100%;
  height:260px;
  padding:8px 12px;
}

.grid-lines line{
  stroke:#2a3a52;
  stroke-width:1;
}

.graph{
  fill:none;
  stroke-width:4;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.graph.green{stroke:var(--green)}
.graph.purple{stroke:var(--purple)}
.graph.blue-line{
  stroke:var(--blue);
  stroke-dasharray:7 7;
}

.tasks label{
  min-height:48px;
  padding:0 16px;
  display:grid;
  grid-template-columns:20px 1fr auto;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--border);
  cursor:pointer;
}

.tasks input{
  appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  border:1px solid #708198;
}

.tasks input:checked{border:5px solid var(--green)}
.tasks span{font-size:12px}

.tasks em{
  font-style:normal;
  color:var(--primary);
  font-size:10px;
}

.tasks em.muted{color:var(--muted)}

.lower-panel{
  min-height:312px;
  display:flex;
  flex-direction:column;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,
td{
  padding:11px 14px;
  border-bottom:1px solid var(--border);
  font-size:11px;
  text-align:left;
}

th{
  color:var(--muted);
  text-transform:uppercase;
  font-size:9px;
}

.low{
  color:var(--primary);
  font-weight:700;
}

.ok{
  color:var(--green);
  font-weight:700;
}

.package{
  padding-bottom:0;
}

.package-list{
  padding:12px 14px 14px;
  display:grid;
  gap:12px;
  align-content:start;
  flex:1;
}

.package-list>article{
  min-height:78px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--panel2);
  display:grid;
  grid-template-columns:44px 1fr auto auto;
  gap:12px;
  align-items:center;
}

.package-list article>div:nth-child(2),
.package-list article>div:nth-child(3){
  display:grid;
  gap:4px;
}

.package span{
  color:var(--muted);
  font-size:10px;
}

.package-icon{
  width:42px;
  height:42px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.06);
}

.alerts>article{
  min-height:62px;
  padding:10px 14px;
  display:grid;
  grid-template-columns:20px 1fr auto;
  gap:10px;
  align-items:center;
  border-bottom:1px solid var(--border);
}

.alerts article>svg{
  color:var(--primary);
  width:17px;
}

.alerts article div{
  display:grid;
  gap:3px;
}

.alerts strong{font-size:11px}

.alerts span,
.alerts time{
  color:var(--muted);
  font-size:9px;
}

.vessel-grid{
  padding:14px;
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:10px;
}

.vessel{
  min-height:176px;
  border:1px solid currentColor;
  border-radius:10px;
  padding:14px 12px 0;
  display:grid;
  justify-items:center;
  align-content:start;
  gap:6px;
  background:rgba(255,255,255,.025);
  text-align:center;
}

.vessel>svg{
  width:26px;
  height:26px;
}

.vessel strong{
  color:var(--text);
  font-size:11px;
}

.vessel>span,
.vessel>small{
  font-size:9px;
}

.vessel>small{color:var(--muted)}

.vessel-readings{
  width:calc(100% + 24px);
  min-height:38px;
  margin-top:auto;
  padding:0 10px;
  border-top:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:#d9e4ef;
}

.vessel-readings span{
  display:flex;
  align-items:center;
  gap:4px;
  font-size:9px;
  white-space:nowrap;
}

.vessel-readings svg{
  width:13px;
  height:13px;
}

.vessel.empty{
  color:#607289;
  border-style:dashed;
  padding-bottom:14px;
  align-content:center;
}

.vessel.empty>svg{
  width:34px;
  height:34px;
}

.app-footer{
  margin-top:auto;
  border-top:1px solid var(--border);
  min-height:52px;
  display:grid;
  place-items:center;
  color:#6f8198;
  font-size:11px;
}

.sidebar.collapsed{
  width:76px;
  padding-left:12px;
  padding-right:12px;
}

.sidebar.collapsed .brand{padding:10px 0 18px}
.sidebar.collapsed .brand-logo{width:48px;margin:0 auto}

.sidebar.collapsed .brand span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-footer button span,
.sidebar.collapsed small{
  display:none;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .sidebar-footer button{
  justify-content:center;
  padding:0;
}

.app-shell.sidebar-collapsed{
  grid-template-columns:76px 1fr;
}

.overlay{display:none}

@media(max-width:1500px){
  .summary-grid{grid-template-columns:repeat(3,1fr)}
  .vessel-grid{grid-template-columns:repeat(3,1fr)}
}

@media(max-width:1250px){
  .dashboard-grid{grid-template-columns:1fr 1fr}
  .fermentations,.inventory{grid-column:1}
  .chart,.package{grid-column:2}
  .tasks,.alerts,.vessels{grid-column:1/3}
  .lower-panel{min-height:auto}
}

@media(max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{
    position:fixed;
    left:-240px;
    width:220px;
    transition:left .2s;
  }
  .sidebar.mobile-open{left:0}
  .mobile-menu{display:grid}
  .overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    z-index:15;
  }
  .overlay.show{display:block}
  .topbar{padding:14px 18px}
  .page{padding:16px}
}

@media(max-width:760px){
  .summary-grid{grid-template-columns:1fr 1fr}
  .dashboard-grid{grid-template-columns:1fr}
  .fermentations,
  .chart,
  .tasks,
  .inventory,
  .package,
  .alerts,
  .vessels{
    grid-column:1;
  }
  .ferment-row{grid-template-columns:42px 1fr auto}
  .metric{display:none}
  .vessel-grid{grid-template-columns:1fr 1fr}
  .user-copy{display:none}
}

@media(max-width:480px){
  .summary-grid{grid-template-columns:1fr}
  .topbar h1{font-size:21px}
  .topbar p{display:none}
  .vessel-grid{grid-template-columns:1fr}
  .package-list>article{grid-template-columns:40px 1fr auto}
  .package .pill{display:none}
}
