/* ============================================================
   Sokół Milenium — design system
   Recreated from the Claude Design "Sokol Milenium" prototype.
   ============================================================ */

:root {
  --bg: #080c18;
  --s1: #0f1426;
  --s2: #161d33;
  --bd: rgba(150, 170, 220, .13);
  --tx: #eef2fb;
  --mut: #8e9bba;
  --acc: #5b8def;

  --inset: #0b1020;
  --sidebar: #0a0f1d;
  --on-acc: #06122e;
  --link: #9fbcff;
  --soft: #c6cfe3;

  --green: #46c08a;
  --gold: #f5c451;
  --red: #e0697a;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: 'Space Grotesk', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(150, 170, 220, .18); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar { display: none; }

input, select, textarea, button { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #566179; }
a { color: inherit; }

@keyframes tw { 0%, 100% { opacity: .12; } 50% { opacity: .85; } }
@keyframes fu { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sp { to { transform: rotate(360deg); } }

.fade-up { animation: fu .3s ease; }

/* ---------------- App shell ---------------- */
.app { display: flex; flex-direction: row; min-height: 100vh; }

.sidebar {
  width: 248px; flex: none; background: var(--sidebar);
  border-right: 1px solid var(--bd); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 4px 6px; }
.brand-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: .02em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--mut); }
.menu-toggle {
  display: none; flex: none; background: var(--inset); border: 1px solid var(--bd);
  color: var(--tx); border-radius: 9px; width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 10px; padding: 11px 12px;
  color: var(--mut); font-size: 14px; font-weight: 600; cursor: pointer; white-space: normal;
  text-decoration: none;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .05); }
.nav-item.active { background: rgba(91, 141, 255, .15); color: #cdd9ff; }
.nav-item.active svg { stroke: var(--acc); }

.main { flex: 1; min-width: 0; padding: 32px 32px 56px; }
.container { max-width: 1180px; margin: 0 auto; }

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.page-title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--mut); font-size: 14px; margin-top: 3px; }
.header-user { display: flex; align-items: center; gap: 12px; }
.header-user .uname { font-size: 14px; font-weight: 600; text-align: right; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border-radius: 10px; padding: 11px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; border: 1px solid var(--bd);
  background: transparent; color: var(--tx); text-decoration: none;
}
.btn-primary { background: var(--acc); color: var(--on-acc); border: none; border-radius: 11px; font-weight: 700; }
.btn-ghost { color: var(--mut); }
.btn-ghost:hover { color: var(--tx); }
.btn-add { background: rgba(91, 141, 255, .15); color: var(--acc); border: none; border-radius: 9px; font-weight: 700; font-size: 13px; padding: 9px 14px; }
.btn-danger { background: transparent; border: 1px solid rgba(224, 105, 122, .4); color: var(--red); border-radius: 8px; font-size: 13px; padding: 8px 12px; }
.btn-danger-solid { background: var(--red); color: #1a0608; border: none; border-radius: 10px; font-weight: 700; padding: 11px 18px; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn-link { background: transparent; border: none; color: var(--link); cursor: pointer; font-weight: 600; font-size: 13px; padding: 8px 12px; text-decoration: none; }
.btn:disabled, .btn.off { opacity: .4; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------------- Cards / panels ---------------- */
.card { background: var(--s1); border: 1px solid var(--bd); border-radius: 16px; padding: 20px; }
.tile { background: var(--s1); border: 1px solid var(--bd); border-radius: 16px; padding: 18px 20px; }
.entity-card { background: var(--s1); border: 1px solid var(--bd); border-radius: 14px; padding: 18px; }
.section-title { font-size: 15px; font-weight: 700; }
.muted { color: var(--mut); }
.soft { color: var(--soft); }

.tile .tile-label { font-size: 12px; color: var(--mut); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.tile .tile-value { font-size: 30px; font-weight: 700; margin-top: 6px; }

/* stat grids */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dict-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.summary-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 16px; }
.label {
  display: block; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--mut); margin-bottom: 7px; font-weight: 600;
}
.label-req { color: var(--acc); }
.input, .select, .textarea {
  width: 100%; background: var(--inset); border: 1px solid var(--bd); border-radius: 10px;
  padding: 11px 13px; color: var(--tx); font-size: 14px; outline: none;
}
.select { appearance: none; cursor: pointer; }
.textarea { resize: vertical; }
.input.accent, .select.accent { border-color: var(--acc); }
input[type=date], input[type=number] { color-scheme: dark; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 12px; color: var(--mut); margin-top: 6px; }

/* ---------------- Pills / chips / badges ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--c, var(--acc)) 33%, transparent);
  background: color-mix(in srgb, var(--c, var(--acc)) 12%, transparent);
  color: var(--c, var(--acc));
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--acc)); flex: none; display: inline-block; }

/* Quick status change (Misje): a <details> dropdown whose summary is the status pill */
.status-pop { position: relative; display: inline-block; }
.status-pop > summary { list-style: none; cursor: pointer; }
.status-pop > summary::-webkit-details-marker { display: none; }
.status-pop > summary .caret { font-size: 9px; opacity: .65; margin-left: 2px; }
.status-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  background: var(--s2); border: 1px solid var(--bd); border-radius: 12px; padding: 6px;
  min-width: 195px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.status-menu form { margin: 0; }
.status-opt {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 8px;
  background: transparent; border: none; border-radius: 8px; padding: 8px 10px;
  color: var(--tx); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.status-opt:hover { background: rgba(255, 255, 255, .06); }
.status-opt.active { background: rgba(91, 141, 255, .14); }
.role-badge {
  display: inline-block; margin-top: 3px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.role-badge.admin { background: rgba(91, 141, 255, .18); color: var(--link); }
.role-badge.pracownik { background: rgba(150, 170, 220, .12); color: var(--mut); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--bd); background: var(--inset); color: var(--mut);
}
.chip.active {
  border-color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  color: #fff;
}
.fchip {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--bd); background: transparent; color: var(--mut); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.fchip.active {
  border-color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  color: #cdd9ff;
}
.kind-pill { font-size: 11px; color: var(--mut); border: 1px solid var(--bd); border-radius: 999px; padding: 2px 9px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.toolbar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* active filter pill */
.filter-pill {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(91, 141, 255, .12);
  border: 1px solid var(--acc); border-radius: 999px; padding: 6px 12px; font-size: 13px; align-self: flex-start;
}
.filter-pill a, .filter-pill button { color: var(--mut); background: none; border: none; cursor: pointer; font-size: 15px; text-decoration: none; }

/* ---------------- Segmented control ---------------- */
.seg { display: inline-flex; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 3px; }
.seg-btn { background: transparent; color: var(--mut); border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.seg-btn.active { background: var(--acc); color: var(--on-acc); font-weight: 700; }
.seg.lg { border-radius: 11px; padding: 4px; }

/* ---------------- Checkbox ---------------- */
.check {
  flex: none; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
  border: 1px solid var(--bd); background: transparent; color: var(--on-acc);
}
.check.done { border-color: var(--green); background: var(--green); }
.strike { text-decoration: line-through; color: var(--mut); }

/* ---------------- Avatar ---------------- */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex: none; background: rgba(91, 141, 255, .15); color: var(--acc);
}
.avatar.mut { background: rgba(150, 170, 220, .12); color: var(--mut); }

/* ---------------- Info / note / error boxes ---------------- */
.info-box { background: var(--inset); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 16px; }
.info-box.dashed { border-style: dashed; }
.info-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.info-row + .info-row { margin-top: 8px; }
.divider { height: 1px; background: var(--bd); margin: 14px 0; border: none; }

.admin-note { background: rgba(245, 196, 81, .08); border: 1px solid rgba(245, 196, 81, .2); border-radius: 10px; padding: 11px 13px; font-size: 13px; color: #f0d28f; }
.error-box { background: rgba(224, 105, 122, .12); border: 1px solid rgba(224, 105, 122, .4); border-radius: 11px; padding: 11px 14px; color: #f0a8b2; font-size: 13px; }
.lost-box { background: rgba(224, 105, 122, .1); border: 1px solid rgba(224, 105, 122, .25); border-radius: 9px; padding: 9px 12px; font-size: 12px; color: #f0a8b2; }

.empty { text-align: center; color: var(--mut); padding: 50px 20px; background: var(--s1); border: 1px dashed var(--bd); border-radius: 14px; }

/* list row */
.list-row { display: flex; align-items: center; gap: 12px; background: var(--inset); border: 1px solid var(--bd); border-radius: 10px; padding: 10px 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* colors helpers */
.c-acc { color: var(--acc); } .c-gold { color: var(--gold); } .c-green { color: var(--green); } .c-red { color: var(--red); } .c-link { color: var(--link); }
.fw7 { font-weight: 700; } .fw6 { font-weight: 600; }
.f11 { font-size: 11px; } .f12 { font-size: 12px; } .f13 { font-size: 13px; } .f14 { font-size: 14px; }
.cap { text-transform: uppercase; letter-spacing: .05em; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt22 { margin-top: 22px; }
.mb10 { margin-bottom: 10px; } .mb14 { margin-bottom: 14px; } .mb16 { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- Modal ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(4, 7, 15, .7); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 100; overflow-y: auto;
}
.modal.small { align-items: center; padding: 20px; z-index: 300; }
.modal-card {
  background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; padding: 24px; width: 100%;
  max-width: 520px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: fu .25s ease;
}
.modal.small .modal-card { border-radius: 16px; animation: fu .2s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { background: transparent; border: none; color: var(--mut); font-size: 22px; line-height: 1; cursor: pointer; text-decoration: none; }
.modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal-foot .btn-primary { flex: 1; }

/* collapsible */
.collapsible > summary {
  list-style: none; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--inset); border: 1px solid var(--bd); border-radius: 10px; padding: 11px 13px;
  color: var(--tx); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; cursor: pointer;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible[open] > summary .hint::after { content: 'Ukryj ▲'; }
.collapsible > summary .hint::after { content: 'Pokaż ▼'; }
.collapsible .hint { color: var(--mut); text-transform: none; font-weight: 400; }

/* ---------------- Calendar ---------------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 11px; color: var(--mut); font-weight: 600; }
.cal-cell {
  position: relative; min-height: 30px; border-radius: 8px; padding: 5px 6px; display: flex;
  justify-content: space-between; align-items: flex-start; gap: 3px; background: var(--inset);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; color: var(--tx);
}
.cal-cell.out { opacity: .4; } .cal-cell.past { opacity: .65; }
.cal-cell.today { border-color: var(--acc); background: rgba(91, 141, 255, .10); }
.cal-cell.selected { outline: 2px solid var(--acc); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 600; }
.cal-cell.today .cal-num { font-weight: 700; }
.cal-pill { font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: rgba(91, 141, 255, .22); color: var(--link); }
.cal-pill.overdue { background: rgba(224, 105, 122, .25); color: #f0a8b2; }
.cal-lanes { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px 6px; margin-top: 3px; grid-auto-rows: 19px; }
.cal-bar {
  height: 19px; display: flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 11px; font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; text-decoration: none;
  color: var(--c, var(--acc));
  background: color-mix(in srgb, var(--c, var(--acc)) 13%, transparent);
  border-left: 3px solid var(--c, var(--acc)); border-radius: 7px;
}
.cal-legend { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.day-mission { display: flex; align-items: center; gap: 12px; background: rgba(91, 141, 255, .10); border: 1px solid rgba(91, 141, 255, .35); border-radius: 10px; padding: 11px 13px; cursor: pointer; text-decoration: none; color: var(--tx); }

/* wizard */
.step-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--bd); background: var(--inset); color: var(--mut); text-decoration: none; }
.step-btn.active { border-color: var(--acc); background: rgba(91, 141, 255, .15); color: #cdd9ff; }
.step-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .1); color: var(--mut); }
.step-btn.active .step-num { background: var(--on-acc); color: #fff; }
.group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.group-num { width: 26px; height: 26px; border-radius: 8px; background: rgba(91, 141, 255, .15); color: var(--acc); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.plan-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 300px; }
.recap { position: sticky; top: 20px; }

/* dict rows */
.dict-row { display: flex; justify-content: space-between; align-items: center; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 9px 12px; font-size: 14px; }
.dict-ctrl { background: transparent; border: none; color: var(--mut); cursor: pointer; padding: 0 3px; font-size: 12px; }
.dict-ctrl.x { font-size: 16px; }
.dict-ctrl.x:hover { color: var(--red); }
.color-input { width: 54px; height: 40px; background: var(--inset); border: 1px solid var(--bd); border-radius: 9px; padding: 3px; cursor: pointer; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #11203f; border: 1px solid var(--acc); color: #fff; padding: 12px 22px; border-radius: 11px; font-size: 14px; font-weight: 600; z-index: 200; box-shadow: 0 14px 40px rgba(0, 0, 0, .4); animation: fu .25s ease; }

/* ---------------- Login ---------------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; background: radial-gradient(900px 520px at 50% -5%, rgba(91, 141, 255, .12), transparent 60%); }
.login-card-wrap { position: relative; z-index: 2; width: 100%; max-width: 400px; text-align: center; animation: fu .5s ease; }
.login-logo { width: 132px; height: 132px; object-fit: contain; display: block; margin: 0 auto 4px; }
.login-eyebrow { font-size: 12px; color: var(--mut); letter-spacing: .22em; text-transform: uppercase; margin-bottom: 28px; }
.login-card { background: var(--s1); border: 1px solid var(--bd); border-radius: 18px; padding: 26px; text-align: left; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 14px; color: var(--mut); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.login-divider .ln { flex: 1; height: 1px; background: var(--bd); }
.star { position: absolute; border-radius: 50%; background: #dfe8ff; animation: tw 3s ease-in-out infinite; }
.login-hint { font-size: 12px; color: var(--mut); margin-top: 14px; text-align: center; }

.spinner { width: 30px; height: 30px; border: 3px solid rgba(150, 170, 220, .2); border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; }

/* ---------------- Responsive ---------------- */
@media (max-width: 979px) {
  .plan-layout { grid-template-columns: 1fr; }
  .recap { position: static; }
}
@media (max-width: 899px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; border-right: none; border-bottom: 1px solid var(--bd); padding: 12px 14px; gap: 10px; z-index: 30; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; }
  .nav { display: none; margin-top: 12px; gap: 6px; }
  .sidebar.open .nav { display: flex; }
  .nav-item { padding: 9px 13px; font-size: 13px; }
  .main { padding: 20px 16px 40px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .dict-grid { grid-template-columns: 1fr; }
  .summary-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
