:root {
    --ink: #253934;
    --ink-soft: #63746e;
    --teal-900: #254f49;
    --teal-700: #39736a;
    --teal-500: #5d978b;
    --teal-100: #dcebe5;
    --sand-50: #fbfaf6;
    --sand-100: #f4f0e6;
    --sand-200: #e9e0cf;
    --warm: #b67a4b;
    --red: #aa5e55;
    --blue: #52758a;
    --white: #fffefa;
    --line: #e4e5dc;
    --shadow: 0 14px 40px rgba(42, 67, 60, .08);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--sand-50);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--sand-50); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 2.2vw, 2.35rem); letter-spacing: -.045em; line-height: 1.05; }
h2 { margin-bottom: .45rem; font-size: 1.25rem; letter-spacing: -.025em; }
h3 { margin-bottom: .3rem; font-size: 1rem; }
p { color: var(--ink-soft); line-height: 1.55; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; background: #edf3ec; border-right: 1px solid #dbe4db; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px 14px 14px 5px; background: var(--teal-900); color: white; font-family: Georgia, serif; font-size: 1.35rem; box-shadow: 0 8px 18px rgba(37,79,73,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; }
.brand small { color: var(--teal-700); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 2px; }
.main-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 9px 12px; color: #526a63; border-radius: 12px; font-size: .91rem; font-weight: 650; transition: .16s ease; }
.nav-item:hover { background: rgba(255,255,255,.58); color: var(--ink); }
.nav-item.is-active { background: var(--white); color: var(--teal-900); box-shadow: 0 4px 15px rgba(39,74,66,.07); }
.nav-icon { display: grid; place-items: center; width: 21px; height: 21px; font-size: 1rem; color: var(--teal-700); }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #d8e2da; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-chip strong, .user-chip small { display: block; max-width: 125px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: .82rem; }
.user-chip small { color: var(--ink-soft); font-size: .72rem; text-transform: capitalize; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--sand-200); color: var(--teal-900); font-weight: 800; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: .78rem; }

.main-content { width: 100%; max-width: 1760px; min-width: 0; padding: 38px clamp(28px, 4vw, 70px) 80px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 30px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--teal-700); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.top-actions { display: flex; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 17px; border: 1px solid transparent; border-radius: 12px; font-weight: 750; font-size: .88rem; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--teal-900); color: white; box-shadow: 0 8px 20px rgba(37,79,73,.15); }
.button-primary:hover { background: #1e4540; }
.button-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.button-small { min-height: 32px; padding: 5px 10px; font-size: .75rem; border-radius: 9px; }
.button-wide { width: 100%; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--sand-100); color: var(--ink-soft); font-size: 1.35rem; cursor: pointer; }
.notice { margin: -12px 0 20px; padding: 12px 15px; border: 1px solid #bad8c7; border-radius: 12px; background: #edf8f0; color: #315e4a; font-size: .88rem; }
.notice.is-error { border-color: #e6bbb4; background: #fff1ef; color: #88483f; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: 18px; }
.card, .loading-card, .hero-card, .capture-panel, .page-tools, .focus-intro { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.loading-card { padding: 30px; color: var(--ink-soft); }
.hero-card { position: relative; overflow: hidden; grid-column: 1 / -1; padding: clamp(26px, 4vw, 48px); background: linear-gradient(125deg, #28554e, #3c756a); color: white; border: 0; }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; bottom: -130px; border-radius: 50%; border: 42px solid rgba(255,255,255,.07); }
.hero-card .eyebrow, .hero-card p { color: #cbe1da; }
.hero-title { max-width: 760px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 4rem); font-weight: 500; line-height: 1.02; letter-spacing: -.045em; }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-top: 30px; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.17); }
.progress-fill { height: 100%; border-radius: inherit; background: #e4c48f; }
.progress-number { min-width: 65px; font-size: 1.4rem; font-weight: 800; text-align: right; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 15px; color: #d9e8e3; font-size: .82rem; }
.card { padding: 22px; }
.card-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.card-head { margin-bottom: 16px; }
.card-head h2, .section-head h2 { margin: 0; }
.section-head { margin: 30px 0 15px; }
.count-badge { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; background: var(--teal-100); color: var(--teal-900); font-size: .78rem; font-weight: 800; }
.focus-list, .simple-list, .area-list, .milestone-list { display: grid; gap: 10px; }
.focus-task { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 13px; background: var(--sand-50); border: 1px solid var(--line); }
.focus-number { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: var(--teal-900); color: white; font-size: .8rem; font-weight: 800; }
.focus-task strong, .list-row strong { display: block; font-size: .9rem; }
.focus-task small, .list-row small { color: var(--ink-soft); }
.contribution { padding: 4px 8px; border-radius: 99px; background: var(--sand-100); color: var(--ink-soft); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.contribution-required { background: #dfeee7; color: #326455; }
.contribution-polish { background: #f3e8d8; color: #8b613d; }
.list-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.area-row { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.area-dot { width: 8px; height: 8px; border-radius: 50%; }
.area-row span:last-child { color: var(--ink-soft); font-size: .76rem; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { padding: 14px; border-radius: 13px; background: var(--sand-50); }
.metric strong { display: block; font-size: 1.55rem; }
.metric span { color: var(--ink-soft); font-size: .72rem; }
.blocker-card { border-color: #e9c8b9; background: #fffaf6; }
.warning-strip { padding: 13px; border-radius: 12px; background: #fff2e5; color: #835d3d; font-size: .83rem; }

.page-tools, .focus-intro { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 18px 20px; margin-bottom: 20px; box-shadow: none; }
.page-tools p, .focus-intro p { margin: 0; font-size: .9rem; }
.filter-row { display: flex; gap: 8px; }
input, textarea, select { width: 100%; border: 1px solid #d8ded8; border-radius: 11px; background: #fff; color: var(--ink); padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(93,151,139,.13); }
label { display: grid; gap: 7px; color: var(--ink); font-size: .8rem; font-weight: 750; }
textarea { resize: vertical; }

.kanban-board { display: grid; grid-template-columns: repeat(7, minmax(250px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 18px; scroll-snap-type: x proximity; scrollbar-gutter: stable; }
.kanban-scrollbar { position: fixed; z-index: 18; bottom: 10px; height: 18px; overflow-x: auto; overflow-y: hidden; border: 1px solid #cdd8d1; border-radius: 9px; background: rgba(237,243,236,.96); box-shadow: 0 5px 18px rgba(35,57,52,.15); }
.kanban-scrollbar[hidden] { display: none; }
.kanban-scrollbar > div { height: 1px; }
.kanban-column { min-height: 550px; padding: 13px; border-radius: 16px; background: #eef1eb; border: 1px solid #e0e4de; scroll-snap-align: start; }
.kanban-column[data-status="review"] { background: #f5eee3; border-color: #e7d7c1; }
.kanban-column.is-over { background: var(--teal-100); border-color: var(--teal-500); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 13px; }
.column-head h2 { font-size: .88rem; margin: 0; }
.column-count { min-width: 24px; padding: 4px 7px; border-radius: 99px; background: rgba(255,255,255,.75); text-align: center; font-size: .68rem; font-weight: 800; }
.column-limit { margin: -5px 3px 10px; color: var(--warm); font-size: .7rem; }
.kanban-cards { min-height: 480px; display: grid; align-content: start; gap: 9px; }
.task-card { position: relative; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 5px 16px rgba(45,69,62,.055); cursor: grab; }
.task-card:hover { border-color: #b9ccc4; box-shadow: 0 8px 20px rgba(45,69,62,.09); }
.task-card:focus-visible { outline: 3px solid rgba(93,151,139,.28); outline-offset: 2px; }
.task-card:active { cursor: grabbing; }
.task-card.is-dragging { opacity: .45; }
.task-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 4px 4px 0; background: var(--teal-500); }
.task-card.type-bug::before { background: var(--red); }
.task-card.type-technical::before { background: var(--blue); }
.task-card.type-polish::before { background: var(--warm); }
.task-card h3 { padding-left: 3px; line-height: 1.35; }
.task-summary { display: -webkit-box; margin: 4px 0 10px 3px; overflow: hidden; color: var(--ink-soft); font-size: .75rem; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.pill { padding: 4px 7px; border-radius: 8px; background: var(--sand-100); color: var(--ink-soft); font-size: .64rem; font-weight: 750; }
.pill-priority-high, .pill-priority-critical { background: #f5e5df; color: #965346; }
.focus-flag { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 8px; background: var(--teal-900); color: #fff; font-size: .66rem; font-weight: 800; }
.review-due-flag { display: inline-block; margin: 0 0 8px 3px; padding: 4px 7px; border-radius: 8px; background: #f4dfc4; color: #875b32; font-size: .62rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.review-date { display: inline-block; margin-left: 7px; color: #8b613d; font-size: .68rem; font-weight: 750; }

.capture-panel { display: grid; grid-template-columns: 1fr minmax(360px, .8fr); align-items: center; gap: 35px; padding: 28px; background: linear-gradient(120deg, #f2f7f1, #fffdf6); }
.capture-panel h2 { font-size: 1.5rem; }
.capture-panel p { margin-bottom: 0; }
.capture-form { display: flex; gap: 9px; }
.idea-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.idea-card { padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 6px 20px rgba(42,67,60,.05); }
.idea-card p { min-height: 42px; margin-bottom: 14px; font-size: .84rem; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; }

.bug-list { display: grid; gap: 12px; }
.bug-card { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.bug-ref { color: var(--teal-700); font-weight: 850; }
.bug-card p { margin: 5px 0 0; font-size: .82rem; }
.bug-meta { display: flex; gap: 7px; margin-top: 10px; }
.status-key { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: .78rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); }
.status-new { background: var(--warm); box-shadow: 0 0 0 4px #f7eadc; }
.severity-critical, .severity-high { color: var(--red); }

.milestone-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.milestone-card { padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; }
.milestone-card.is-active { border-color: #9dc3b6; box-shadow: 0 10px 28px rgba(44,104,91,.1); }
.milestone-state { display: inline-block; margin-bottom: 13px; color: var(--teal-700); font-size: .68rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.mini-progress { height: 7px; margin-top: 16px; overflow: hidden; border-radius: 99px; background: var(--sand-100); }
.mini-progress > span { display: block; height: 100%; background: var(--teal-500); border-radius: inherit; }
.parking-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.parking-card { padding: 18px; border: 1px dashed #cabda8; border-radius: 15px; background: #fffcf5; }
.empty-state { max-width: 580px; margin: 80px auto; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 16px; background: var(--teal-100); color: var(--teal-900); font-size: 1.5rem; }

.dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 20px; background: var(--white); color: var(--ink); box-shadow: 0 25px 80px rgba(25,50,44,.25); }
.dialog::backdrop { background: rgba(27,49,43,.45); backdrop-filter: blur(3px); }
.dialog form { display: grid; gap: 17px; padding: 25px; }
.dialog-small { width: min(500px, calc(100vw - 32px)); }
.dialog-wide { width: min(1120px, calc(100vw - 32px)); }
.dialog-shell { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); max-height: calc(100vh - 40px); overflow: auto; }
.dialog-shell > form { align-content: start; }
.task-journal { padding: 25px; background: #f5f7f2; border-left: 1px solid var(--line); }
.task-journal h3 { margin-bottom: 16px; }
.memo-list { display: grid; gap: 9px; max-height: 330px; overflow-y: auto; margin-bottom: 15px; padding-right: 4px; }
.memo-entry { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.memo-entry p { margin-bottom: 8px; color: var(--ink); font-size: .8rem; white-space: normal; }
.memo-entry small, .history-entry small { color: var(--ink-soft); font-size: .67rem; }
.task-journal .memo-form { gap: 10px; padding: 0; }
.empty-note { margin: 0; font-size: .78rem; }
.history-panel { margin-top: 20px; }
.history-list { display: grid; gap: 0; margin-top: 10px; }
.history-entry { display: grid; gap: 3px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .74rem; }
.dialog-actions-split { align-items: center; justify-content: space-between; }
.review-shortcuts { display: flex; gap: 7px; flex-wrap: wrap; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { font-size: 1.45rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog details { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.dialog summary { color: var(--ink-soft); cursor: pointer; font-size: .82rem; font-weight: 750; }
.dialog details[open] { display: grid; gap: 14px; }
.dialog details[open] summary { margin-bottom: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.optional, .form-hint { color: var(--ink-soft); font-weight: 400; }
.form-hint { margin: -5px 0 0; font-size: .76rem; }

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 25px; background: radial-gradient(circle at 10% 10%, #dcebe3 0, transparent 35%), radial-gradient(circle at 90% 90%, #efe2cb 0, transparent 36%), var(--sand-50); }
.login-card { width: min(450px, 100%); padding: 38px; background: rgba(255,254,250,.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 70px rgba(39,69,61,.13); }
.brand-login { padding: 0 0 38px; }
.login-card h1 { margin-bottom: 15px; font-family: Georgia, serif; font-size: 2.25rem; font-weight: 500; }
.login-form { display: grid; gap: 16px; margin-top: 26px; }
.form-error { margin: 16px 0; padding: 11px 13px; border-radius: 11px; background: #fff0ed; color: #8b4a42; font-size: .82rem; }

@media (max-width: 1050px) {
    .app-shell { grid-template-columns: 80px minmax(0, 1fr); }
    .sidebar { padding-inline: 12px; }
    .brand { padding-inline: 7px; }
    .brand > span:last-child, .nav-item > span:last-child, .sidebar-foot .user-chip > span:last-child, .text-button { display: none; }
    .nav-item { justify-content: center; }
    .sidebar-foot { padding-inline: 7px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid > * { grid-column: auto; }
    .capture-panel { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; z-index: 20; top: auto; bottom: 0; width: 100%; height: 66px; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); }
    .brand, .sidebar-foot { display: none; }
    .main-nav { display: flex; justify-content: space-around; }
    .nav-item { min-height: 48px; padding: 8px 11px; }
    .nav-item:nth-child(n+6) { display: none; }
    .main-content { padding: 24px 16px 95px; }
    .topbar { align-items: flex-start; }
    .top-actions .button-ghost { display: none; }
    .hero-card { padding: 25px; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .capture-form, .filter-row { flex-direction: column; }
    .bug-card { grid-template-columns: 1fr; gap: 8px; }
    .form-grid { grid-template-columns: 1fr; }
    .dialog-shell { grid-template-columns: 1fr; }
    .task-journal { border-top: 1px solid var(--line); border-left: 0; }
    .dialog-actions-split { align-items: stretch; flex-direction: column; }
    .dialog-actions-split > div { display: flex; justify-content: flex-end; gap: 7px; }
    .kanban-scrollbar { bottom: 74px; }
}
