:root {
  --bg: #F8FAFC;
  --surface: #ffffff;
  --surface-strong: #0B0F14;
  --surface-raised: #f1f5f9;
  --ink: #1B2430;
  --muted: #667382;
  --primary: #B8FF2C;
  --primary-dark: #83c900;
  --accent: #35D6FF;
  --line: rgba(27, 36, 48, .12);
  --line-strong: rgba(27, 36, 48, .2);
  --danger: #e05245;
  --warning: #d89022;
  --success: #6ee780;
  --shadow: 0 22px 70px rgba(11, 15, 20, .12);
  --shadow-tight: 0 12px 34px rgba(11, 15, 20, .10);
  --soft: #eef2f6;
  --rail: #0B0F14;
  --radius: 8px;
  --radius-lg: 18px;
  --max: 1320px;
}

* { box-sizing: border-box; }
html {
  min-width: 320px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  background: var(--surface-strong);
}
body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(11, 15, 20, .98) 0, rgba(11, 15, 20, .98) 156px, transparent 156px),
    linear-gradient(135deg, #ffffff 0, var(--bg) 52%, #edf3f8 100%);
  color: var(--ink);
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden { display: none !important; }
h2, h3, p { margin: 0; }
h2 {
  margin-top: 4px;
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: .98;
  font-weight: 900;
}
h3 {
  margin-top: 8px;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.05;
  font-weight: 880;
}
p {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.45;
}

.appShell {
  width: min(var(--max), 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px calc(116px + env(safe-area-inset-bottom));
}

.appHeader {
  min-height: 88px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  color: white;
}
.brandBlock { min-width: 0; }
.appHeader span {
  display: block;
  color: rgba(255, 255, 255, .62);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.appHeader h1 {
  margin: 4px 0 0;
  font-size: clamp(29px, 3.1vw, 48px);
  line-height: 1;
  font-weight: 930;
  overflow-wrap: anywhere;
}
.iconButton,
.headerAction {
  min-width: 48px;
  padding: 0 15px;
  color: white;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}
.headerAction {
  min-width: 92px;
  background: rgba(184, 255, 44, .12);
  border-color: rgba(184, 255, 44, .28);
  color: var(--primary);
}
.iconButton.light { color: var(--ink); background: var(--soft); border-color: var(--line); }

.workspace { display: grid; gap: 14px; }
.mainLayout { display: grid; gap: 16px; }

.devPanel {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .06);
  color: white;
  overflow: hidden;
}
.devPanel summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.controlStrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}
.devPanel label { color: rgba(255, 255, 255, .74); }
select,
input,
textarea {
  min-height: 48px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
select:focus,
input:focus,
textarea:focus {
  outline: 2px solid rgba(53, 214, 255, .36);
  outline-offset: 2px;
  border-color: rgba(53, 214, 255, .55);
}
textarea { min-height: 112px; padding: 13px; resize: vertical; }
label small { color: var(--muted); font-size: 11px; font-weight: 750; }

.moduleRail,
.drawerNav { display: grid; gap: 7px; }
.moduleRail button,
.drawerNav button {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .62);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
}
.moduleRail button span,
.drawerNav button span,
.bottomNav button span { font-weight: 950; }
.moduleRail button:hover,
.drawerNav button:hover { color: white; background: rgba(255, 255, 255, .06); }
.moduleRail button.active,
.drawerNav button.active {
  color: var(--surface-strong);
  background: var(--primary);
  border-color: rgba(184, 255, 44, .65);
  box-shadow: 0 12px 32px rgba(184, 255, 44, .18);
}

.screen { display: grid; gap: 16px; min-width: 0; }
.dataStatus {
  width: fit-content;
  max-width: 100%;
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: 10px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(208, 215, 222, .75);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 30px rgba(11, 15, 20, .08);
  backdrop-filter: blur(14px);
}
.statusDot { width: 9px; height: 9px; border-radius: 999px; background: var(--muted); }
.dataStatus.live .statusDot { background: var(--success); }
.dataStatus.mock .statusDot { background: var(--warning); }
.dataStatus.error .statusDot { background: var(--danger); }
.dataStatus strong { font-size: 12px; white-space: nowrap; }
.dataStatus small { color: var(--muted); font-size: 12px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dataStatus em { color: var(--primary-dark); font-style: normal; }

.todayHero,
.timerCommandCard,
.moduleCard,
.packPanel,
.screenHead,
.missionCard,
.reportDraft article,
.timeForm,
.formPreview,
.entryPanel,
.todaySummaryGrid article,
.metricGrid article {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(208, 215, 222, .68);
  box-shadow: var(--shadow-tight);
}
.todayHero {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(135deg, rgba(184, 255, 44, .16) 0, rgba(184, 255, 44, .03) 34%, transparent 58%),
    linear-gradient(115deg, #0B0F14 0, #111925 55%, #07121a 100%);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 34px 90px rgba(11, 15, 20, .32);
}
.todayHero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0, transparent 62%, rgba(53, 214, 255, .10) 100%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.055) 0 1px, transparent 1px 18px);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0,0,0,.75) 48%, #000 100%);
}
.todayHero > * { position: relative; z-index: 1; }
.todayIntro span,
.activeJobCard span,
.timerCommandCard span,
.moduleCard span,
.packPanel span,
.screenHead span,
.missionCard span,
.reportDraft span,
.entryPanel span,
.todaySummaryGrid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.todayIntro span,
.activeJobCard span { color: rgba(255, 255, 255, .58); }
.todayIntro p { color: rgba(255, 255, 255, .72); font-weight: 760; max-width: 620px; }
.activeJobCard {
  padding: 18px;
  background: rgba(255, 255, 255, .075);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px;
  box-shadow: none;
  backdrop-filter: blur(18px);
}
.activeJobCard p { color: rgba(255, 255, 255, .72); }
.activeJobCard strong {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  margin-top: 18px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--surface-strong);
  background: var(--primary);
  font-weight: 900;
}

.timerCommandCard {
  display: grid;
  gap: 18px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(11, 15, 20, .98), rgba(27, 36, 48, .96)),
    var(--surface-strong);
  border-color: rgba(255, 255, 255, .10);
  color: white;
  box-shadow: 0 30px 80px rgba(11, 15, 20, .28);
}
.timerCommandCard span { color: rgba(255, 255, 255, .56); }
.timerActions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.timerActions:has(.dangerAction) { grid-template-columns: 1fr 1fr; }
.bigTimerButton,
.dangerAction,
.submitAction { min-height: 66px; font-size: 20px; }
.primaryAction {
  background: var(--primary) !important;
  color: var(--surface-strong) !important;
  border: 1px solid rgba(184, 255, 44, .7) !important;
  box-shadow: 0 14px 36px rgba(184, 255, 44, .20), inset 0 1px 0 rgba(255,255,255,.38);
}
.primaryAction:hover { background: #cbff64 !important; }
.dangerAction {
  background: rgba(224, 82, 69, .10);
  color: #ffb8b1;
  border: 1px solid rgba(224, 82, 69, .32);
}
.mainActionRow,
.headActions,
.cardActions,
.heroActions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.mainActionRow button,
.headActions button,
.cardActions button,
.fieldQuickActions button,
.moduleCard button {
  min-height: 52px;
  padding: 0 15px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.timerCommandCard .mainActionRow button {
  background: rgba(255, 255, 255, .08);
  color: white;
  border-color: rgba(255, 255, 255, .13);
}

.todaySummaryGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.todaySummaryGrid article {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(11, 15, 20, .07);
}
.todaySummaryGrid strong { font-size: 30px; line-height: 1; }
.todaySummaryGrid small { color: var(--muted); font-weight: 760; overflow-wrap: anywhere; }
.fieldQuickActions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fieldQuickActions button {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 76px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 28px rgba(11, 15, 20, .06);
}
.fieldQuickActions span { color: var(--accent); font-size: 18px; }

.moduleGrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.splitGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.moduleCard { min-height: 142px; padding: 18px; }
.focusCard,
.packPanel.electric,
.entryPanel.direct {
  border-color: rgba(184, 255, 44, .32);
  background: linear-gradient(135deg, rgba(184, 255, 44, .11), rgba(53, 214, 255, .04) 58%, transparent), var(--surface);
}

.screenHead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
}
.cleanHead { box-shadow: none; padding: 0; border: 0; background: transparent; }
.missionList { display: grid; gap: 14px; }
.missionCard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(11, 15, 20, .07);
}
.missionCard strong { display: block; margin-top: 12px; }
.priority-hoch { border-left: 4px solid var(--warning); }
.priority-normal { border-left: 4px solid var(--primary); }
.priority-tief { border-left: 4px solid var(--accent); }

.tabRail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabRail::-webkit-scrollbar { display: none; }
.tabRail button {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 0 14px;
  background: rgba(255,255,255,.76);
  color: var(--ink);
  border: 1px solid var(--line);
}
.tabRail button.active { background: var(--surface-strong); color: white; border-color: var(--surface-strong); }
.workbookBody { display: grid; gap: 14px; }

.metricGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metricGrid article { min-height: 102px; display: grid; align-content: center; gap: 8px; padding: 16px; box-shadow: 0 10px 28px rgba(11, 15, 20, .06); }
.metricGrid strong { font-size: 21px; }
.metricGrid span { color: var(--muted); }
.listCard ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); }
.listCard li + li { margin-top: 8px; }

.reportDraft { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.reportDraft article { min-height: 112px; padding: 18px; }
.reportDraft .wide { grid-column: 1 / -1; }

.timeForm { display: grid; gap: 16px; padding: 20px; }
.entryChoiceGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entryPanel { display: grid; gap: 13px; padding: 16px; box-shadow: 0 10px 28px rgba(11, 15, 20, .07); }
.miniGrid,
.formGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.compactForm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.formGrid .wide { grid-column: 1 / -1; }
.formPreview { min-height: 68px; display: grid; padding: 14px 16px; background: #eef8ff; box-shadow: 0 10px 28px rgba(11, 15, 20, .06); }
.formPreview div { display: grid; gap: 4px; }
.formPreview span { color: var(--muted); font-weight: 850; }
.submitAction { width: 100%; }

.packPanel { padding: 18px; display: grid; gap: 16px; }
.chipList { display: flex; flex-wrap: wrap; gap: 8px; }
.chipList span {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.heroPanel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0B0F14, #172232);
  color: white;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 30px 80px rgba(11, 15, 20, .25);
}
.heroPanel span { color: rgba(255,255,255,.58); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.heroPanel p { color: rgba(255,255,255,.70); }

.drawer { position: fixed; inset: 0; z-index: 80; display: flex; background: rgba(11, 15, 20, .64); }
.drawerPanel { width: min(360px, calc(100% - 46px)); padding: 18px; background: var(--surface); box-shadow: 24px 0 70px rgba(11, 15, 20, .30); }
.drawerHead { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.drawerHead strong,
.drawerHead small { display: block; }
.drawerHead small { color: var(--muted); }
.drawerNav button { color: var(--ink); background: var(--soft); border-color: var(--line); }
.drawerNav button.active { color: var(--surface-strong); background: var(--primary); }

.bottomNav {
  position: fixed;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  max-width: 720px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 18px;
  background: rgba(11, 15, 20, .96);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 46px rgba(11, 15, 20, .34);
  backdrop-filter: blur(18px);
}
.bottomNav button {
  min-width: 0;
  min-height: 60px;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 5px 3px;
  color: rgba(255, 255, 255, .62);
  background: transparent;
  font-size: 12px;
  overflow: hidden;
}
.bottomNav button span { font-size: 15px; line-height: 1; }
.bottomNav button.active {
  color: var(--surface-strong);
  background: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
}

@media (min-width: 860px) {
  body {
    background:
      linear-gradient(90deg, #0B0F14 0, #0B0F14 calc(50% - 660px + 236px), transparent calc(50% - 660px + 236px)),
      linear-gradient(180deg, #0B0F14 0, #0B0F14 136px, transparent 136px),
      linear-gradient(135deg, #ffffff 0, var(--bg) 52%, #edf3f8 100%);
  }
  .appShell { width: min(1440px, 100%); padding: 20px 30px 44px; }
  .appHeader {
    width: min(var(--max), 100%);
    margin: 0 auto 6px;
    min-height: 94px;
    grid-template-columns: 218px minmax(0, 1fr) auto;
  }
  .appHeader .iconButton { display: none; }
  .appHeader h1 { font-size: 44px; }
  .workspace { width: min(var(--max), 100%); margin: 0 auto; gap: 18px; }
  .devPanel { width: calc(100% - 246px); justify-self: end; }
  .mainLayout { grid-template-columns: 218px minmax(720px, 1fr); align-items: start; gap: 28px; }
  .moduleRail {
    position: sticky;
    top: 20px;
    min-height: calc(100dvh - 128px);
    display: grid;
    align-content: start;
    padding: 18px 12px;
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(255,255,255,.07), transparent 22%),
      var(--rail);
    border: 1px solid rgba(255, 255, 255, .10);
    box-shadow: 18px 30px 90px rgba(11, 15, 20, .28);
  }
  .moduleRail::before {
    content: "ORARI";
    display: block;
    margin: 0 8px 18px;
    color: white;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: .14em;
  }
  .moduleRail button { min-height: 46px; }
  .bottomNav { display: none; }
  .screen { max-width: 1040px; gap: 18px; }
  .todayHero {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
    align-items: stretch;
    min-height: 318px;
    padding: 36px;
  }
  .todayIntro { display: grid; align-content: center; }
  .todayIntro h2 { font-size: clamp(48px, 4.2vw, 70px); max-width: 720px; }
  .activeJobCard { display: grid; align-content: center; padding: 24px; }
  .timerCommandCard {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    align-items: center;
    min-height: 206px;
    padding: 28px;
  }
  .timerCommandCard h2 { font-size: clamp(38px, 3vw, 54px); }
  .timerCommandCard .mainActionRow { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bigTimerButton,
  .dangerAction { min-height: 78px; font-size: 22px; }
  .todaySummaryGrid { gap: 14px; }
  .todaySummaryGrid article { min-height: 138px; padding: 22px; }
  .fieldQuickActions button { min-height: 82px; }
  .screenHead { padding: 24px; }
  .timeForm { padding: 24px; }
  .moduleGrid { gap: 16px; }
  .moduleCard { padding: 20px; }
  .heroPanel { grid-template-columns: minmax(0, 1fr) minmax(300px, .45fr); align-items: center; padding: 30px; }
}

@media (min-width: 1280px) {
  :root { --max: 1360px; }
  .appShell { padding-left: 38px; padding-right: 38px; }
  .appHeader { grid-template-columns: 230px minmax(0, 1fr) auto; }
  .mainLayout { grid-template-columns: 230px minmax(780px, 1fr); gap: 34px; }
  .screen { max-width: 1080px; }
  .devPanel { width: calc(100% - 264px); }
}

@media (max-width: 859px) {
  .moduleRail { display: none; }
  .devPanel { background: rgba(255, 255, 255, .06); }
  .screen { gap: 14px; }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(180deg, #0B0F14 0, #0B0F14 150px, transparent 150px),
      linear-gradient(135deg, #ffffff 0, var(--bg) 52%, #edf3f8 100%);
  }
  .appShell { padding: max(8px, env(safe-area-inset-top)) 8px calc(108px + env(safe-area-inset-bottom)); }
  .appHeader { min-height: 74px; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .appHeader span { font-size: 11px; }
  .appHeader h1 { font-size: 29px; }
  .iconButton,
  .headerAction { min-width: 44px; min-height: 44px; padding: 0 10px; }
  .headerAction { min-width: 70px; }
  .controlStrip,
  .todaySummaryGrid,
  .moduleGrid,
  .splitGrid,
  .reportDraft,
  .screenHead,
  .missionCard,
  .metricGrid,
  .headActions,
  .cardActions,
  .entryChoiceGrid,
  .miniGrid,
  .formGrid,
  .compactForm { grid-template-columns: 1fr; }
  .todayHero,
  .timerCommandCard,
  .timeForm { padding: 16px; }
  .todayHero { border-radius: 20px; }
  .timerActions:has(.dangerAction) { grid-template-columns: 1fr; }
  .mainActionRow { grid-template-columns: 1fr; }
  .fieldQuickActions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .fieldQuickActions button { min-height: 66px; padding: 4px; font-size: 12px; }
  .dataStatus { width: 100%; grid-template-columns: 10px auto; border-radius: var(--radius); }
  .dataStatus small { grid-column: 2; white-space: normal; }
  h2 { font-size: 32px; }
  h3 { font-size: 22px; }
  .moduleCard { min-height: 114px; }
}

@media (max-width: 380px) {
  .bottomNav button { font-size: 11px; }
  .fieldQuickActions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
