:root {
  --ink: #20283b;
  --muted: #58657b;
  --grey: #eef1f5;
  --line: #e4e8ee;
  --surface: #fff;
  --canvas: #f5f7fa;
  --blue: #244bc5;
  --navy: #192a52;
  --red: #a82a37;
  --amber: #8b4f08;
  --green: #166853;
  --radius: 15px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #426de5; outline-offset: 3px; }
svg { width: 19px; height: 19px; display: block; flex-shrink: 0; }
[data-icon] { display: inline-flex; vertical-align: middle; flex-shrink: 0; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); padding: 25px 15px 17px; z-index: 2; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 0 5px 28px; }
.brand-logo { display: block; width: 120px; height: auto; }
.workspace strong { display: block; font-size: 14px; letter-spacing: -.015em; }
.brand small, .workspace small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; min-height: 44px; align-items: center; gap: 11px; padding: 0 11px; color: var(--muted); font-weight: 550; border-radius: 9px; white-space: nowrap; }
.sidebar nav a:hover { background: var(--canvas); color: var(--ink); }
.sidebar nav a[aria-current="page"] { background: #eaf0ff; color: #2445ac; font-weight: 700; }
.nav-count { margin-left: auto; background: #edf0f7; color: #415170; border-radius: 99px; font-size: 11px; padding: 2px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.workspace { display: flex; align-items: center; gap: 9px; padding: 0 3px; }
.workspace-icon { padding: 8px; background: #edf2fc; color: #3e5282; border-radius: 9px; }
.workspace small { font-size: 10.5px; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; min-height: 70px; background: #fff; padding: 10px 32px; border-bottom: 1px solid var(--line); }
.breadcrumb, .today { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.profile-picker { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfe; }
.profile-avatar { display: grid; place-items: center; flex-shrink: 0; width: 31px; height: 31px; border-radius: 9px; color: #34548a; background: #e8eef9; font-size: 12px; font-weight: 750; }
.profile-copy { display: grid; gap: 2px; }
.profile-copy label { color: var(--muted); font-size: 10px; }
.profile-person { font-size: 11px; color: var(--muted); max-width: 180px; overflow-wrap: anywhere; }
.profile-copy select:disabled { opacity: 1; cursor: default; }
.login-panel { margin: 35px auto; width: min(100%, 470px); }
.form-error { color: var(--red); line-height: 1.4; font-size: 13px; margin: 0; }
.user-list { display: grid; gap: 12px; }
.user-record { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.user-record span { color: var(--muted); font-size: 12px; }
.credentials { display: grid; gap: 7px; }
.credentials span { color: var(--muted); font-size: 12px; }
.credentials strong { user-select: all; overflow-wrap: anywhere; }
.profile-copy select { width: 137px; min-height: 22px; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 13px; font-weight: 650; cursor: pointer; }
.startup-panel { padding: 20px; max-width: 690px; }
.startup-panel p, .migration-note { line-height: 1.5; margin: 9px 0 14px; color: var(--muted); }
.migration-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.breadcrumb svg { width: 13px; height: 13px; color: #738198; }
.today svg { width: 15px; height: 15px; }
main { max-width: 1560px; margin: auto; padding: 29px 32px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 23px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 2.6vw, 35px); font-weight: 760; letter-spacing: -.045em; line-height: 1.12; }
h2 { font-size: 17px; font-weight: 730; letter-spacing: -.025em; }
h3 { font-size: 14px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 7px; line-height: 1.45; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 13px; color: var(--ink); font-weight: 650; white-space: nowrap; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.button:hover { background: #f0f3f8; }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover { background: #1d3da5; }
.button svg { width: 17px; height: 17px; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 21px; }
.stat { display: flex; align-items: flex-start; justify-content: space-between; text-align: left; gap: 7px; min-height: 111px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 15px 13px; }
.stat:hover, .stat[aria-pressed="true"] { border-color: #7995e8; }
.stat[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #7995e8; }
.stat-label { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-value { display: block; font-size: 34px; line-height: 1; font-weight: 760; margin-top: 5px; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-note { display: block; color: var(--muted); margin-top: 5px; font-size: 11px; }
.stat-icon { padding: 8px; border-radius: 9px; }
.stat-icon svg { width: 18px; height: 18px; }
.overdue { background: #fcebee; color: var(--red); }
.today-tone { background: #fff0dc; color: var(--amber); }
.tomorrow { background: #e9efff; color: #2f53ae; }
.soon { background: #ecf0f6; color: #405374; }
.later { background: #eff2f6; color: #465670; }
.closed { background: #e6f5ed; color: var(--green); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .37fr); align-items: start; gap: 18px; }
.right-column { display: grid; gap: 15px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px; gap: 10px; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.4; }
.text-link { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); font-weight: 650; font-size: 12px; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.text-link svg { width: 14px; height: 14px; }
.journal-tabs { display: flex; gap: 16px; padding: 0 16px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.journal-tabs a { padding: 7px 0 9px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 650; }
.journal-tabs a:hover { color: var(--blue); }
.journal-tabs a[aria-current="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 13px; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; border-radius: 8px; padding: 3px; background: #f0f2f6; }
.tab { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 6px 8px; font-size: 12px; font-weight: 630; }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { background: white; color: var(--ink); box-shadow: 0 1px 3px #25386017; }
.search { display: flex; align-items: center; gap: 7px; padding: 0 8px; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.search svg { width: 15px; height: 15px; }
.search input { background: transparent; border: 0; color: var(--ink); outline: 0; min-width: 0; width: 119px; font-size: 12px; }
.search:focus-within { outline: 2px solid #426de5; outline-offset: 2px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #f7f8fb; border-block: 1px solid var(--line); color: var(--muted); font-size: 11px; padding: 10px 10px; font-weight: 650; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 12px 10px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
tbody tr:has(.row-title:hover) { background: #f9faff; }
.row-title { display: block; text-align: left; border: 0; color: var(--ink); background: transparent; padding: 0; font-weight: 670; min-width: 105px; line-height: 1.3; }
.row-title:hover { color: var(--blue); text-decoration: underline; }
.secondary { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.35; }
.owner { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.owner-list { display: grid; gap: 5px; min-width: 118px; }
.deadline { font-variant-numeric: tabular-nums; min-width: 105px; }
.avatar { flex: 0 0 auto; display: inline-grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #e8edfb; color: #3a5083; font-size: 10px; font-weight: 750; }
.avatar[data-color="1"] { background: #e8f3ed; color: #2b6c55; }
.avatar[data-color="2"] { background: #f2eafb; color: #684b94; }
.avatar[data-color="3"] { background: #faeee0; color: #855a28; }
.pill, .priority { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 4px 7px; border-radius: 6px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.in-window { background: #e6f5ed; color: var(--green); }
.row-open, .icon-button { border: 0; background: transparent; color: #596a89; border-radius: 8px; padding: 6px; display: inline-flex; }
.row-open:hover, .icon-button:hover { background: #edf1f8; color: var(--blue); }
.row-open svg { width: 15px; height: 15px; }
.project-entry, .person-entry { display: block; padding: 12px 16px; border-top: 1px solid var(--line); }
.project-entry:hover, .person-entry:hover { background: #f9faff; }
.project-title, .person-entry { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-title strong { line-height: 1.3; font-size: 13px; }
.project-title svg { width: 13px; height: 13px; color: #62708a; }
.project-bar { height: 4px; border-radius: 99px; display: flex; overflow: hidden; background: #edf0f7; margin-top: 9px; }
.project-bar span { display: block; background: #4065ce; }
.project-bar span.risk { background: #da858b; }
.project-bar span.done { background: #64a795; }
.person-entry .owner { font-weight: 650; }
.person-entry .secondary { margin: 0; text-align: right; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 257px), 1fr)); gap: 15px; }
.item-card { display: block; padding: 17px; }
.item-card:hover { border-color: #9db0e7; }
.item-card h2 { margin-top: 8px; }
.item-card .secondary { margin-top: 7px; font-size: 12px; }
.item-card .owner { font-size: 15px; font-weight: 650; }
.priority { background: #f5ecdc; color: #79531c; }
.context-bar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding: 11px 16px; background: #eef3ff; color: #344d90; font-size: 12px; }
.context-bar button { padding: 0; border: 0; background: transparent; color: inherit; text-decoration: underline; }
.empty { padding: 24px 16px; color: var(--muted); text-align: center; line-height: 1.5; }
.alert-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.alert-info { color: var(--muted); margin-bottom: 19px; line-height: 1.5; }
.alert-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.alert-row .secondary { font-size: 12px; }
dialog { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 26px); border: 1px solid var(--line); padding: 0; border-radius: 16px; color: var(--ink); box-shadow: 0 20px 80px #17234345; }
dialog::backdrop { background: #15203e66; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 20px; padding-top: 3px; overflow-wrap: anywhere; }
.modal-body { padding: 18px 21px; }
.modal-footer { padding: 12px 21px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 650; font-size: 12px; align-content: start; }
.field.wide { grid-column: 1 / -1; }
.field input:not([type="checkbox"]), .field select, .field textarea { width: 100%; border: 1px solid #cfd6e3; border-radius: 8px; background: #fff; padding: 9px; color: var(--ink); font-weight: 450; }
.field textarea { resize: vertical; min-height: 70px; }
.field input[type="date"] { cursor: pointer; }
.field input[type="date"]::-webkit-calendar-picker-indicator { pointer-events: none; }
.date-field { position: relative; }
.date-calendar { position: absolute; left: 0; z-index: 4; width: min(292px, calc(100vw - 54px)); padding: 10px; border: 1px solid #ccd5e6; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px #17234330; }
.calendar-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.calendar-head strong { flex: 1; text-align: center; font-size: 12px; text-transform: capitalize; }
.calendar-head button, .calendar-grid button { border: 0; border-radius: 6px; background: transparent; color: var(--ink); padding: 0; min-height: 32px; }
.calendar-head button { width: 25px; font-size: 21px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.calendar-weekday { text-align: center; color: var(--muted); font-size: 11px; padding-bottom: 5px; }
.calendar-grid button { font-size: 12px; font-weight: 550; }
.calendar-grid button[data-today] { box-shadow: inset 0 0 0 1px #a8b9e7; color: var(--blue); }
.calendar-head button:hover, .calendar-grid button:hover { background: #eaf0ff; }
.calendar-grid button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.calendar-grid button:disabled { color: #a4aebf; cursor: default; background: transparent; }
.field.check { display: flex; align-items: center; gap: 7px; }
.field .secondary { font-weight: 450; }
.owner-review { padding: 12px; border: 1px solid #e9d3b3; border-radius: 8px; background: #fcf5e9; }
.owner-review > strong { color: var(--amber); margin-bottom: 3px; }
.shortcuts { display: flex; flex-wrap: wrap; gap: 6px; }
.shortcuts button { padding: 5px 7px; min-height: 0; font-size: 11px; }
.repeat-controls { min-width: 0; padding: 0; margin: 6px 0 0; border: 0; }
.repeat-controls legend { padding: 0; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.repeat-controls button[aria-pressed="true"] { color: var(--blue); background: #eaf0ff; border-color: #94a9e6; }
.detail-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-bottom: 17px; }
.detail-meta > div { padding: 10px; background: var(--canvas); border-radius: 8px; }
.detail-meta strong { display: block; margin-top: 4px; font-size: 13px; overflow-wrap: anywhere; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; margin: 7px 0 16px; }
.history { display: grid; gap: 10px; margin: 11px 0 0; padding: 0; list-style: none; }
.history li { border-left: 2px solid #cbd7f4; padding-left: 9px; }
.history .detail-text { margin-bottom: 3px; }
.toast { position: fixed; bottom: 20px; right: 20px; max-width: calc(100% - 40px); background: var(--navy); color: #fff; box-shadow: 0 4px 20px #0f24534b; border-radius: 8px; padding: 12px 15px; z-index: 5; }
@media (max-width: 1180px) {
  .shell { grid-template-columns: 193px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .topbar, main { padding-inline: 22px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) minmax(209px, .35fr); gap: 13px; }
}
@media (max-width: 1010px) {
  .dashboard { grid-template-columns: 1fr; }
  .right-column { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 10px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0; }
  .brand-logo { width: 92px; }
  .brand small, .sidebar-foot, .breadcrumb > span { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; padding: 3px; margin-inline: -3px; }
  .sidebar nav a { gap: 5px; padding-inline: 8px; min-height: 36px; font-size: 12px; }
  .sidebar nav a svg { width: 15px; height: 15px; }
  .topbar { min-height: 41px; }
  .topbar, main { padding-inline: 13px; }
  main { padding-top: 15px; }
  .page-head { margin-bottom: 15px; align-items: flex-start; flex-wrap: wrap; }
  .page-head p { font-size: 12px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .stat { min-height: 89px; padding: 10px; }
  .stat-value { font-size: 26px; }
  .stat-icon { padding: 6px; }
  .right-column, .alert-grid { grid-template-columns: 1fr; }
  th, td { padding-inline: 8px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 7px; }
}
@media (max-width: 420px) {
  .fields { grid-template-columns: 1fr; }
  .modal-head, .modal-body, .modal-footer { padding-inline: 13px; }
}
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 13px; margin-top: 14px; }
.subtle-button { border: 0; padding: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; }
.subtle-button:hover { text-decoration: underline; }

.inbox-toolbar, .inbox-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inbox-toolbar { justify-content: space-between; }
.inbox-tabs .button[aria-pressed="true"] { color: var(--blue); background: #eaf0ff; border-color: #cbd8fc; }
.inbox-item { padding: 24px; border-top: 1px solid var(--line); }
.inbox-item .inbox-source { margin: 0; border: 0; background: transparent; padding: 0; }
.inbox-source { border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); padding: 18px; margin-bottom: 22px; overflow-wrap: anywhere; }
.inbox-meta { display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap; }
.inbox-meta span { color: var(--muted); }
.inbox-source .detail-text { margin: 14px 0; white-space: pre-wrap; }
.inbox-item .card-actions { margin-top: 20px; }
.telegram-settings { display: grid; gap: 16px; font-size: 14px; }
.telegram-settings p, .telegram-settings h3, .telegram-settings ul { margin: 0; }
.telegram-settings hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.telegram-settings form { align-items: start; }
.text-link { color: var(--blue); text-decoration: underline; }
@media (max-width: 600px) { .inbox-item { padding: 16px; } .inbox-tabs { gap: 6px; } }
.task-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.task-row-actions .button { padding: 7px 10px; min-height: 34px; font-size: 12px; white-space: nowrap; }
.complete-task { color: var(--green); border-color: #b9ddce; background: #edf8f2; }
.complete-task:hover { border-color: var(--green); background: #ddf1e6; }
.reopen-task { white-space: nowrap; }

.quick-owners { display: flex; flex-wrap: wrap; gap: 7px; margin: 3px 0 2px; }
.quick-owner { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d7deeb; border-radius: 9px; background: #fff; padding: 8px 10px; color: var(--ink); font-size: 14px; line-height: 1.3; text-align: left; }
.quick-owner span { visibility: hidden; flex: 0 0 auto; }
.quick-owner:hover { border-color: #8fa8e7; background: #f4f7ff; }
.quick-owner[aria-pressed="true"] { color: #2144ab; border-color: #829ce3; background: #eaf0ff; font-weight: 650; }
.quick-owner[aria-pressed="true"] span { visibility: visible; }
.field-hint { color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 400; }
