:root {
  --bg: #f3f4f6;
  --ink: #111827;
  --muted: #6b7280;
  --navy: #1e40af;
  --navy-2: #1e3a8a;
  --gold: #1d4ed8;
  --card: #ffffff;
  --line: #e6e8ee;
  --danger: #b91c1c;
  --ok: #166534;
  --warn: #92400e;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --sans: "Segoe UI", system-ui, sans-serif;
  --serif: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: var(--sans); font-size: 16px; line-height: 1.45; }
a { color: var(--navy); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 2rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 0 0 0.8rem; }
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--navy-2); color: #f4efe6; display: flex; flex-direction: column; padding: 22px 16px; }
.brand { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; margin-bottom: 22px; }
.brand-logo { display: block; width: 100%; height: auto; }
.auth-logo { display: block; width: min(280px, 100%); height: auto; margin: 0 auto 18px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #efe8dc; text-decoration: none; padding: 9px 12px; border-radius: 8px; }
.side nav a:hover, .side nav a.is-active { background: rgba(255,255,255,0.08); }
.nav-label { margin: 18px 12px 6px; color: #b9a88a; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.side-foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.side-foot a { color: #fff; text-decoration: none; }
.side-foot button, .actions button:not(.btn), .grid button:not(.btn) { background: none; border: 0; color: #1e40af; padding: 0; cursor: pointer; font: inherit; }
.grid button.danger, .actions button.danger { color: var(--danger); }
.main { padding: 32px 36px 64px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.page-head h1 { font-size: 1.4rem; margin: 0; font-weight: 650; }
.eyebrow { margin: 0 0 4px; color: var(--muted); letter-spacing: 0; text-transform: none; font-size: 0.82rem; }
.lead, .muted, .hint { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.system-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-height: 150px; }
.system-card:hover { border-color: var(--gold); }
.system-card .code { color: var(--gold); font-size: 0.78rem; letter-spacing: 0.08em; }
.system-card em { margin-top: auto; font-style: normal; color: var(--muted); font-size: 0.9rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px 8px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.narrow { max-width: 640px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.status-tabs button { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 14px; cursor: pointer; font: inherit; }
.status-tabs button.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.95rem; }
.grid th { color: var(--muted); font-weight: 650; font-size: 0.78rem; letter-spacing: 0; text-transform: none; background: #f4f8fc; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions form, .inline-form { display: inline-flex; gap: 8px; align-items: end; }
.actions button.danger, button.danger { color: var(--danger); }
.catalog .btn { background: var(--navy); color: #fff; border-radius: 999px; padding: 8px 14px; }
.btn { background: #1e40af; color: #fff; border: 1px solid #1e40af; border-radius: 10px; padding: 9px 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; font-weight: 650; font-size: 0.92rem; }
.btn.ghost { background: #fff; color: #1f2937; border: 1px solid #e5e7eb; }
.btn.small { padding: 6px 10px; margin-bottom: 8px; }
.alert { padding: 12px 14px; border-radius: 12px; background: #e7f3ec; color: var(--ok); }
.alert.err { background: #f8e8e8; color: var(--danger); }
.alert.warn { background: #f8f0e2; color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
label[hidden] { display: none; }
label.check { flex-direction: row; align-items: center; }
input, select, textarea { font: inherit; color: inherit; background: #fff; border: 1px solid #d7dbe3; border-radius: 10px; padding: 10px 12px; width: 100%; }
.pick { position: relative; width: 100%; }
.pick-value { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; background: #fff; border: 1px solid #d7dbe3; border-radius: 10px; padding: 10px 12px; font: inherit; color: inherit; }
.pick-value::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #6b7280; border-bottom: 2px solid #6b7280; transform: translateY(-2px) rotate(45deg); flex: none; }
.pick.is-open .pick-value { border-color: #93c5fd; outline: 2px solid rgba(37, 99, 235, 0.25); }
.pick:has(select.invalid) .pick-value { border-color: var(--danger); }
.pick-menu { position: fixed; z-index: 80; background: #fff; border: 1px solid #d7dbe3; border-radius: 12px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12); padding: 8px; display: grid; gap: 6px; }
.pick-menu[hidden] { display: none; }
.pick-menu input { min-width: 0; width: 100%; }
.pick-list { max-height: 240px; overflow: auto; display: grid; gap: 2px; }
.pick-option { text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; width: 100%; color: #111827; font: inherit; }
.pick-option:hover, .pick-option.is-on, .pick-option.is-current { background: #e8f0fe; color: #1d4ed8; }
.pick-empty { margin: 0; padding: 8px 10px; color: #6b7280; }
.filters .pick, .inline-form .pick { width: auto; min-width: 220px; }
.search-pill .pick { width: auto; flex: none; max-width: 190px; }
.search-pill .pick-value { border: 0; border-left: 1px solid #e5e7eb; border-radius: 0; background: transparent; padding: 8px 4px 8px 12px; font-weight: 650; color: #111827; outline: none; }
.search-pill .pick.is-open .pick-value { outline: none; border-color: #e5e7eb; }
textarea.code { font-family: Consolas, monospace; font-size: 0.85rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.25); border-color: #93c5fd; }
.date-field { position: relative; }
.date-field input[type="date"] { color-scheme: light; padding-right: 46px; min-height: 44px; }
.date-field input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; display: none; }
.date-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--navy); cursor: pointer; display: grid; place-items: center; }
.date-btn:hover { background: #eef2ff; }
.date-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.date-pop { position: fixed; z-index: 200; width: 292px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; }
.date-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.date-pop-head strong { font-size: 0.95rem; text-transform: capitalize; }
.date-pop-head button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 1.3rem; color: var(--navy); }
.date-pop-head button:hover { background: #eef2ff; }
.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-grid .dow { text-align: center; font-size: 0.72rem; color: var(--muted); padding: 4px 0; }
.date-grid button { height: 34px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font: inherit; }
.date-grid button:hover { background: #eef2ff; }
.date-grid button.is-today { box-shadow: inset 0 0 0 1px var(--gold); }
.date-grid button.is-selected { background: var(--navy); color: #fff; }
input.invalid, textarea.invalid, .choices.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); margin: 4px 0 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 220px; }
.filters input[type="search"] { min-width: 320px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 12px; text-decoration: none; }
.chip.is-on { background: var(--navy); color: #fff; }
.pager { display: flex; gap: 12px; align-items: center; }
.wizard { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.step-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step-nav button { width: 100%; text-align: left; background: transparent; border: 0; border-left: 3px solid var(--line); padding: 8px 10px; cursor: pointer; color: var(--muted); font: inherit; }
.step-nav button.is-current { border-color: var(--gold); color: var(--ink); font-weight: 650; }
.step-nav button.is-done { color: var(--navy); }
.wizard-move { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; padding: 12px 14px; background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; position: sticky; top: 0; z-index: 3; }
.wizard-move [hidden] { display: none; }
.wizard-move .muted { margin-left: auto; }
.wizard-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.sign-preview { margin: 0; white-space: pre-wrap; background: #f8fafc; border: 1px solid #e6e8ee; border-radius: 12px; padding: 12px 14px; color: #1f2937; font: 0.92rem/1.45 "Segoe UI", sans-serif; }
.stage-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 0 16px; padding: 6px; background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; }
.stage-bar a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: #4b5563; font-weight: 650; text-align: center; line-height: 1.25; }
.stage-bar a span { min-width: 1.4em; text-align: center; border-radius: 999px; background: #f3f4f6; color: #6b7280; font-size: 0.78rem; padding: 2px 7px; }
.stage-bar a.is-on { background: #e8f0fe; color: #1d4ed8; }
.stage-bar a.is-on span { background: #1d4ed8; color: #fff; }
.result-card .filters { margin: 10px 0 0; }
.result-card .btn.small { margin-bottom: 0; }
.wizard-bar [hidden] { display: none; }
input[readonly] { background: #f9fafb; }
.address-card { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 0 16px; background: #f9fafb; }
.address-card > .label, .address-card > .part-modes, .address-card > .hint { grid-column: 1 / -1; margin: 0; }
.address-card .span-3 { grid-column: 1 / -1; }
.address-card .field { margin: 0; }
.doc-editor { display: grid; gap: 8px; }
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; }
.doc-toolbar button, .doc-toolbar select { width: auto; }
.doc-toolbar .insert-field { display: grid; gap: 4px; font-size: 0.82rem; color: var(--muted); min-width: 220px; }
@font-face { font-family: Carlito; font-weight: 400; font-style: normal; src: url("../fonts/Carlito-Regular.ttf") format("truetype"); }
@font-face { font-family: Carlito; font-weight: 700; font-style: normal; src: url("../fonts/Carlito-Bold.ttf") format("truetype"); }
@font-face { font-family: Carlito; font-weight: 400; font-style: italic; src: url("../fonts/Carlito-Italic.ttf") format("truetype"); }
@font-face { font-family: Carlito; font-weight: 700; font-style: italic; src: url("../fonts/Carlito-BoldItalic.ttf") format("truetype"); }
.doc-page { min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px; font-family: Carlito, Calibri, "Segoe UI", sans-serif; font-size: 12pt; line-height: 1.35; color: #1c2430; overflow: auto; }
.doc-page h1, .doc-page h2, .doc-page h3 { font-family: Carlito, Calibri, "Segoe UI", sans-serif; color: #17324d; }
.doc-page:focus { outline: 2px solid rgba(37, 99, 235, 0.25); }
.doc-page p.cl { margin: 0 0 2px; padding-left: 1.5em; text-indent: -1.5em; }
.doc-page p.l1 { margin-left: 1.5em; }
.doc-page span.n { font-weight: 700; color: #17324d; }
.part-modes { display: flex; gap: 8px; margin: 0 0 8px; }
.part-modes .choice { flex: 1; align-items: center; margin: 0; }
.part-modes .choice input { margin-top: 0; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { flex-direction: row; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.choice input { width: auto; margin-top: 4px; }
.choice span { font-size: 0.92rem; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef1f6; }
.auth-card { width: min(460px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 12px 40px rgba(16, 24, 40, 0.06); }
.auth-card.wide { width: min(640px, 100%); }
.inline-form { margin-top: 12px; }
code { font-size: 0.88em; }
@media (max-width: 900px) {
  .shell, .wizard { grid-template-columns: 1fr; }
  .side { padding-bottom: 8px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 12px; flex-direction: row; justify-content: space-between; }
  .main { padding: 20px 16px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .address-card, .address-card .span-3 { grid-template-columns: 1fr; }
  .address-card .span-3 { grid-column: auto; }
  .topbar { flex-wrap: wrap; }
  .tab { min-width: 180px; }
}
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.main { margin-right: auto; margin-left: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--navy-2); padding: 14px 22px; }
.topbar .brand { margin: 0; width: 168px; }
.top-tools { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.top-tools a, .top-tools button { color: #f4efe6; background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; }
.admin-menu { position: relative; }
.admin-menu summary { color: #1e40af; cursor: pointer; list-style: none; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu div { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px; min-width: 200px; padding: 8px; display: flex; flex-direction: column; box-shadow: var(--shadow); z-index: 6; }
.admin-menu a { color: var(--navy); padding: 8px 10px; border-radius: 8px; }
.admin-menu a:hover { background: #eef2ff; }
.tabbar { position: sticky; top: 0; z-index: 4; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-track { position: relative; display: flex; min-width: max-content; }
.tab { display: flex; align-items: center; gap: 8px; padding: 16px 22px; text-decoration: none; color: var(--muted); font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.82rem; }
.tab span { color: var(--gold); font-size: 0.75rem; }
.tab.is-active { color: var(--navy); }
.tab-indicator { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); width: 0; transition: transform 0.25s ease, width 0.25s ease; }
.main { max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2, .span-2 { grid-column: 1 / -1; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; }
.checks[hidden] { display: none; }
.result-list { display: grid; gap: 10px; margin-top: 12px; }
.result-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; }
.result-card p { margin: 4px 0; }
.client-link { grid-column: 1 / -1; margin-bottom: 8px; }
h3 { margin: 12px 0 8px; font-size: 1rem; }
.inline-form input, .inline-form select { width: auto; min-width: 160px; }
button.danger { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 800px) {
  .form-grid { grid-template-columns: 1fr; }
}
.shell.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100vh; min-height: 100vh; background: #f3f4f6; }
.sidebar { background: #fff; border-right: 1px solid #e6e8ee; display: flex; flex-direction: column; padding: 18px 14px 14px; min-height: 0; }
.wordmark { display: block; color: #111827; text-decoration: none; font-weight: 750; font-size: 1.2rem; letter-spacing: -0.03em; padding: 4px 10px 16px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: #374151; text-decoration: none; font-size: 0.92rem; font-weight: 550; }
.nav-link:hover { background: #f3f4f6; }
.nav-link.is-active, .nav-link.is-active:hover { background: #e8f0fe; color: #1d4ed8; }
.side-spacer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.service-link { display: flex; align-items: center; gap: 8px; border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; color: #374151; text-decoration: none; font-size: 0.88rem; font-weight: 650; }
.service-link:hover { background: #f8fafc; }
.user-card { display: flex; align-items: center; gap: 10px; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: #1d4ed8; color: #fff; display: grid; place-items: center; font-size: 0.75rem; font-weight: 750; flex: none; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 0.88rem; }
.user-meta span { color: #6b7280; font-size: 0.75rem; }
.gear { position: relative; }
.gear > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #6b7280; }
.gear > summary::-webkit-details-marker { display: none; }
.gear > summary:hover { background: #f3f4f6; color: #111827; }
.gear > div { position: absolute; right: 0; bottom: 38px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; min-width: 180px; padding: 6px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12); z-index: 8; display: flex; flex-direction: column; }
.gear a { color: #111827; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 0.9rem; }
.gear a:hover { background: #f3f4f6; }
.logout-form button { width: 100%; text-align: left; background: none; border: 0; color: #6b7280; font: inherit; font-weight: 600; cursor: pointer; padding: 8px 10px; border-radius: 10px; }
.logout-form button:hover { background: #f3f4f6; color: #111827; }
.app-main { overflow: auto; background: #f3f4f6; padding: 22px 28px 48px; max-width: none; margin: 0; }
.ico { width: 18px; height: 18px; flex: none; }
.btn .ico { width: 16px; height: 16px; }
.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.title-row > .ico { color: #1d4ed8; width: 22px; height: 22px; }
.count-pill { background: #eef2ff; color: #1e3a8a; border-radius: 999px; padding: 4px 10px; font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
.stat-block { margin-bottom: 8px; }
.stat-block h2, .panel-head h2 { font-size: 1rem; margin: 0 0 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid #e6e8ee; border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.stat-card .marks { display: contents; }
.stat-card strong { display: block; font-size: 1.4rem; line-height: 1.1; }
.stat-card span { color: #6b7280; font-size: 0.8rem; }
.table-card { padding: 12px 12px 8px; }
.table-scroll { overflow-x: auto; }
.cell-notes { max-width: 280px; white-space: pre-wrap; }
.grid .btn.small { margin-bottom: 0; white-space: nowrap; }
.ask { border: 0; border-radius: 16px; padding: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 16px 40px rgba(16, 24, 40, 0.18); }
.ask::backdrop { background: rgba(17, 24, 39, 0.35); }
.ask p { margin: 0 0 16px; }
.table-card .grid th:first-child { border-top-left-radius: 10px; }
.table-card .grid th:last-child { border-top-right-radius: 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.search-pill { display: flex; flex-direction: row; align-items: center; gap: 8px; background: #f3f4f6; border-radius: 999px; padding: 0 14px; min-width: min(420px, 100%); border: 1px solid transparent; color: #6b7280; }
.search-pill:focus-within { background: #fff; border-color: #bfdbfe; }
.search-pill input { border: 0; background: transparent; padding: 10px 0; min-width: 180px; width: 100%; box-shadow: none; }
.search-pill input:focus { outline: none; border: 0; }
.when, .stack-cell { display: flex; flex-direction: column; gap: 2px; }
.cell-title { font-weight: 650; color: inherit; text-decoration: none; }
.cell-title:hover { color: #1d4ed8; }
.small { font-size: 0.82rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.marks { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mark { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 0.68rem; font-weight: 750; color: #fff; }
.mark-stolowka { background: #ea580c; }
.mark-eswietlica_odbior { background: #16a34a; }
.mark-eswietlica_obecnosc { background: #65a30d; }
.mark-kontrola_dostepu { background: #2563eb; }
.mark-rcp { background: #4f46e5; }
.mark-legitymacje { background: #7c3aed; }
.mark-przedszkole { background: #0f766e; }
.mark-inne, .mark-plain { background: #64748b; }
.clip { display: inline-flex; align-items: center; gap: 4px; color: #4b5563; }
.clip .ico { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; background: #eef2ff; color: #1e3a8a; padding: 2px 8px; font-size: 0.75rem; font-weight: 650; }
.badge.bad { background: #fee2e2; color: #991b1b; margin-left: 6px; }
.facts { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 6px 14px; margin: 14px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.rspo-more { margin-top: 4px; }
.rspo-more summary { cursor: pointer; font-weight: 650; margin-bottom: 10px; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.files-top { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-bottom: 18px; }
.files-search { flex: 1 1 240px; width: auto; min-width: 0; max-width: 520px; }
.files-search .search-pill { width: 100%; min-width: 0; background: #fff; border-color: #e5e7eb; }
.files-search .search-pill input { min-width: 0; }
.files-search select { border: 0; border-left: 1px solid #e5e7eb; background: transparent; width: auto; max-width: 160px; flex: none; margin-left: 6px; padding: 8px 2px 8px 12px; font-weight: 650; color: #111827; }
.pick > select { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.search-pill .pick-menu input { border: 1px solid #d7dbe3; background: #fff; padding: 10px 12px; min-width: 0; border-radius: 10px; }
.search-pill .pick-menu input:focus { outline: 2px solid rgba(37, 99, 235, 0.25); border-color: #93c5fd; }
.files-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-left: auto; flex-wrap: wrap; }
.view-switch { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff; }
.view-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; text-decoration: none; color: #4b5563; font-weight: 650; font-size: 0.88rem; }
.view-switch a.is-on { background: #f3f4f6; color: #111827; }
.view-switch .ico { width: 15px; height: 15px; }
.new-folder { position: relative; }
.new-folder > summary { list-style: none; }
.new-folder > summary::-webkit-details-marker { display: none; }
.new-folder > form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 7; width: min(320px, 80vw); background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; padding: 14px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12); display: grid; gap: 10px; }
.files-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; }
.files-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.files-filters strong { font-size: 0.92rem; margin-right: 4px; }
.filter-chip, .chip-menu > summary { border: 1px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 7px 12px; text-decoration: none; color: #374151; font-size: 0.86rem; font-weight: 650; cursor: pointer; list-style: none; }
.chip-menu > summary::-webkit-details-marker { display: none; }
.filter-chip.is-on, .chip-menu > summary.is-on { background: #e8f0fe; color: #1d4ed8; border-color: #d7e3fc; }
.chip-menu { position: relative; }
.chip-menu > div { position: absolute; left: 0; top: calc(100% + 6px); z-index: 6; background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; min-width: 160px; padding: 6px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12); display: flex; flex-direction: column; }
.chip-menu a, .kebab a, .kebab button { color: #111827; text-decoration: none; background: none; border: 0; text-align: left; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.chip-menu a:hover, .kebab a:hover, .kebab button:hover { background: #f3f4f6; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.file-rows { display: flex; flex-direction: column; gap: 8px; }
.file-card { position: relative; background: #fff; border: 1px solid #e6e8ee; border-radius: 16px; min-height: 132px; }
.file-rows .file-card { min-height: 0; }
.file-card-link { display: flex; flex-direction: column; gap: 4px; padding: 16px 36px 14px 14px; color: inherit; text-decoration: none; min-height: 132px; }
.file-rows .file-card-link { min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 10px 44px 10px 12px; }
.file-card-link strong { font-size: 0.95rem; line-height: 1.3; }
.file-rows .file-card-link strong { margin-right: auto; }
.ico-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 0.68rem; font-weight: 750; }
.ico-badge .ico { width: 22px; height: 22px; }
.ico-badge.blue { background: #e8f1ff; color: #1d4ed8; }
.ico-badge.green { background: #e7f8ee; color: #15803d; }
.file-card > .kebab { position: absolute; top: 8px; right: 8px; }
.kebab > summary { list-style: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; color: #6b7280; font-weight: 750; }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab > summary:hover { background: #f3f4f6; color: #111827; }
.kebab > div { position: absolute; right: 0; top: 32px; z-index: 8; background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; min-width: 220px; padding: 8px; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.12); display: grid; gap: 6px; }
.kebab form { display: grid; gap: 6px; }
.kebab .danger { color: var(--danger); }
.files-count { margin: 12px 2px 0; }
.file-card > form { padding: 0 14px 14px; }
@media (max-width: 900px) {
  .files-search { max-width: none; flex-basis: 100%; }
  .stage-bar { grid-template-columns: 1fr; }
}
.file-list li { display: flex; gap: 10px; align-items: center; }
.file-ico { width: 40px; height: 40px; border-radius: 10px; background: #eef2ff; color: #1d4ed8; display: grid; place-items: center; font-size: 0.62rem; font-weight: 750; flex: none; }
.panel-head { align-items: center; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.panel-head a { color: #1d4ed8; font-weight: 650; font-size: 0.9rem; text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 4px 6px; }
.pager-meta { color: #6b7280; font-size: 0.85rem; }
.pager-nav { display: flex; gap: 6px; }
.pager-nav a { width: 34px; height: 34px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e5e7eb; background: #fff; text-decoration: none; color: #374151; font-weight: 650; }
.pager-nav a.is-on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.actions button:not(.btn):not(.danger), .grid button:not(.btn):not(.danger) { color: #1e40af; }
.table-card .actions .btn.small { margin-bottom: 0; }
@media (max-width: 900px) {
  .shell.app-shell { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: 0; border-bottom: 1px solid #e6e8ee; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .side-spacer { margin-top: 12px; }
  .app-main { padding: 16px; }
  .search-pill { min-width: 100%; }
}
/* Design refresh */
:root { --bg: #f5f7fb; --line: #e7eaf0; --muted: #6b7280; --blue: #1d4ed8; --blue-soft: #eef3ff; --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.04); --shadow-pop: 0 14px 34px rgba(16, 24, 40, 0.14); }
body { background: var(--bg); -webkit-font-smoothing: antialiased; }
.shell.app-shell, .app-main { background: var(--bg); }
.app-main { padding: 26px 32px 56px; scrollbar-width: thin; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; }
.page-head { flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; line-height: 1.25; }
.page-head .actions { gap: 8px; }
.eyebrow { font-size: 0.75rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; }
.title-row > .ico { width: 22px; height: 22px; padding: 7px; box-sizing: content-box; border-radius: 10px; background: var(--blue-soft); }
.hint { font-size: 0.9rem; }

.sidebar { padding: 20px 14px 14px; }
.wordmark { display: flex; align-items: center; gap: 10px; padding: 2px 10px 20px; font-size: 1.15rem; }
.wordmark::before { content: "L"; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff; font-size: 0.95rem; font-weight: 800; letter-spacing: 0; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25); }
.nav-link { padding: 9px 12px; font-weight: 550; transition: background-color 0.15s, color 0.15s; }
.nav-link .ico { color: #6b7280; transition: color 0.15s; }
.nav-link:hover { background: #f5f7fb; color: #111827; }
.nav-link:hover .ico { color: #374151; }
.nav-link.is-active, .nav-link.is-active:hover { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.nav-link.is-active .ico { color: var(--blue); }
.service-link, .user-card { transition: background-color 0.15s, border-color 0.15s; }
.service-link:hover { border-color: #d1d5db; }

.panel { border-color: var(--line); border-radius: 14px; padding: 20px 20px 14px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel > h2:first-child, .panel > form > h2:first-child { margin-bottom: 14px; }
.panel h2 + .hint, .panel h2 + .muted { margin-top: -6px; }
.table-card { padding: 16px 16px 10px; }
.panel-head { margin-bottom: 12px; }

.btn { min-height: 40px; padding: 8px 15px; border-radius: 10px; font-size: 0.9rem; background: var(--blue); border-color: var(--blue); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s; white-space: nowrap; }
.btn:hover { background: #1e3a8a; border-color: #1e3a8a; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .pick-value:focus-visible, .nav-link:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.3); outline-offset: 2px; }
.btn.ghost { background: #fff; color: #1f2937; border-color: #dfe3ea; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04); }
.btn.ghost:hover { background: #f8fafc; border-color: #c9cfd9; color: #111827; }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 0.84rem; border-radius: 8px; }
.btn[disabled], .btn:disabled { opacity: 0.55; cursor: not-allowed; }

label { font-size: 0.86rem; font-weight: 600; color: #374151; }
label.check, .choice { font-weight: 500; }
:where(input, select, textarea) { font-weight: 400; color: #111827; border-color: #d5dae2; transition: border-color 0.15s, box-shadow 0.15s; }
:where(input, select, textarea):hover { border-color: #b9c0cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16); }
input::placeholder, textarea::placeholder { color: #9ca3af; }
.pick-value { font-weight: 400; color: #111827; border-color: #d5dae2; min-height: 42px; transition: border-color 0.15s, box-shadow 0.15s; }
.pick-value:hover { border-color: #b9c0cc; }
.pick.is-open .pick-value { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16); }
.pick-menu { border-color: var(--line); box-shadow: var(--shadow-pop); padding: 8px; }
.pick-option { font-size: 0.92rem; }
.search-pill { background: #f3f5f9; border-color: #e7eaf0; min-height: 42px; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
.search-pill:focus-within { background: #fff; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }
.search-pill input, .search-pill input:focus { box-shadow: none; }
.search-pill .pick-value { min-height: 0; box-shadow: none; }
.search-pill .pick.is-open .pick-value { box-shadow: none; }

.toolbar { gap: 10px 12px; margin: 0 0 14px; }
.toolbar > .search-pill { flex: 1 1 260px; max-width: 480px; }
.toolbar > label:not(.search-pill) { flex-direction: row; align-items: center; gap: 8px; color: #6b7280; font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.toolbar > label:not(.search-pill) .pick { width: auto; min-width: 200px; }
.toolbar > label:not(.search-pill) .pick-value { min-height: 40px; padding: 8px 12px; font-size: 0.9rem; }

.grid th, .grid td { padding: 12px; font-size: 0.92rem; border-bottom-color: #eef0f4; }
.grid th { background: #f8fafc; color: #6b7280; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; border-bottom-color: var(--line); }
.grid tbody tr { transition: background-color 0.12s; }
.grid tbody tr:hover > td { background: #fafbfe; }
.grid tbody tr:last-child > td { border-bottom: 0; }
.grid td a:not(.btn):not(.cell-title), .actions a:not(.btn), .facts a { color: var(--blue); text-decoration: none; font-weight: 550; }
.grid td a:not(.btn):not(.cell-title):hover, .actions a:not(.btn):hover, .facts a:hover { text-decoration: underline; }
.grid td a.muted { color: #6b7280; font-weight: 400; }
.grid td.actions { display: table-cell; text-align: right; vertical-align: top; min-width: 110px; }
.grid td.actions > * { display: inline-flex; vertical-align: middle; margin: 0 0 4px 10px; white-space: nowrap; }
.grid td:first-child:has(> .cell-title) { min-width: 220px; }
.grid td.actions > *:first-child { margin-left: 0; }
.grid td.actions form { gap: 8px; }
.actions button:not(.btn), .grid button:not(.btn) { font-weight: 550; }
.table-scroll { margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }
label input, label select, label textarea, label .pick-value { font-weight: 400; }
.stack > .btn, .stack > .actions { align-self: flex-start; }
.choice:has(input:checked) { border-color: #93c5fd; background: #f5f8ff; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 6px; }
.panel > .table-scroll + h2, .sub-head { margin-top: 22px; padding-top: 18px; border-top: 1px solid #eef0f4; }
.files-top h1 { font-size: 1.45rem; margin: 0; }
.files-filters > a:not(.filter-chip) { color: #4b5563; font-size: 0.86rem; font-weight: 600; text-decoration: none; padding: 7px 6px; }
.files-filters > a:not(.filter-chip):hover { color: var(--blue); }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 0.78rem; color: #6b7280; }
.task-meta .is-late { color: #b45309; font-weight: 600; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--blue); }
.stage-track { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stage-track li { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; color: #6b7280; font-size: 0.84rem; font-weight: 600; }
.stage-track i { flex: none; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-style: normal; font-size: 0.75rem; font-weight: 700; border: 1.5px solid #d5dae2; background: #fff; }
.stage-track li.is-done { color: #15803d; }
.stage-track li.is-done i { background: #dcfce7; border-color: #86efac; color: #15803d; }
.stage-track li.is-on { background: var(--blue-soft); color: var(--blue); }
.stage-track li.is-on i { background: var(--blue); border-color: var(--blue); color: #fff; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.task-notes { margin: 0; white-space: normal; color: #1f2937; line-height: 1.6; }
.comment-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.comment-list li { display: flex; gap: 12px; align-items: flex-start; }
.avatar.small { width: 32px; height: 32px; font-size: 0.7rem; }
.comment-body { flex: 1; min-width: 0; background: #f8fafc; border: 1px solid #eef0f4; border-radius: 12px; padding: 10px 14px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 4px; }
.comment-head strong { font-size: 0.9rem; }
.comment-head form { margin-left: auto; }
.comment-head button.danger { font-size: 0.8rem; }
.comment-body p { margin: 0; font-size: 0.92rem; line-height: 1.55; overflow-wrap: anywhere; }
.comment-form { padding-top: 14px; border-top: 1px solid #eef0f4; }
.task-facts { margin: 0; display: grid; gap: 0; }
.task-facts dt { font-size: 0.74rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: #6b7280; padding-top: 10px; }
.task-facts dd { margin: 0; padding: 2px 0 10px; border-bottom: 1px solid #eef0f4; display: flex; flex-direction: column; gap: 1px; font-size: 0.92rem; }
.task-facts dd:last-child { border-bottom: 0; }
.task-facts a { color: var(--blue); text-decoration: none; font-weight: 600; }
.reminder-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.reminder-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.reminder-list li > div { flex: 1; min-width: 0; }
.reminder-list strong { font-size: 0.88rem; }
.reminder-list p { margin: 2px 0 0; font-size: 0.88rem; color: #374151; overflow-wrap: anywhere; }
.reminder-list li.is-late { border-color: #fcd34d; background: #fffbeb; }
.reminder-list li.is-done { opacity: 0.65; }
.reminder-list li.is-done p, .reminder-list li.is-done strong { text-decoration: line-through; }
.reminder-list button.danger { font-size: 0.8rem; }
.tick { width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 1.5px solid #c3cad6; background: #fff; color: #15803d; font-weight: 800; font-size: 0.8rem; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tick:hover { border-color: var(--blue); }
.is-done .tick { background: #dcfce7; border-color: #86efac; }
.reminder-form .form-grid { gap: 10px; }
.calendar-head { flex-wrap: wrap; gap: 10px; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-nav strong { min-width: 150px; text-align: center; font-size: 0.95rem; }
.calendar-nav .btn.small { min-width: 32px; justify-content: center; font-size: 1rem; }
.calendar-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; align-items: start; }
.calendar-scroll { overflow-x: auto; }
.calendar { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calendar th { padding: 8px 6px; background: #f8fafc; color: #6b7280; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); }
.calendar td { height: 92px; padding: 6px; vertical-align: top; border-right: 1px solid #eef0f4; border-bottom: 1px solid #eef0f4; background: #fff; }
.calendar tr > td:last-child { border-right: 0; }
.calendar tbody tr:last-child > td { border-bottom: 0; }
.calendar td.is-weekend { background: #fbfcfe; }
.calendar td.is-out { background: #f8f9fb; }
.calendar td.is-out .cal-day { color: #c0c6d0; }
.cal-day { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; color: #374151; margin-bottom: 4px; }
.calendar td.is-today .cal-day { background: var(--blue); color: #fff; }
.calendar td.is-today { background: #f7faff; }
.cal-item { display: block; margin-top: 3px; padding: 3px 6px; border-radius: 6px; background: var(--blue-soft); color: #1e3a8a; font-size: 0.74rem; line-height: 1.3; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--blue); }
.cal-item b { font-weight: 700; }
.cal-item:hover { background: #dfe8ff; }
.cal-item.is-late { background: #fff7e6; color: #92400e; border-left-color: #f59e0b; }
.cal-item.is-done { background: #f1f5f9; color: #94a3b8; border-left-color: #cbd5e1; text-decoration: line-through; }
.calendar-side h3 { margin: 0 0 10px; font-size: 0.9rem; }
.calendar-side .alert { margin-bottom: 10px; padding: 8px 10px 8px 12px; }
.upcoming-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.upcoming-list a { display: flex; flex-direction: column; gap: 1px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; transition: border-color 0.15s, background-color 0.15s; }
.upcoming-list a:hover { border-color: #93c5fd; background: #f8fbff; }
.upcoming-list strong { font-size: 0.88rem; }
.up-date { font-size: 0.74rem; font-weight: 700; color: var(--blue); }
.badge.ok { background: #dcfce7; color: #166534; margin-left: 6px; }
.mail-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #334155; font: 600 0.74rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; vertical-align: middle; }
.cell-subject .mail-tag { margin-left: 6px; }
.calendar-head .view-switch { margin-left: auto; }
.calendar-head .view-switch a { padding: 6px 12px; font-size: 0.84rem; }
.calendar-head .view-switch a.is-on { background: var(--blue-soft); color: #1e40af; }
a.cal-day { text-decoration: none; }
a.cal-day:hover { background: #e8eefc; }
.calendar td.is-today a.cal-day:hover { background: var(--blue); }
.calendar.is-week td { height: 260px; }
.calendar.is-week .cal-item { white-space: normal; overflow-wrap: break-word; padding: 5px 7px; }
.calendar.is-week .cal-item small { display: block; margin-top: 2px; font-size: 0.72rem; opacity: 0.85; }
.today-panel .panel-head { flex-wrap: wrap; gap: 6px; }
.today-panel .empty-state { padding: 18px 16px; margin: 0; }
.today-list { margin: 0; }
.today-list li { align-items: center; }
.today-list li > div { line-height: 1.35; }
.today-time { flex: 0 0 auto; min-width: 48px; font-weight: 750; font-size: 0.9rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.is-late .today-time { color: #b45309; }
.is-done .today-time { color: #94a3b8; }
.today-list .cell-title, .day-list .cell-title { font-size: 0.92rem; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day-list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 12px; background: #fff; }
.day-list li > div { flex: 1; min-width: 0; }
.day-list p { margin: 3px 0; font-size: 0.9rem; color: #374151; overflow-wrap: anywhere; }
.day-list li.is-late { border-left-color: #f59e0b; background: #fffbeb; }
.day-list li.is-done { border-left-color: #cbd5e1; opacity: 0.7; }
.day-list li.is-done p { text-decoration: line-through; }
@media (max-width: 1100px) {
  .task-layout, .calendar-wrap { grid-template-columns: 1fr; }
}
.password-field { display: flex; gap: 8px; align-items: center; }
.password-field input { flex: 1; min-width: 0; }
.password-field .btn.small { margin: 0; min-height: 42px; }
.panel h3 { font-size: 0.95rem; margin: 18px 0 10px; }
.panel h3.sub-head { margin-top: 22px; }
.alert a { word-break: break-all; }
.client-summary p { margin: 0 0 8px; }
.client-address { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.client-address .ico { color: var(--blue); }
.client-delete { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef0f4; }
.client-delete button.danger { font-size: 0.88rem; font-weight: 600; }
.cell-subject { min-width: 240px; }
.cell-subject .small { max-width: 380px; }
.nowrap { white-space: nowrap; }
.cell-notes { color: #4b5563; font-size: 0.88rem; }
.empty-cell { text-align: center !important; color: #6b7280; padding: 36px 12px !important; }
.empty-state { margin: 4px 0 8px; padding: 40px 16px; text-align: center; color: #6b7280; border: 1px dashed #d9dee7; border-radius: 12px; background: #fafbfd; }

.alert { display: block; margin: 0 0 16px; padding: 12px 14px 12px 16px; border: 1px solid #bbf7d0; border-left-width: 4px; border-radius: 10px; background: #f0fdf4; color: #166534; font-size: 0.92rem; }
.alert.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; border-left-color: #dc2626; }
.alert.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; border-left-color: #f59e0b; }
.alert:not(.err):not(.warn) { border-left-color: #16a34a; }

.stat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { border-color: var(--line); border-radius: 14px; padding: 14px; gap: 12px; box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s; }
.stat-card:hover { border-color: #d5dbe6; box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06); }
.stat-card .mark { width: 42px; height: 42px; border-radius: 12px; font-size: 0.95rem; color: #fff; flex: none; }
.stat-card .ico-badge { flex: none; }
a.stat-card { color: inherit; text-decoration: none; }
a.stat-card:hover { border-color: #93c5fd; }.stat-card strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-card span:not(.mark):not(.ico-badge) { display: block; margin-top: 2px; color: #6b7280; font-size: 0.82rem; }
.stat-block h2 { color: #374151; }
.badge { padding: 3px 9px; font-size: 0.74rem; background: var(--blue-soft); color: #1e40af; }
.count-pill { background: var(--blue-soft); color: #1e40af; }

.stage-bar { display: flex; gap: 6px; padding: 6px; border-color: var(--line); box-shadow: var(--shadow); margin-bottom: 18px; flex-wrap: wrap; }
.stage-bar a { flex: 1 0 auto; justify-content: flex-start; gap: 10px; padding: 10px 12px; text-align: left; font-size: 0.88rem; color: #4b5563; white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.stage-bar a:hover { background: #f5f7fb; color: #111827; }
.stage-bar a i { flex: none; width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-style: normal; font-size: 0.78rem; font-weight: 700; border: 1.5px solid #d5dae2; color: #6b7280; background: #fff; }
.stage-bar a b { font-weight: 650; flex: 1 0 auto; }
.grid td .btn.small[data-stage-open] { white-space: normal; text-align: left; min-width: 190px; max-width: 240px; line-height: 1.3; }
.stage-bar a span { flex: none; }
.stage-bar a.is-on { background: var(--blue-soft); color: var(--blue); }
.stage-bar a.is-on i { background: var(--blue); border-color: var(--blue); color: #fff; }

.ask { padding: 24px; border-radius: 16px; box-shadow: var(--shadow-pop); }
.ask h2 { margin: 0 0 8px; font-size: 1.1rem; }
.ask p { color: #4b5563; margin: 0 0 20px; }
.ask .actions { flex-direction: row-reverse; justify-content: flex-start; gap: 8px; }
.ask::backdrop { background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(2px); }

.facts { gap: 0; }
.facts dt, .facts dd { padding: 8px 0; border-bottom: 1px solid #eef0f4; }
.facts dt { font-size: 0.88rem; }
.result-card { border-color: var(--line); box-shadow: var(--shadow); }
.address-card { border-color: var(--line); }
.choice { border-color: var(--line); transition: border-color 0.15s, background-color 0.15s; }
.choice:hover { border-color: #c9cfd9; background: #fafbfd; }
.chip { border-color: #dfe3ea; color: #374151; font-weight: 600; font-size: 0.88rem; transition: background-color 0.15s, border-color 0.15s; }
.chip:hover { border-color: #c9cfd9; background: #f8fafc; }
.chip.is-on, .chip.is-on:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.system-card { border-color: var(--line); border-radius: 14px; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.system-card:hover { border-color: #93c5fd; box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08); transform: translateY(-1px); }
.file-card { border-color: var(--line); box-shadow: var(--shadow); transition: border-color 0.15s, box-shadow 0.15s; }
.file-card:hover { border-color: #d5dbe6; box-shadow: 0 6px 16px rgba(16, 24, 40, 0.07); }
.step-nav button { border-radius: 0 8px 8px 0; transition: background-color 0.15s, color 0.15s; }
.step-nav button:hover { background: #f5f7fb; color: #111827; }
.step-nav button.is-current { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.wizard-move, .wizard-bar { border-color: var(--line); box-shadow: var(--shadow); }
.pager-nav a { transition: background-color 0.15s, border-color 0.15s; }
.pager-nav a:not(.is-on):hover { background: #f5f7fb; border-color: #c9cfd9; }
.gear > div, .chip-menu > div, .kebab > div, .new-folder > form { box-shadow: var(--shadow-pop); }

.auth-body { background: radial-gradient(1200px 600px at 10% -10%, #e0e9ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e6f0ff 0%, transparent 55%), #f5f7fb; }
.auth-card { border-color: var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.08); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .btn { width: 100%; justify-content: center; min-height: 44px; }

tr.is-new td { background: #f2f7ff; }
.agent-notes { margin-top: 6px; font-size: 0.86rem; }
.agent-notes summary { cursor: pointer; color: var(--muted); }
.agent-notes ul { margin: 6px 0; padding-left: 18px; }
.agent-notes p { margin: 4px 0 0; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
form[data-busy] .btn[disabled] { cursor: progress; }
form:not(:has(select[name="ai_provider"] option[value="openai"]:checked)) [data-openai-only] { display: none; }

@media (max-width: 900px) {
  .app-main { padding: 18px 16px 40px; }
  .toolbar > label:not(.search-pill) { flex: 1 1 100%; }
  .toolbar > label:not(.search-pill) .pick { flex: 1; }
  .stage-bar { flex-direction: column; }
}
