:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #151b23;
  --panel-raised: #1b2430;
  --line: #2a3441;
  --text: #e9eef4;
  --muted: #9aa8b8;
  --blue: #4ba3ee;
  --blue-dark: #1565c0;
  --pale-blue: #b6dcff;
  --gold: #d9a13b;
  --green: #56c596;
  --red: #ee7a7a;
  --shadow: 0 22px 65px rgba(0, 0, 0, .35);
  font-family: "DM Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column;
  width: 258px; padding: 24px 16px 18px; border-right: 1px solid var(--line);
  background: #10151c;
}
.brand { min-height: 65px; margin: 0 8px 26px; }
.section-label, .eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.section-label { padding: 0 12px 12px; }
.nav-list { display: grid; gap: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; width: 100%; padding: 0 13px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted);
  text-align: left; cursor: pointer; transition: .16s ease;
}
.nav-item span { width: 21px; color: var(--blue); font-size: 18px; text-align: center; }
.nav-item:hover { background: #18212b; color: var(--text); }
.nav-item.active { border-color: rgba(75, 163, 238, .25); background: rgba(21, 101, 192, .18); color: #fff; }
.sidebar-spacer { flex: 1; min-height: 36px; }
.user-bar { margin: 14px 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: #131a22; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 9px; }
.avatar { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #17385a; color: #b6dcff; font-weight: 800; }
.user-info { display: grid; min-width: 0; }
.user-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-info small { color: var(--muted); font-size: 10px; }
.user-action { width: 100%; padding: 7px 4px; border: 0; background: transparent; color: var(--muted); text-align: left; font-size: 12px; cursor: pointer; }
.user-action:hover { color: white; }
.sidebar-foot { display: grid; gap: 7px; padding: 12px 8px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.sidebar-foot small { color: #667487; }
.main-content { min-height: 100vh; margin-left: 258px; padding: 34px clamp(24px, 4vw, 64px) 64px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.topbar h1 { margin: 8px 0 5px; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.04em; }
.page-description { margin: 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 700; transition: .15s ease; }
.button:disabled { opacity: .5; cursor: wait; }
.button.primary { background: var(--blue-dark); color: #fff; box-shadow: 0 5px 20px rgba(21,101,192,.24); }
.button.primary:hover { background: #1d78d4; }
.button.quiet { border-color: var(--line); background: #141b23; color: #d1dae4; }
.button.quiet:hover { border-color: #506074; background: #1a2531; }
.button.danger { border-color: rgba(238,122,122,.27); background: rgba(143,43,43,.16); color: #ffabab; }
.button.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 25px; }
.stat-card { position: relative; overflow: hidden; min-height: 132px; padding: 20px 21px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(135deg, #18212b, #131920 80%); }
.stat-card::after { position: absolute; right: -18px; bottom: -42px; width: 104px; height: 104px; border: 1px solid rgba(75,163,238,.18); border-radius: 50%; content: ""; box-shadow: 0 0 0 18px rgba(75,163,238,.035), 0 0 0 36px rgba(75,163,238,.025); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 14px; font-size: 34px; line-height: 1; font-weight: 750; letter-spacing: -.04em; }
.stat-note { margin-top: 9px; color: #77869a; font-size: 11px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 28px 0 13px; }
.section-heading h2 { margin: 0; font-size: 15px; letter-spacing: .01em; }
.section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.search-field { flex: 1 1 250px; position: relative; }
.search-field span { position: absolute; top: 10px; left: 12px; color: var(--muted); }
.search-field input { padding-left: 36px; }
input, select, textarea { width: 100%; border: 1px solid #344150; border-radius: 7px; outline: 0; background: #10161d; color: var(--text); }
input, select { min-height: 39px; padding: 0 11px; }
textarea { min-height: 94px; padding: 10px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(75,163,238,.12); }
input::placeholder, textarea::placeholder { color: #6c7a8d; }
.filter-select { flex: 0 1 190px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { padding: 11px 15px; background: #19232e; color: #aebdcd; text-align: left; text-transform: uppercase; letter-spacing: .09em; font-size: 10px; }
td { padding: 14px 15px; border-top: 1px solid rgba(42,52,65,.78); color: #d9e1ea; font-size: 13px; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #1b2632; }
.person-open { padding: 0; border: 0; background: transparent; color: #f4f7fa; text-align: left; font-weight: 700; cursor: pointer; }
.person-open:hover { color: var(--pale-blue); }
.person-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.person-edit { padding: 3px 8px; border: 1px solid rgba(75,163,238,.28); border-radius: 6px; background: rgba(21,101,192,.12); color: #a9d7ff; font-size: 11px; line-height: 1.35; cursor: pointer; white-space: nowrap; }
.person-edit:hover { border-color: rgba(75,163,238,.6); background: rgba(21,101,192,.22); color: #d2ebff; }
.subline { margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid rgba(75,163,238,.24); border-radius: 99px; background: rgba(21,101,192,.14); color: #b6dcff; font-size: 11px; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill[data-status="Zamietnutý"], .status-pill[data-status="Ukončený"] { border-color: #3d4651; background: #20262d; color: #9aa4af; }
.status-pill[data-status="Zamestnanec"], .status-pill[data-status="Prijatý"] { border-color: rgba(86,197,150,.27); background: rgba(34,128,92,.14); color: #7fe0b3; }
.status-pill[data-status="Ponuka"] { border-color: rgba(217,161,59,.29); background: rgba(217,161,59,.12); color: #f0c56f; }
.empty-state { display: grid; place-items: center; min-height: 210px; padding: 26px; color: var(--muted); text-align: center; }
.empty-state b { display: block; margin-bottom: 7px; color: var(--text); font-size: 15px; }
.quick-list { display: grid; }
.quick-row { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(120px,.8fr) 132px; align-items: center; gap: 15px; padding: 13px 17px; border-top: 1px solid var(--line); }
.quick-row:first-child { border-top: 0; }
.quick-row .muted { color: var(--muted); font-size: 12px; }
.quick-row button { border: 0; background: transparent; color: var(--text); text-align: left; font-weight: 700; cursor: pointer; }
.quick-row button:hover { color: var(--pale-blue); }
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(4,7,11,.78); backdrop-filter: blur(6px); }
.modal-card { width: min(100%, 980px); max-height: min(92vh, 980px); overflow: auto; border: 1px solid #3a4858; border-radius: 14px; background: #131a22; box-shadow: var(--shadow); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 24px 18px; border-bottom: 1px solid var(--line); background: rgba(19,26,34,.97); backdrop-filter: blur(9px); }
.modal-header h2 { margin: 5px 0 4px; font-size: 22px; letter-spacing: -.025em; }
.modal-header p { margin: 0; color: var(--muted); font-size: 12px; }
.close-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: #aeb9c6; font-size: 21px; cursor: pointer; }
.modal-body { padding: 20px 24px 24px; }
.form-section { margin-bottom: 22px; }
.form-section h3 { margin: 0 0 13px; color: var(--blue); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { color: #b4c0ce; font-size: 11px; font-weight: 650; }
.field small { color: #77869a; font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-columns { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); gap: 22px; }
.detail-block { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #151d26; }
.detail-block + .detail-block { margin-top: 14px; }
.detail-block h3 { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 13px; font-size: 13px; }
.mini-form { display: grid; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-form .form-grid { gap: 9px; }
.timeline { display: grid; gap: 9px; }
.timeline-item { padding: 10px 11px; border-left: 2px solid var(--blue-dark); border-radius: 0 7px 7px 0; background: #111820; }
.timeline-item b { font-size: 12px; }
.timeline-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.timeline-item .meta { display: flex; justify-content: space-between; gap: 8px; color: #8291a2; font-size: 10px; }
.doc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.doc-row:first-of-type { border-top: 0; }
.doc-row strong { display: block; font-size: 12px; }
.doc-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.doc-actions { display: flex; gap: 5px; }
.text-button { border: 0; background: transparent; color: var(--pale-blue); font-size: 11px; cursor: pointer; }
.text-button.danger { color: #ff9b9b; }
.audit-row { display: grid; grid-template-columns: 150px 110px 1fr 150px; gap: 12px; padding: 12px 15px; border-top: 1px solid var(--line); color: #c4cfda; font-size: 12px; }
.audit-row:first-child { border-top: 0; }
.audit-row small { color: var(--muted); }
.toast-stack { position: fixed; right: 20px; bottom: 18px; z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 40px)); }
.toast { padding: 12px 15px; border: 1px solid #35475a; border-radius: 8px; background: #1a2632; box-shadow: var(--shadow); color: var(--text); font-size: 12px; }
.toast.error { border-color: rgba(238,122,122,.5); color: #ffc4c4; }
.login-gate { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 35%, #152d45 0%, #0e1116 52%); }
.login-card { width: min(100%, 370px); padding: 34px; border: 1px solid #344355; border-radius: 14px; background: #141c26; text-align: center; box-shadow: var(--shadow); }
.logo-mark { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 19px; border-radius: 13px; background: linear-gradient(145deg, #67bbf7, #1565c0 72%); color: #fff; font-size: 28px; font-weight: 900; }
.login-card h1 { margin: 8px 0; font-size: 29px; }
.login-card p:not(.eyebrow) { margin: 0 0 21px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.mobile-header { display: none; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main-content { padding-inline: 26px; }
  .topbar { align-items: flex-start; }
}
@media (max-width: 760px) {
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 30; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 13px; border-bottom: 1px solid var(--line); background: #10151c; }
  .mobile-brand { display: flex; align-items: center; flex: 1; justify-content: center; }
  .mobile-brand img { max-height: 33px; }
  .icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 18px; }
  .sidebar { z-index: 45; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6); }
  body.nav-open .nav-backdrop { display: block; }
  .main-content { margin-left: 0; padding: 87px 15px 36px; }
  .topbar { flex-direction: column; gap: 17px; margin-bottom: 22px; }
  .topbar h1 { font-size: 29px; }
  .top-actions { width: 100%; }
  .top-actions .button { flex: 1; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 115px; padding: 15px; }
  .stat-value { font-size: 29px; }
  .detail-columns { grid-template-columns: 1fr; }
  .modal-overlay { padding: 8px; align-items: end; }
  .modal-card { max-height: 94vh; border-radius: 13px 13px 8px 8px; }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .audit-row { grid-template-columns: 1fr 1fr; gap: 4px 10px; }
  .quick-row { grid-template-columns: 1fr auto; }
  .quick-row .status-pill { grid-column: 2; grid-row: 1 / span 2; }
}
