:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg2: #0a101d;
  --panel: rgba(17, 25, 40, 0.7);
  --panel2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.13);
  --line2: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #67e8f9;
  --blue: #60a5fa;
  --gold: #f8d477;
  --purple: #a78bfa;
  --green: #34d399;
  --red: #fb7185;
  --pink: #f472b6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(96, 165, 250, 0.24), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(103, 232, 249, 0.14), transparent 30%),
    linear-gradient(145deg, var(--bg), var(--bg2) 52%, #020617);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.app-shell {
  width: 100vw;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

.glass {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 12px 10px;
  border-width: 0 0 1px;
  background:
    linear-gradient(90deg, rgba(10, 16, 29, 0.88), rgba(10, 16, 29, 0.62)),
    rgba(2, 6, 23, 0.68);
}

.brand {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1.08;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-select,
.pill-btn,
.ghost-btn,
.primary-btn,
.action-btn,
.pay-select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}

.lang-select {
  width: 72px;
  padding: 9px 8px;
}

.pill-btn,
.ghost-btn,
.primary-btn,
.action-btn {
  padding: 10px 12px;
  font-weight: 800;
}

.primary-btn {
  width: 100%;
  border-color: rgba(103, 232, 249, 0.42);
  background: linear-gradient(135deg, #06b6d4, #2563eb);
}

.ghost-btn {
  background: transparent;
}

.role-line {
  max-width: 1180px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.role-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.role-chip.admin {
  border-color: rgba(103, 232, 249, 0.5);
  color: var(--cyan);
}

.role-chip.staff {
  border-color: rgba(248, 212, 119, 0.45);
  color: var(--gold);
}

.tabs {
  max-width: 1180px;
  margin: 10px auto 0;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-width: 58px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--soft);
  font-weight: 800;
}

.tab.active {
  border-color: rgba(103, 232, 249, 0.55);
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.24), rgba(96, 165, 250, 0.16));
  color: white;
}

.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card {
  border-radius: var(--radius);
  padding: 12px 10px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  line-height: 1.05;
}

.control-panel {
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.segment {
  border: 0;
  border-radius: 6px;
  padding: 11px 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.active.upper {
  background: linear-gradient(135deg, rgba(248, 212, 119, 0.32), rgba(248, 212, 119, 0.12));
  color: #fff7d6;
}

.segment.active.lower {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.34), rgba(96, 165, 250, 0.14));
  color: white;
}

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

.status-choice {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 900;
}

.status-choice span,
.status-choice small {
  display: block;
}

.status-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.status-choice.active {
  border-color: rgba(103, 232, 249, 0.55);
  background: rgba(103, 232, 249, 0.12);
}

.half-panel {
  border-radius: var(--radius);
  overflow: hidden;
}

.half-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.half-head.upper {
  background: linear-gradient(90deg, rgba(248, 212, 119, 0.2), rgba(255, 255, 255, 0.02));
}

.half-head.lower {
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.28), rgba(96, 165, 250, 0.05));
}

.half-head p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.half-head h2 {
  margin: 0;
  font-size: 18px;
}

.half-head strong {
  color: var(--cyan);
  font-size: 18px;
}

.employee-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.employee-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
}

.employee-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.employee-top h3 {
  margin: 0;
  font-size: 18px;
}

.employee-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.pay-select {
  max-width: 112px;
  padding: 9px 8px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 96px));
  gap: 7px;
  justify-content: center;
  padding: 12px;
}

.day-btn {
  min-height: 56px;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
}

.day-num {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.day-status {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 950;
}

.day-btn.work {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.13);
  color: #bbf7d0;
}

.day-btn.rest {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.13);
  color: #fecdd3;
}

.day-btn.half {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}

.day-btn.leave {
  border-color: rgba(244, 114, 182, 0.55);
  background: rgba(244, 114, 182, 0.14);
  color: #fbcfe8;
}

.employee-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.employee-summary div {
  padding: 9px 4px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.employee-summary div:last-child {
  border-right: 0;
}

.employee-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.employee-summary strong {
  display: block;
  margin-top: 3px;
}

.bottom-bar {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-radius: var(--radius);
  padding: 8px;
}

.action-btn {
  min-height: 42px;
  color: var(--text);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.modal-backdrop.hidden {
  display: none;
}

.login-card,
.settings-card {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: var(--radius);
  padding: 18px;
}

.login-card h2,
.settings-card h2 {
  margin: 0 0 8px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.5;
}

.login-card label {
  display: block;
  margin-top: 12px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.login-card input,
.settings-card input {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  outline: none;
}

.login-card input:focus,
.settings-card input:focus {
  border-color: rgba(103, 232, 249, 0.65);
}

.login-error {
  min-height: 22px;
  margin-top: 8px;
  color: #fecdd3;
  font-size: 12px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.settings-row {
  display: grid;
  grid-template-columns: 52px 1fr 88px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

@media (min-width: 760px) {
  .main {
    padding: 18px;
  }

  .control-panel {
    grid-template-columns: 320px 1fr;
    align-items: center;
  }

  .employee-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .day-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 21px;
  }

  .brand {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: space-between;
  }

  .status-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
