/* Gana Brew Lab — Fogli di stile (estratto da index.html il 2026-05-30) */
/* ── Design System (Light Theme Default) ── */
:root {
  --bg: #f4f7fa;
  --bg-sidebar: #2c3e50; /* Deep slate */
  --bg-sidebar-hover: #1e2b37;
  --bg-card: #ffffff;
  --bg-control: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --text: #2c3e50;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-sidebar: #a0aec0;
  
  --accent: #3b82f6; /* Dashboard Blue */
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.1);
  
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --orange: #ff9f43; /* Beer Amber */
  --purple: #8b5cf6;
  
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 10px 25px rgba(148, 163, 184, 0.06), 0 1px 3px rgba(148, 163, 184, 0.03);
  --border: 1px solid #e2e8f0;
}

/* ── Dark Theme override ── */
body.dark-theme {
  --bg: #0f172a; /* Slate 900 */
  --bg-sidebar: #1e293b; /* Slate 800 */
  --bg-sidebar-hover: #0f172a;
  --bg-card: #1e293b;
  --bg-control: #334155; /* Slate 700 */
  --bg-hover: #475569;
  
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.2);
  
  --border: 1px solid #334155;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ── Reset & Base ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
}

body, aside, header, main, section, .card, .temp-card, .status-widget, .btn, input, select, textarea, .pin-overlay, .console-wrap {
  transition: background 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ── App Layout (Triple Column, Collapsible Sidebar) ── */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr 300px; /* Sidebar | Main | Right widgets */
  min-height: 100vh;
  transition: grid-template-columns 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app-container.sidebar-collapsed {
  grid-template-columns: 70px 1fr 300px;
}

aside {
  background: var(--bg-sidebar);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.03);
  transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  width: 260px;
  overflow: hidden;
}
.sidebar-collapsed aside {
  width: 70px;
}

.sidebar-logo {
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  height: 80px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  flex-shrink: 0;
}
.sidebar-brand {
  transition: opacity 0.2s;
}
.sidebar-brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.sidebar-brand .subtitle {
  font-size: 0.6rem;
  color: var(--text-sidebar);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.toggle-sidebar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.toggle-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.toggle-sidebar-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.3s;
}
.sidebar-collapsed .toggle-sidebar-btn svg {
  transform: rotate(180deg);
}

.sidebar-menu {
  flex: 1;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.08em;
  padding: 10px 12px 6px;
  transition: opacity 0.2s;
}
.sidebar-collapsed .menu-label,
.sidebar-collapsed .sidebar-brand {
  opacity: 0;
  pointer-events: none;
  width: 0;
}
.sidebar-menu button {
  background: none;
  border: none;
  color: var(--text-sidebar);
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  transition: all 0.2s ease;
  width: 100%;
}
.sidebar-menu button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
  fill: none;
}
.sidebar-menu button span {
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sidebar-collapsed .sidebar-menu button span {
  opacity: 0;
  pointer-events: none;
}
.sidebar-collapsed .sidebar-menu button {
  justify-content: center;
  padding: 12px 0;
}
.sidebar-menu button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-menu button.active {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
header {
  background: var(--bg-card);
  padding: 16px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}
.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-control);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

main {
  padding: 24px 30px;
  width: 100%;
}
section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
section.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Right Status Sidebar ── */
.right-status-bar {
  background: var(--bg);
  border-left: var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.status-widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  border: var(--border);
  box-shadow: var(--shadow);
}
.sw-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sw-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 10px;
  background: var(--widget-accent, var(--accent));
  border-radius: 2px;
}
.sw-content {
  font-size: 0.85rem;
}
.sw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--bg-hover);
}
.sw-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.sw-label {
  color: var(--text-secondary);
}
.sw-val {
  font-weight: 700;
  color: var(--text);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  border: var(--border);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: 0 15px 35px rgba(148, 163, 184, 0.15);
}
.card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--accent-color, var(--accent));
  border-radius: 2px;
}

/* ── Temperature Cards & Gauges ── */
.temp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.temp-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.temp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(148, 163, 184, 0.18);
}
.temp-card.glow-green {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}
.temp-card.glow-blue {
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}
.temp-card.glow-red {
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.temp-label-top {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: block;
}
.gauge-wrapper {
  position: relative;
  width: 190px;
  height: 95px;
  margin: 0 auto 5px;
}
.gauge-svg {
  width: 100%;
  height: 100%;
}
.gauge-bg {
  fill: none;
  stroke: var(--bg-hover);
  stroke-width: 5;
  stroke-linecap: round;
  opacity: 0.65;
}
.gauge-fill {
  fill: none;
  stroke-width: 7.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.8s ease;
}
.gauge-inner {
  position: absolute;
  bottom: 8px; /* Centered inside the arc */
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.temp-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.85rem; /* Sized perfectly to avoid overlapping and borders */
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  transition: color 0.5s ease;
  margin-bottom: 2px;
}
.temp-val span {
  font-size: 0.6em;
  font-weight: 500;
  margin-left: 1px;
  vertical-align: super;
}
.temp-val.na {
  color: var(--text-muted);
  font-size: 1.4rem;
}
.temp-trend-comment {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 6px;
  display: block;
  min-height: 2.6em;
  line-height: 1.3;
  padding: 0 4px;
}
.gauge-tick-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 5.5px;
  font-weight: 700;
  fill: var(--text-secondary);
  transition: fill 0.5s ease;
}

/* ── Sparklines ── */
.sparkline-wrap {
  height: 80px;
  margin-top: 14px;
  position: relative;
  border-top: 1px dashed var(--bg-hover);
  padding-top: 10px;
}

/* ── Progress Indicators ── */
.progress-container {
  margin-top: 14px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.progress-bar-bg {
  height: 8px;
  background: var(--bg-control);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th {
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 10px 8px;
  border-bottom: 2px solid var(--bg-hover);
}
td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--bg-hover);
  color: var(--text);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.badge.ferm { background: rgba(255, 159, 67, 0.12); color: #e67e22; border-color: rgba(255, 159, 67, 0.2); }
.badge.mon { background: rgba(59, 130, 246, 0.1); color: var(--blue); border-color: rgba(59, 130, 246, 0.2); }
.badge.ok { background: rgba(16, 185, 129, 0.1); color: var(--green); border-color: rgba(16, 185, 129, 0.2); }
.badge.warn { background: rgba(245, 158, 11, 0.1); color: var(--orange); border-color: rgba(245, 158, 11, 0.2); }
.badge.err { background: rgba(239, 68, 68, 0.1); color: var(--red); border-color: rgba(239, 68, 68, 0.2); }

/* ── Console ── */
.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.con-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.console-wrap {
  background: #0f172a;
  border-radius: 10px;
  overflow-y: auto;
  max-height: 250px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
}
.con-entry {
  display: flex;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.con-ts { color: #64748b; white-space: nowrap; }
.con-type { font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.con-type.con-BOOT { background: rgba(16, 185, 129, 0.2); color: #2ecc71; }
.con-type.con-WIFI { background: rgba(16, 185, 129, 0.2); color: #2ecc71; }
.con-type.con-NTP { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.con-type.con-TEMP { background: rgba(255, 159, 67, 0.2); color: var(--orange); }
.con-type.con-CF { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.con-type.con-TG { background: rgba(139, 92, 246, 0.2); color: var(--purple); }
.con-type.con-ALARM { background: rgba(239, 68, 68, 0.25); color: #ef4444; }
.con-type.con-SLEEP { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.con-type.con-ERR { background: rgba(239, 68, 68, 0.25); color: #ef4444; }
.con-type.con-INFO { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.con-msg { color: #f1f5f9; }

/* ── Wi-Fi Signal blink keyframes ── */
@keyframes wifi-blink {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

/* ── PIN Overlay ── */
.pin-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  z-index: 10;
  border-radius: var(--radius-lg);
  padding: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
}
.pin-overlay.show { display: flex; }
.pin-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pin-sub { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 24px; text-align: center; }
.pin-dots { display: flex; gap: 16px; margin-bottom: 32px; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--bg-control); border: 1px solid var(--text-muted); transition: all 0.15s ease; }
.pin-dot.filled { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.pin-dot.shake { animation: pinShake 0.3s ease; }
@keyframes pinShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; width: 240px; }
.pin-btn { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 600; width: 58px; height: 58px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; margin: 0 auto; transition: all 0.2s ease; }
.pin-btn:hover { background: var(--bg-hover); }
.pin-btn:active { transform: scale(0.9); background: rgba(59, 130, 246, 0.1); }
.pin-btn.del { font-size: 0.72rem; color: var(--text-secondary); border: none; background: transparent; }
.pin-btn.enter { background: var(--accent); color: #fff; border: none; font-size: 0.8rem; font-weight: 700; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.pin-err { color: var(--red); font-size: 0.8rem; margin-top: 16px; font-weight: 600; min-height: 1.2em; }

/* ── Control Panel Tab CSS ── */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 10px;
}
.admin-tabs button {
  background: var(--bg-control);
  color: var(--text-secondary);
  border: var(--border);
  font-weight: 700;
}
.admin-tabs button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cmd-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; border: var(--border); display: flex; flex-direction: column; justify-content: space-between; }
.cc-title { font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.pending-cmd {
  background: var(--bg-control);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  border-left: 4px solid var(--accent);
}
.pending-cmd .cmd-name { color: var(--accent); font-weight: 600; }
.pending-cmd .cmd-val { color: var(--text-secondary); }

/* ── Forms, Buttons & Modals ── */
.btn { padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; font-family: inherit; transition: all 0.25s ease; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-primary { background: var(--accent); color: #ffffff; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-control); color: var(--text); border: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.08); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.15); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.15); }
.btn-sm { padding: 6px 12px; font-size: 0.75rem; border-radius: 6px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-secondary); padding: 4px 8px; border-radius: 6px; transition: 0.15s; }
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }

.cmd-input-row { display: flex; gap: 8px; margin-top: 8px; }
input[type=number], input[type=text], input[type=date], select, textarea { background: var(--bg-control); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 8px; width: 100%; font-size: 0.88rem; outline: none; transition: all 0.2s; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px var(--accent-glow); }
label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.02em; }
.row { display: flex; gap: 12px; margin-bottom: 12px; }
.row > * { flex: 1; }
.row .w2 { flex: 2; }
textarea { resize: vertical; min-height: 80px; }

/* Detailed Main Charts */
.chart-wrap { position: relative; height: 300px; margin: 10px 0; }
.stats-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat-mini { background: var(--bg-control); border-radius: 10px; padding: 12px 8px; text-align: center; border: var(--border); }
.stat-mini .v { font-family: 'Space Grotesk', sans-serif; font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.stat-mini .l { font-size: 0.65rem; color: var(--text-secondary); margin-top: 3px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }

.empty { text-align: center; color: var(--text-muted); padding: 32px; font-size: 0.9rem; }
.detail-back { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; transition: 0.15s; }
.detail-back:hover { color: var(--accent); }

/* ── Batch Ingredients & Detail ── */
.ingredient-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ingredient-row > * { flex: 1; }
.ingredient-row .btn-icon { flex: 0 0 auto; }
.yeast-info { background: var(--bg-control); border-radius: 10px; padding: 12px; margin-top: 8px; font-size: 0.8rem; display: none; border: var(--border); }
.yeast-info.show { display: block; }
.yeast-info .yi-name { font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.yeast-info .yi-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.yeast-info .yi-item { color: var(--text-secondary); }
.yeast-info .yi-item b { color: var(--text); }
.yeast-info .yi-notes { color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* ── ABV Calculator ── */
.abv-calc { background: var(--bg-control); border-radius: 8px; padding: 10px; margin-top: 8px; font-size: 0.8rem; color: var(--text-secondary); display: none; border: var(--border); }
.abv-calc.show { display: block; }
.abv-val { font-size: 1.1rem; font-weight: 700; color: var(--green); }

/* Loading and Spinners */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-muted); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--bg-control); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 10px; max-width: 320px;
  font-size: 0.85rem; font-weight: 600; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toastIn 0.25s cubic-bezier(.21,1.02,.73,1) forwards;
  pointer-events: none;
}
.toast.ok   { background: var(--green); }
.toast.err  { background: var(--red); }
.toast.warn { background: var(--orange); }
.toast.out  { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn  { from { opacity:0; transform: translateY(16px) scale(.95); } to { opacity:1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform: translateY(0) scale(1); } to { opacity:0; transform: translateY(8px) scale(.96); } }

.refresh-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.last-update { font-size: 0.68rem; color: var(--text-muted); }

/* ── FAB (Floating Action Button) ── */
.fab { position: absolute; bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer; font-size: 1.8rem; color: #ffffff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4); z-index: 99; transition: 0.2s; font-weight: 500; }
.fab:hover { transform: scale(1.08); background: var(--accent-hover); }

/* ── Modals ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 200; overflow-y: auto; padding: 24px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 600px; margin: auto; box-shadow: var(--shadow); border: var(--border); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--bg-hover); }
.modal-header h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.modal-footer { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--bg-hover); }
.section-title { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.07em; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--bg-hover); font-weight: 700; }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bg-hover); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }
.stat-val { font-size: 0.85rem; color: var(--text); font-weight: 700; }

/* ── Batch List Items ── */
.batch-list { display: flex; flex-direction: column; gap: 14px; }
.batch-item { background: var(--bg-card); border-radius: var(--radius); padding: 18px; cursor: pointer; border: var(--border); transition: 0.2s; }
.batch-item:hover { border-color: var(--accent); box-shadow: 0 10px 25px rgba(59, 130, 246, 0.08); }
.batch-item .bi-name { font-weight: 700; color: var(--text); font-size: 1rem; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.batch-item .bi-meta { font-size: 0.78rem; color: var(--text-secondary); display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Mobile Navigation ── */
nav.mobile-bottom-nav { display: none; }

/* ── Responsive Rules ── */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 260px 1fr;
  }
  .app-container.sidebar-collapsed {
    grid-template-columns: 70px 1fr;
  }
  .right-status-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-container, .app-container.sidebar-collapsed {
    grid-template-columns: 1fr;
    padding-bottom: 84px;
  }
  aside { display: none; }
  header { padding: 16px 20px; }
  main { padding: 16px; }
  .temp-grid { grid-template-columns: 1fr; gap: 16px; }
  .cmd-grid { grid-template-columns: 1fr; }
  .chart-wrap { height: 260px; }
  .fab { bottom: 90px; right: 20px; }
  
  nav.mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 440px;
    background: var(--bg-card);
    border-radius: 20px;
    border: var(--border);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
    padding: 6px;
    z-index: 100;
  }
  nav.mobile-bottom-nav button {
    flex: 1;
    padding: 8px 2px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 14px;
    font-family: inherit;
  }
  nav.mobile-bottom-nav button.active {
    color: var(--accent);
    background: var(--bg-control);
  }
  nav.mobile-bottom-nav button svg { width: 20px; height: 20px; stroke-width: 2; fill: none; }
}

/* ── Tools dropdown menu ── */
.tools-menu { position: relative; }
.tools-menu > summary { list-style: none; cursor: pointer; }
.tools-menu > summary::-webkit-details-marker { display: none; }
.tools-menu > summary::marker { content: ""; }
.tools-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--bg-card); border: var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); min-width: 190px;
}
.tools-menu-pop button { justify-content: flex-start; text-align: left; width: 100%; }

/* ── Print / PDF export ── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  aside, header, nav.mobile-bottom-nav, .fab,
  .tools-menu, #btn-chart-filter-all, #btn-chart-filter-7d, #btn-chart-filter-3d, #btn-chart-filter-24h,
  #btn-add-gravity, #grav-lock-icon, .btn-danger,
  #btn-ai, #ai-analysis-box,
  #ferm-compare-card, #ferm-priming-card,
  .refresh-row button, #prim-vol-warn,
  [title="Aggiorna"],
  #network-error-banner { display: none !important; }
  .app-container { display: block !important; }
  main { padding: 0 !important; }
  section { display: block !important; }
  section:not(#tab-ferm) { display: none !important; }
  .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #dde !important; margin-bottom: 12px !important; }
  #print-report-header { display: block !important; }
  body { background: #fff !important; color: #111 !important; font-size: 11pt; }
  .chart-wrap { height: 220px !important; }
  .chart-wrap canvas { max-height: 220px !important; }
  table { font-size: 9pt !important; }
  .badge { border: 1px solid #ccc !important; color: #333 !important; }
}
#print-report-header { display: none; padding: 0 0 12px 0; border-bottom: 2px solid #dde; margin-bottom: 16px; }