:root {
  color-scheme: light;
  --paper: #f4f6fa;
  --surface: #fff;
  --ink: #182740;
  --muted: #54647d;
  --line: #e2e7f0;
  --accent: #2949ce;
  --accent-hover: #203ab0;
  --accent-soft: #edf1ff;
  --sidebar-width: 222px;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}

[hidden] { display: none !important; }
body { min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid #3156e2;
  outline-offset: 3px;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: fixed;
  z-index: 9;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
}
.skip-link:focus { transform: none; }
.shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: auto;
  padding: 28px 17px 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; margin: 1px 8px 47px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
}
.brand-mark .icon { width: 23px; height: 23px; }
.brand-name { font-size: 23px; font-weight: 750; letter-spacing: -.045em; line-height: 1; }
.brand-name span { color: var(--accent); }
.brand-caption { margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 550; }
.side-nav { display: grid; gap: 5px; margin-bottom: 31px; }
.side-label { margin: 0 10px 5px; font-size: 11px; font-weight: 650; color: var(--muted); }
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
}
.side-link:hover { background: var(--paper); color: var(--ink); }
.side-link.is-active { color: #2440b6; background: var(--accent-soft); border-color: #e5eaff; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 6px 0; border-top: 1px solid var(--line); }
.profile-avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: #3444a5; background: #e9ebff; font-size: 12px; font-weight: 750; }
#sidebar-user { font-size: 13px; font-weight: 700; }
#sidebar-role { color: var(--muted); font-size: 11px; }
.workspace { min-width: 0; }
.topbar {
  min-height: 64px;
  padding: 11px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.breadcrumb .icon { width: 16px; height: 16px; }
.preview-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 14px; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; color: #334c66; background: #eef3fa; border: 1px solid #e3eaf5; border-radius: 20px; padding: 4px 9px; white-space: nowrap; font-size: 11px; font-weight: 650; }
.demo-badge span { width: 6px; height: 6px; background: #4f6b97; border-radius: 50%; }
.identity-control { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.select-shell { position: relative; }
.select-shell select, .filter-control select { appearance: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.select-shell select { padding: 7px 28px 7px 10px; }
.select-shell .icon { position: absolute; width: 15px; height: 15px; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.main { max-width: 1490px; margin: auto; padding: 31px 34px 12px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.page-date { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.page-date .icon { width: 15px; height: 15px; }
h1 { margin: 4px 0 3px; color: var(--ink); font-size: clamp(32px, 4vw, 46px); font-weight: 750; line-height: 1.14; letter-spacing: -.052em; }
.page-description { color: var(--muted); font-size: 14px; }
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.btn-primary { color: #fff; background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { color: var(--ink); background: var(--surface); border-color: #d7dfec; }
.btn-secondary:hover { background: var(--paper); }
.btn-danger { color: #9d2b40; background: #fff1f3; border-color: #f4dce1; }
.btn-danger:hover { background: #ffe5ea; }
.btn-primary .icon { width: 17px; height: 17px; }
#new-task { min-height: 42px; padding-inline: 15px; margin-bottom: 1px; white-space: nowrap; }
.overview {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
  min-height: 146px;
  padding: 24px 25px;
  margin-bottom: 24px;
  color: #fff;
  background: #253caa;
  border-radius: 15px;
}
.overview-intro { flex: 0 1 245px; }
.overview-intro h2 { margin: 0 0 6px; font-size: 22px; font-weight: 720; letter-spacing: -.032em; }
.overview-intro p { max-width: 29ch; color: #e2e9ff; font-size: 13px; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 540px; flex: 1 1 470px; }
.overview-stats > div { display: flex; flex-direction: column-reverse; justify-content: center; gap: 4px; min-height: 74px; padding: 0 17px; border-left: 1px solid #7284d6; }
.overview-stats dt { display: flex; align-items: center; gap: 6px; color: #eef2ff; font-size: 12px; font-weight: 550; line-height: 1.3; }
.overview-stats dt .icon { width: 15px; height: 15px; }
.overview-stats dd { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-art { position: absolute; z-index: -1; right: -30px; top: 1px; width: 230px; color: #a6b7ff; }
.task-panel { overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 19px 22px 15px; }
.panel-heading h2 { font-size: 21px; font-weight: 730; letter-spacing: -.035em; line-height: 1.24; }
.result-count { color: var(--muted); font-size: 12px; margin-top: 4px; }
.view-tabs { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: #f4f6fb; }
.view-tab { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 670; white-space: nowrap; }
.view-tab span { min-width: 16px; padding-inline: 4px; border-radius: 8px; background: #e9edf5; text-align: center; font-size: 10px; }
.view-tab:hover { color: var(--ink); }
.view-tab.is-active { border-color: #e0e6f5; color: #2741b4; background: #fff; }
.view-tab.is-active span { background: #e9eeff; }
.toolbar { display: flex; gap: 9px; padding: 0 22px 16px; }
.search-control, .filter-control { position: relative; display: block; color: var(--muted); }
.search-control { flex: 1 1 230px; max-width: 420px; }
.search-control .icon, .filter-control .icon { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-control .icon, .filter-icon { left: 10px; width: 16px; height: 16px; }
.search-control input, .filter-control select { width: 100%; height: 39px; padding-left: 33px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-size: 12px; }
.search-control input { padding-right: 9px; }
.search-control input::placeholder { color: #586984; }
.filter-control select { padding-right: 29px; font-weight: 600; }
.filter-chevron { right: 8px; width: 14px; height: 14px; }
.table-wrap { overflow-x: auto; }
#tasks-table { width: 100%; border-collapse: collapse; text-align: left; }
#tasks-table th { padding: 9px 13px; background: #f7f8fc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; }
#tasks-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#tasks-table tr:last-child td { border-bottom: 0; }
#tasks-table tr:hover td { background: #fafbff; }
#tasks-table :is(th, td):first-child { padding-left: 22px; }
#tasks-table :is(th, td):last-child { padding-right: 22px; }
#tasks-table td:nth-child(2) { min-width: 136px; }
#tasks-table td:last-child { text-align: right; width: 1%; }
.task-item { display: flex; align-items: center; gap: 11px; }
.file-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 35px; height: 36px; border-radius: 8px; background: #e8f5ed; color: #1c6547; font-size: 11px; font-weight: 800; }
.file-icon svg { width: 19px; height: 19px; }
.task-copy { min-width: 0; }
.task-name { font-size: 13px; font-weight: 720; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.task-name:hover { color: var(--accent); text-decoration: underline; }
.task-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.audience { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 11px; color: var(--muted); font-weight: 600; }
.team-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid #e3e6ff; border-radius: 6px; color: #4149a4; background: #eff0ff; white-space: nowrap; font-size: 11px; font-weight: 700; }
.team-chip.team-operacje { color: #17695e; background: #eaf7f4; border-color: #d9eee9; }
.avatar-stack { display: inline-flex; align-items: center; padding-left: 2px; }
.avatar { display: grid; place-items: center; width: 25px; height: 25px; margin-left: -2px; border: 2px solid #fff; border-radius: 50%; font-size: 9px; font-weight: 750; color: #3a4796; background: #e5eaff; }
.avatar-operacje { color: #17695e; background: #daf1e9; }
.avatar-admin { color: #69439c; background: #eee2fc; }
.audience-people { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.audience-person { display: inline-flex; align-items: center; gap: 3px; }
.due-date { white-space: nowrap; font-size: 12px; font-weight: 600; color: #384b64; }
.due-date.is-urgent { color: #9f3042; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; white-space: nowrap; font-size: 11px; font-weight: 700; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-todo { background: #eef1f6; color: #465773; }
.status-progress { background: #e8efff; color: #264caf; }
.status-review { background: #fff1d7; color: #815007; }
.status-archived { background: #e9f3ee; color: #2a654d; }
.open-task, .dialog-close { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 7px; color: #496085; }
.open-task svg, .dialog-close svg { width: 16px; height: 16px; }
.open-task:hover, .dialog-close:hover { color: var(--accent); background: var(--accent-soft); }
.empty-state { padding: 34px 22px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.workspace-foot { max-width: 1490px; margin: auto; padding: 0 34px 14px; color: var(--muted); font-size: 11px; }
.workspace-foot span { margin: 0 5px; color: #6d7da0; }

.dialog { position: fixed; inset: 0; margin: auto; width: min(620px, calc(100% - 28px)); max-height: calc(100svh - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); box-shadow: 0 20px 70px #14204235; }
.dialog::backdrop { background: #18284778; }
.dialog-head, .dialog-body, .dialog-foot { padding: 18px 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 21px; font-weight: 730; letter-spacing: -.027em; overflow-wrap: anywhere; }
.dialog-head p, .dialog-body p, .file-meta, .detail-note { color: var(--muted); }
.dialog-close { flex: 0 0 auto; font-size: 22px; }
.dialog-body { display: grid; gap: 14px; overflow-wrap: anywhere; }
.dialog-body h3 { font-size: 14px; font-weight: 730; }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); gap: 12px; padding: 11px; border-radius: 8px; background: var(--paper); }
.detail-grid dt { font-size: 11px; color: var(--muted); font-weight: 650; }
.detail-grid dd { margin: 3px 0 0; font-size: 13px; }
.file-row { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.file-row summary { padding: 3px 0; font-weight: 700; overflow-wrap: anywhere; }
.file-meta, .file-preview, .detail-note { font-size: 12px; }
.file-preview { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.archive-confirm { display: grid; gap: 7px; padding: 10px; border: 1px solid #f4dce1; border-radius: 8px; background: #fff7f8; }
.form-field { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
.form-field :is(input, select, textarea) { width: 100%; min-height: 37px; padding: 7px 9px; border: 1px solid #d8e0ee; border-radius: 7px; background: #fff; font-weight: 400; }
.form-field textarea { min-height: 64px; resize: vertical; }
.assignment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-options { display: grid; align-content: start; gap: 6px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; }
.form-options legend { padding: 0 4px; font-weight: 700; font-size: 12px; }
.form-option { display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.form-option input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-error { color: #9f3042 !important; font-size: 12px; font-weight: 700; }
.toast { position: fixed; z-index: 8; right: 20px; bottom: 20px; max-width: min(400px, calc(100% - 40px)); padding: 10px 15px; border-radius: 9px; color: #fff; background: #253b63; box-shadow: 0 7px 20px #17233a25; font-weight: 650; }

@media (max-width: 1150px) {
  .overview-art { opacity: .38; }
  .overview-intro { flex-basis: 195px; }
}
@media (max-width: 980px) {
  :root { --sidebar-width: 174px; }
  .topbar, .main, .workspace-foot { padding-inline: 21px; }
  .sidebar { padding-inline: 10px; }
  .overview { gap: 11px; padding-inline: 17px; }
  .overview-stats > div { padding-inline: 10px; }
  .overview-stats dt .icon { display: none; }
  #tasks-table :is(th, td) { padding-inline: 8px; }
  #tasks-table :is(th, td):first-child { padding-left: 15px; }
  #tasks-table :is(th, td):last-child { padding-right: 11px; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; }
  .brand-mark { width: 33px; height: 33px; }
  .brand-caption, .side-label, .sidebar-profile, .breadcrumb { display: none; }
  .side-nav { display: flex; margin: 0; }
  .side-nav .icon { width: 16px; height: 16px; }
  .side-link { min-height: 34px; gap: 5px; padding-inline: 8px; font-size: 12px; }
  .topbar { min-height: auto; justify-content: flex-end; padding: 9px 14px; }
  .preview-controls { gap: 7px; }
  .main { padding-top: 19px; }
}
@media (max-width: 610px) {
  .main, .workspace-foot { padding-inline: 12px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 11px; margin-bottom: 15px; }
  .overview { display: block; min-height: auto; padding: 15px; margin-bottom: 15px; }
  .overview-intro { margin-bottom: 12px; }
  .overview-intro h2 { font-size: 19px; }
  .overview-intro p { max-width: 38ch; }
  .overview-stats > div { min-height: 48px; justify-content: flex-end; }
  .overview-stats > div:first-child { padding-left: 0; border-left: 0; }
  .overview-stats dd { font-size: 27px; }
  .overview-stats dt { font-size: 11px; }
  .panel-heading { padding: 13px 10px; }
  .panel-heading h2 { font-size: 18px; }
  .view-tab { padding-inline: 5px; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 10px 10px; gap: 7px; }
  .search-control { grid-column: 1 / -1; max-width: none; }
  .filter-control { min-width: 0; }
  .filter-control select { padding-left: 25px; padding-right: 20px; }
  .filter-control .filter-icon { left: 6px; width: 14px; }
  .filter-control .filter-chevron { right: 4px; }
  #tasks-table { display: block; }
  #tasks-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #tasks-table tbody { display: block; }
  #tasks-table tr { display: grid; grid-template-columns: 1fr auto 32px; gap: 7px; align-items: center; padding: 11px 10px; border-top: 1px solid var(--line); }
  #tasks-table td { display: block; min-width: 0; border: 0; }
  #tasks-table :is(td, td:first-child, td:last-child) { padding: 0; width: auto; }
  #tasks-table td:first-child { grid-column: 1 / 3; grid-row: 1; }
  #tasks-table td:nth-child(2) { min-width: 0; grid-column: 1; grid-row: 2; }
  #tasks-table td:nth-child(3) { grid-column: 2 / 4; grid-row: 3; text-align: right; }
  #tasks-table td:nth-child(4) { grid-column: 1; grid-row: 3; }
  #tasks-table td:last-child { grid-column: 3; grid-row: 1; }
  .dialog-head, .dialog-body, .dialog-foot { padding: 13px; }
}
@media (max-width: 390px) {
  .identity-control > span:first-child { display: none; }
  .panel-heading { gap: 7px; }
  .panel-heading h2 { font-size: 17px; }
  .assignment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 350px) {
  .sidebar { gap: 6px; padding-inline: 10px; }
}
