:root {
    --bg: #eef2ef;
    --bg-deep: #e4ebe6;
    --surface: #fbfcfb;
    --surface-2: #f3f6f4;
    --ink: #14201d;
    --muted: #66736e;
    --line: #d5ddd8;
    --line-soft: #e4ebe6;
    --primary: #0f766e;
    --primary-2: #0b5f59;
    --primary-soft: #d8f0ec;
    --accent: #c45c26;
    --accent-soft: #f8e7dc;
    --nav: #0f1c1a;
    --nav-2: #17302c;
    --green: #1f8f6a;
    --orange: #c7791a;
    --red: #c24646;
    --blue: #2f6f9f;
    --radius: 18px;
    --shadow: 0 18px 50px rgba(20, 32, 29, .08);
    --font-display: "Outfit", "Segoe UI", sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--muted); font-weight: 600; font-size: .72em; }

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(15, 118, 110, .16), transparent 60%),
        radial-gradient(700px 380px at 92% 8%, rgba(196, 92, 38, .10), transparent 55%),
        linear-gradient(180deg, #f5f8f6 0%, var(--bg) 42%, var(--bg-deep) 100%);
}
.page-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .35;
    background-image: radial-gradient(rgba(20, 32, 29, .08) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px 18px;
    color: #a7b8b3;
    background:
        linear-gradient(165deg, rgba(23, 48, 44, .55), transparent 40%),
        var(--nav);
    border-right: 1px solid rgba(255,255,255,.04);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 6px 28px;
    color: #fff;
}
.logo strong {
    display: block;
    font: 700 18px/1.1 var(--font-display);
    letter-spacing: -.02em;
}
.logo small {
    display: block;
    margin-top: 3px;
    color: #7f918b;
    font-size: 12px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #14958a, #0b5f59);
    font: 800 13px/1 var(--font-display);
    box-shadow: 0 10px 24px rgba(15, 118, 110, .35);
}
.nav-label {
    margin: 0 14px 8px;
    color: #6f817b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    transition: background .2s, color .2s, transform .2s;
}
.sidebar nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(20,149,138,.28), rgba(20,149,138,.08));
}
.sidebar nav a .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4d5f5a;
}
.sidebar nav a.active .dot { background: #3dd6c6; box-shadow: 0 0 0 4px rgba(61,214,198,.15); }
.sidebar-card {
    margin: 18px 6px 0;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    background: rgba(255,255,255,.04);
}
.sidebar-card p { margin: 0; font-size: 12px; color: #8aa09a; }
.sidebar-card strong {
    display: block;
    margin: 6px 0 4px;
    color: #fff;
    font: 800 28px/1 var(--font-display);
}
.sidebar-card small { color: #6f817b; font-size: 12px; }
.sidebar-foot {
    margin-top: auto;
    padding: 18px 10px 4px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-foot p { margin: 10px 0 0; font-size: 12px; color: #6f817b; }
.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}
.progress-label strong { color: #fff; }
.progress {
    overflow: hidden;
    height: 7px;
    border-radius: 99px;
    background: #243832;
}
.progress.light { background: #e5ece8; }
.progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
    animation: fillBar .8s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes fillBar { to { width: var(--w); } }

.app {
    min-height: 100vh;
    margin-left: 260px;
    padding: 34px clamp(18px, 3vw, 42px) 70px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 28px;
    animation: rise .55s ease both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.eyebrow {
    margin: 0 0 6px;
    color: #7a8882;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.topbar h1, .section-head h2, .modal-head h2, .release-card h3, .empty-panel strong {
    font-family: var(--font-display);
    letter-spacing: -.03em;
}
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 750; }
.lede { margin: 8px 0 0; max-width: 46ch; color: var(--muted); }
.header-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    transition: transform .18s, background .18s, border-color .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #14958a, var(--primary));
    box-shadow: 0 10px 24px rgba(15, 118, 110, .22);
}
.btn-primary:hover { background: linear-gradient(180deg, #0f766e, var(--primary-2)); }
.btn-ghost, .btn-secondary {
    color: #31423d;
    border-color: var(--line);
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(8px);
}
.btn-mini {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--primary);
    border-color: #b7d8d2;
    background: #eef8f6;
    font-size: 12px;
}
.btn-block { width: 100%; }
.link-btn {
    border: 0;
    padding: 0;
    color: var(--primary);
    background: none;
    font-weight: 700;
}
.mobile-menu {
    display: none;
    width: 42px;
    height: 42px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.8);
}
.mobile-menu span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    border-radius: 99px;
    background: var(--ink);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px 18px 16px;
    border: 1px solid rgba(213,221,216,.9);
    border-radius: var(--radius);
    background: rgba(251,252,251,.88);
    box-shadow: 0 10px 30px rgba(20,32,29,.04);
    animation: rise .6s ease both;
}
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .1s; }
.stat-card:nth-child(4) { animation-delay: .15s; }
.stat-card::after {
    content: "";
    position: absolute;
    right: -20px;
    bottom: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15,118,110,.12), transparent 70%);
}
.stat-card.accent::after { background: radial-gradient(circle, rgba(196,92,38,.16), transparent 70%); }
.stat-card.warn::after { background: radial-gradient(circle, rgba(194,70,70,.14), transparent 70%); }
.stat-kicker {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.stat-card strong {
    display: block;
    font: 800 34px/1 var(--font-display);
    letter-spacing: -.04em;
}
.stat-card p { margin: 8px 0 0; color: #7d8a85; font-size: 13px; }

.section { margin-top: 34px; scroll-margin-top: 24px; animation: rise .65s ease both; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 22px; }
.board-note {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    color: #6d5848;
    background: linear-gradient(90deg, var(--accent-soft), transparent);
    font-size: 13.5px;
}

.release-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.release-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(251,252,251,.92);
    box-shadow: 0 12px 32px rgba(20,32,29,.04);
    transition: transform .2s, box-shadow .2s;
}
.release-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(20,32,29,.08);
}
.release-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #9aaba4;
}
.release-card.active::before { background: var(--primary); }
.release-card.released::before { background: var(--green); }
.release-top, .release-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.version {
    color: var(--primary);
    font: 800 13px/1 var(--font-display);
}
.release-status, .chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}
.release-status { color: #66736e; background: #eef2ef; }
.release-status.active { color: #0b5f59; background: var(--primary-soft); }
.release-status.released { color: #176b4f; background: #dff3ea; }
.release-card h3 { margin: 16px 0 8px; font-size: 17px; }
.release-card > p {
    flex: 1;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
}
.release-progress { margin-bottom: 16px; }
.release-progress > div:first-child {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}
.release-bottom {
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 12px;
}
.card-menu { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-menu form, .task-actions form, .check-form { margin: 0; }
.card-menu select {
    max-width: 108px;
    padding: 5px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 11px;
}

.filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(120px, .8fr)) auto auto;
    gap: 8px;
    margin-bottom: 14px;
}
.search, .filters select, .field input, .field select, .field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.9);
    outline: none;
}
.search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: #7d8a85;
}
.search input { border: 0; background: transparent; padding: 11px 0; }
.filters select { padding: 10px 12px; }
.clear-filter {
    align-self: center;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
}

.task-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(251,252,251,.95);
    box-shadow: 0 12px 32px rgba(20,32,29,.04);
}
.task-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
    transition: background .15s;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #f6f9f7; }
.task-row.is-overdue { background: linear-gradient(90deg, rgba(194,70,70,.05), transparent 40%); }
.task-check {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1.5px solid #b7c2bd;
    border-radius: 7px;
    color: transparent;
    background: #fff;
    transition: .15s;
}
.task-check:hover { border-color: var(--primary); color: var(--primary); }
.is-done .task-check {
    color: #fff;
    border-color: var(--green);
    background: var(--green);
}
.task-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-title-line h3 {
    margin: 0;
    font: 700 15px/1.3 var(--font-body);
}
.is-done .task-title-line h3 {
    color: #8a9691;
    text-decoration: line-through;
}
.task-desc { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.task-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.chip.soft { color: #4d5c56; background: #eef2ef; }
.chip.general-chip { color: #8a4a22; background: var(--accent-soft); }
.chip.release-chip { color: #0b5f59; background: var(--primary-soft); }
.chip.priority.low { color: #2f6f9f; background: #e7f1f8; }
.chip.priority.medium { color: #8a6418; background: #f8efd8; }
.chip.priority.high { color: #a84f25; background: #f8e7dc; }
.chip.priority.urgent { color: #a13333; background: #f8e1e1; }
.due { color: #7d8a85; font-size: 12px; }
.due.overdue { color: var(--red); font-weight: 700; }
.task-actions { display: flex; align-items: center; gap: 6px; }
.status-select {
    min-width: 118px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}
.status-select.todo { color: #55635e; background: #eef2ef; }
.status-select.progress { color: #1f5f88; background: #e7f1f8; }
.status-select.review { color: #8a6418; background: #f8efd8; }
.status-select.done { color: #176b4f; background: #dff3ea; }
.icon-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: #66736e;
    background: #fff;
    transition: .15s;
}
.icon-btn:hover { color: var(--primary); border-color: #b7d8d2; background: #eef8f6; }
.icon-btn.danger:hover { color: var(--red); border-color: #efc4c4; background: #fff5f5; }

.empty-panel {
    grid-column: 1 / -1;
    padding: 42px 24px;
    border: 1px dashed #c7d2cc;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255,255,255,.55);
}
.empty-panel.compact {
    border: 0;
    border-radius: 0;
    background: transparent;
}
.empty-panel strong { display: block; margin-bottom: 6px; font-size: 16px; }
.empty-panel p { margin: 0; color: var(--muted); }

.modal {
    width: min(640px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: var(--shadow);
}
.modal::backdrop {
    background: rgba(15, 28, 26, .55);
    backdrop-filter: blur(4px);
}
.modal-card {
    padding: 24px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 20px;
    background:
        radial-gradient(500px 180px at 100% 0%, rgba(15,118,110,.08), transparent 55%),
        #fbfcfb;
}
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 18px;
}
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-head > button {
    border: 0;
    color: #8a9691;
    background: transparent;
    font-size: 26px;
    line-height: 1;
}
.type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.type-switch label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
}
.type-switch input { accent-color: var(--primary); }
.type-switch label:has(input:checked) {
    border-color: #8fc6bf;
    background: var(--primary-soft);
    color: var(--primary-2);
}
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field span { color: #4d5c56; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { padding: 11px 12px; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: #8fc6bf;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}
.field textarea { resize: vertical; min-height: 84px; }
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}
#release-field.is-hidden { display: none; }

.toast {
    position: fixed;
    z-index: 80;
    top: 22px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 380px;
    padding: 13px 15px;
    border: 1px solid #b7dfd1;
    border-radius: 12px;
    color: #176b4f;
    background: #effaf5;
    box-shadow: var(--shadow);
    font-weight: 600;
    animation: rise .35s ease both;
}
.toast.error { color: #a13333; border-color: #efc4c4; background: #fff5f5; }
.toast button { border: 0; color: currentColor; background: none; font-size: 20px; }

.setup-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(700px 280px at 20% 0%, rgba(15,118,110,.14), transparent 60%),
        var(--bg);
}
.setup-card {
    width: min(460px, 100%);
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(251,252,251,.95);
    box-shadow: var(--shadow);
}
.setup-card .brand-mark { margin-bottom: 22px; }
.setup-card h1 {
    margin: 0 0 8px;
    font: 750 28px/1.1 var(--font-display);
}
.muted { color: var(--muted); }
.connection-box {
    display: grid;
    gap: 8px;
    margin: 22px 0;
    padding: 14px;
    border-radius: 12px;
    background: var(--surface-2);
    font-size: 13px;
}
.connection-box span { display: flex; justify-content: space-between; gap: 12px; }
.alert {
    margin: 16px 0;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.alert.success { color: #176b4f; background: #effaf5; }
.alert.error { color: #a13333; background: #fff5f5; }
.setup-hint { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 1100px) {
    .stats-grid, .release-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1fr 1fr 1fr; }
    .search { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 18px 0 40px rgba(0,0,0,.2);
    }
    .sidebar.open { transform: none; }
    .app { margin-left: 0; padding-top: 22px; }
    .mobile-menu { display: inline-flex; }
    .topbar { flex-wrap: wrap; }
    .topbar-copy { flex: 1; min-width: 200px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .release-grid { grid-template-columns: 1fr; }
    .filters { grid-template-columns: 1fr 1fr; }
    .task-row { grid-template-columns: 28px minmax(0, 1fr); }
    .task-actions { grid-column: 2; justify-content: flex-start; }
    .field-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr; }
    .header-actions { width: 100%; }
    .header-actions .btn { flex: 1; }
    .filters { grid-template-columns: 1fr; }
    .type-switch { grid-template-columns: 1fr; }
}
