:root {
  --bg: linear-gradient(145deg, #050d1a 0%, #0a1f3d 40%, #1c0d00 100%);
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,150,80,0.12);
  --glass-border-hover: rgba(255,150,80,0.28);
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #475569;
  --orange: #fb923c;
  --green: #4ade80;
  --red: #fca5a5;
  --blue: #93c5fd;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Sunset glow ve dvou rozích */
body::before {
  content: '';
  position: fixed;
  bottom: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle,
    rgba(239,68,68,0.10) 0%,
    rgba(249,115,22,0.15) 40%,
    transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  top: -60px; left: 25%;
  width: 250px; height: 250px;
  background: radial-gradient(circle,
    rgba(249,115,22,0.07) 0%,
    transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 580px;
  margin: 0 auto;
  padding: 36px 20px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.logo-text { font-size: 18px; font-weight: 700; }
.header-meta { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.header-user {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: rgba(255,255,255,0.045);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}
.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.header-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

/* ── Cards ── */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--glass-border-hover); }
.card-spaced { margin-top: 40px; }

.agent-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.agent-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.agent-desc { font-size: 11px; color: var(--text-2); margin-bottom: 2px; }
.agent-meta { font-size: 10px; color: var(--text-3); }

.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.offline { background: #ef4444; }

/* ── Buttons ── */
.btn {
  border: none; border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.btn:hover { opacity: 0.80; }
.btn:disabled { opacity: 0.40; cursor: not-allowed; }

.btn-orange {
  background: rgba(249,115,22,0.18);
  border: 1px solid rgba(249,115,22,0.40);
  color: var(--orange);
}
.btn-blue-ext {
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.40);
  color: var(--blue);
}
.btn-stop {
  background: rgba(239,68,68,0.18);
  border: 1px solid rgba(239,68,68,0.40);
  color: var(--red);
  flex: 1; text-align: center;
}
.btn-start {
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.40);
  color: var(--green);
  flex: 1; text-align: center;
}
.btn-restart {
  background: rgba(59,130,246,0.18);
  border: 1px solid rgba(59,130,246,0.40);
  color: var(--blue);
  flex: 1; text-align: center;
}
.btn-dashed {
  background: rgba(249,115,22,0.07);
  border: 1px dashed rgba(249,115,22,0.35);
  color: var(--orange);
  width: 100%; text-align: center;
}
.btn-compact { width: auto; padding: 8px 12px; }
.btn-add {
  width: 100%;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.10);
  color: var(--text-3);
  padding: 12px;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 6px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-add:hover { border-color: rgba(255,150,80,0.30); color: var(--orange); }

.controls { display: flex; gap: 8px; margin-bottom: 8px; }

/* ── Info rows ── */
.info-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2);
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.info-row:last-child { border-bottom: none; }
.info-row .val { color: var(--text); }
.info-row .val.orange { color: var(--orange); font-weight: 600; }
.info-row .val.green { color: var(--green); }
.info-row .val.red { color: var(--red); }

/* ── Badges ── */
.badge-online {
  background: rgba(74,222,128,0.15);
  color: var(--green);
  border: 1px solid rgba(74,222,128,0.30);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}
.badge-offline {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.30);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 22px;
  font-size: 13px;
}
.breadcrumb a { color: var(--orange); text-decoration: none; }
.breadcrumb .sep { color: var(--text-3); }
.breadcrumb .cur { font-weight: 700; }

/* ── Users ── */
.users-container { max-width: 720px; }
.users-header { margin-bottom: 16px; }
.user-card { margin-bottom: 8px; }
.user-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.form-card { margin-bottom: 14px; }
.login-label {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  margin: 12px 0 6px;
}
.login-input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
}
.login-button { width: 100%; margin-top: 16px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 12px;
  padding: 7px 0;
}
.check-row input { accent-color: var(--orange); }
.user-disabled { margin-top: 12px; }
.flash-inline {
  border: 1px solid rgba(74,222,128,0.25);
  background: rgba(74,222,128,0.10);
  color: var(--green);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
}

/* ── Section divider ── */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px;
}
.divider-line { flex: 1; height: 1px; background: rgba(255,255,255,0.07); }
.divider-text {
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Tabs ── */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-3);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab.active {
  background: rgba(249,115,22,0.20);
  border-color: rgba(249,115,22,0.40);
  color: var(--orange);
  font-weight: 600;
}
.tab:hover:not(.active) {
  border-color: rgba(255,150,80,0.20);
  color: var(--text-2);
}

/* ── Report items ── */
.report-item {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.report-item:first-child { border-color: rgba(255,150,80,0.20); }
.report-item:hover { border-color: rgba(255,150,80,0.25); }
.report-header {
  display: flex; justify-content: space-between; align-items: center;
}
.report-date { font-size: 11px; font-weight: 600; }
.report-ok { font-size: 10px; color: var(--green); }
.report-err { font-size: 10px; color: var(--red); }
.report-body {
  display: none;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
}
.report-item.open .report-body { display: block; }
.report-body-legacy {
  font-size: 10px;
  color: var(--text-2);
  line-height: 1.75;
  white-space: pre-wrap;
  font-family: 'Menlo', 'Consolas', monospace;
}
.report-chevron {
  font-size: 10px; color: var(--text-3);
  transition: transform 0.2s;
}
.report-item.open .report-chevron { transform: rotate(180deg); }

/* ── Flash message ── */
.flash {
  position: fixed;
  bottom: 24px; right: 24px;
  background: rgba(34,197,94,0.20);
  border: 1px solid rgba(34,197,94,0.40);
  color: var(--green);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
}
.flash.show { opacity: 1; }
.flash.error {
  background: rgba(239,68,68,0.20);
  border-color: rgba(239,68,68,0.40);
  color: var(--red);
}

/* ── Focus states (keyboard navigation) ── */
.btn:focus-visible,
.tab:focus-visible,
.breadcrumb a:focus-visible,
.report-item:focus-visible,
.btn-add:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ── Loading spinner ── */
.spinner { color: var(--text-3); font-size: 12px; padding: 20px 0; text-align: center; }

/* ── Person cards (report v2) ─────────────────────────────── */
.person-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,150,80,0.15);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 6px;
}
.person-card:last-of-type { margin-bottom: 0; }
.person-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.person-card-compact {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,150,80,0.15);
  border-radius: 8px;
  padding: 8px 11px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.person-card-compact:last-of-type { margin-bottom: 0; }
.person-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff; font-weight: 700;
  flex-shrink: 0;
}
.person-name {
  font-size: 11px; font-weight: 700;
  color: var(--text);
  flex: 1;
}
.person-hours {
  font-size: 16px; font-weight: 800;
  color: var(--orange);
  line-height: 1;
}
.person-projects {
  padding-left: 32px;
  display: flex; flex-direction: column; gap: 2px;
}
.person-project-row {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text);
}
.person-project-row span:last-child { color: var(--text-2); }
.report-total {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text);
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 8px; padding-top: 8px;
}
.report-total strong { color: var(--orange); }
.report-generated {
  font-size: 9px; color: var(--text-3);
  margin-top: 8px; text-align: right;
}

/* ── Vacation cards ───────────────────────────────────────── */
.person-vacation-absent {
  opacity: 0.45;
}
.person-vacation-absent .person-name { color: var(--text-3); }
.person-vacation-days {
  font-size: 18px; font-weight: 800;
  color: #a78bfa;
  line-height: 1;
}
.person-vacation-absent .person-vacation-days {
  font-size: 11px; font-weight: 400;
  color: var(--text-3);
}
.vacation-chips {
  padding-left: 32px;
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 4px;
}
.vacation-chip {
  background: rgba(167,139,250,0.10);
  border: 1px solid rgba(167,139,250,0.22);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 9px; color: #a78bfa;
}

/* ── Ratio bar ────────────────────────────────────────────── */
.ratio-bar-wrap { margin-bottom: 12px; }
.ratio-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 9px; margin-bottom: 4px;
}
.ratio-bar-labels span:first-child { color: var(--blue); }
.ratio-bar-labels span:last-child { color: var(--green); }
.ratio-bar {
  height: 8px; border-radius: 4px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.ratio-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
}
.ratio-values {
  display: flex; justify-content: space-between;
  font-size: 10px; margin-top: 4px; font-weight: 700;
}
.ratio-values span:first-child { color: var(--blue); }
.ratio-values span:last-child { color: var(--green); }
.ratio-section-label {
  font-size: 9px; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: 10px 0 5px;
}
.ratio-project-row {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text);
  padding: 2px 0;
}
.ratio-paid-val { color: var(--blue); }
.ratio-int-val { color: var(--green); }

@media (max-width: 520px) {
  .header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-actions {
    align-items: stretch;
  }
  .header-user {
    max-width: none;
    text-align: left;
  }
  .header-buttons {
    justify-content: flex-start;
  }
}
