:root {
    color-scheme: light;
    --bg: #eef2f5;
    --bg-soft: rgba(255, 255, 255, 0.72);
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --line: rgba(19, 35, 52, 0.12);
    --line-strong: rgba(19, 35, 52, 0.2);
    --text: #152535;
    --text-soft: #5c6c7d;
    --accent: #16374f;
    --accent-strong: #102738;
    --accent-soft: rgba(22, 55, 79, 0.08);
    --danger: #a33d33;
    --danger-soft: rgba(163, 61, 51, 0.08);
    --success: #1e6a50;
    --success-soft: rgba(30, 106, 80, 0.1);
    --warning: #8e5a18;
    --warning-soft: rgba(142, 90, 24, 0.12);
    --chart-done: #1e6a50;
    --chart-progress: #1f6a8a;
    --chart-blocked: #a33d33;
    --chart-todo: #8e5a18;
    --shadow: 0 18px 55px rgba(14, 26, 38, 0.08);
    --shadow-soft: 0 10px 30px rgba(14, 26, 38, 0.06);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    --font-display: Georgia, "Times New Roman", serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c141c;
    --bg-soft: rgba(16, 26, 36, 0.7);
    --panel: rgba(17, 28, 38, 0.9);
    --panel-strong: #13212d;
    --line: rgba(209, 220, 231, 0.12);
    --line-strong: rgba(209, 220, 231, 0.2);
    --text: #eef4fb;
    --text-soft: #9fb1c3;
    --accent: #d6e7f7;
    --accent-strong: #eef6ff;
    --accent-soft: rgba(214, 231, 247, 0.08);
    --danger: #ff8f82;
    --danger-soft: rgba(255, 143, 130, 0.12);
    --success: #79d6b1;
    --success-soft: rgba(121, 214, 177, 0.12);
    --warning: #f1b566;
    --warning-soft: rgba(241, 181, 102, 0.14);
    --chart-done: #79d6b1;
    --chart-progress: #78c2e7;
    --chart-blocked: #ff8f82;
    --chart-todo: #f1b566;
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(153, 176, 198, 0.22), transparent 36%),
        radial-gradient(circle at top right, rgba(209, 219, 228, 0.32), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.44), transparent 24%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.page-shell {
    width: min(1280px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.page-mode-auth .page-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(20px);
    background: rgba(238, 242, 245, 0.72);
    border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .topbar {
    background: rgba(12, 20, 28, 0.74);
}

.topbar__inner {
    width: min(1280px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 16px 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.brand__eyebrow,
.section-kicker {
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.brand__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    letter-spacing: 0.02em;
}

.topbar__nav {
    display: inline-flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.topbar__nav a {
    color: var(--text-soft);
}

.topbar__nav a:hover {
    color: var(--text);
}

.topbar__actions {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.user-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-soft);
}

.user-chip span {
    color: var(--text-soft);
    font-size: 0.86rem;
}

.theme-toggle,
.button {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 12px 18px;
    transition: 180ms ease;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.theme-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}

.theme-toggle:hover,
.button:hover {
    transform: translateY(-1px);
}

.theme-toggle--floating {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 30;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--panel-strong);
    color: var(--text);
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

.button--primary {
    background: var(--accent);
    color: #f8fbff;
    border-color: transparent;
}

html[data-theme="dark"] .button--primary {
    color: #08111a;
}

.button--ghost {
    background: transparent;
    box-shadow: none;
}

.button--danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
    box-shadow: none;
}

.button--full {
    width: 100%;
}

.button--tiny {
    padding: 10px 14px;
    font-size: 0.88rem;
}

.button--icon {
    width: 48px;
    height: 48px;
    padding: 0;
}

.button--icon-lg {
    width: 56px;
    height: 56px;
}

.button--icon[data-busy="true"] {
    opacity: 0.72;
}

.button__icon {
    width: 0.95rem;
    height: 0.95rem;
    display: block;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.button__icon--save {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h11l3 3v15H5V3zm2 2v5h8V5H7zm0 8v6h10v-6H7z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 3h11l3 3v15H5V3zm2 2v5h8V5H7zm0 8v6h10v-6H7z'/%3E%3C/svg%3E");
}

.button__icon--delete {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 7.1 16.9 5.7 12 10.6 7.1 5.7 5.7 7.1 10.6 12 5.7 16.9 7.1 18.3 12 13.4 16.9 18.3 18.3 16.9 13.4 12z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 7.1 16.9 5.7 12 10.6 7.1 5.7 5.7 7.1 10.6 12 5.7 16.9 7.1 18.3 12 13.4 16.9 18.3 18.3 16.9 13.4 12z'/%3E%3C/svg%3E");
}

.button__icon--refresh {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.75 10h-2.08A6 6 0 1 1 12 6c1.3 0 2.5.42 3.47 1.18L13 10h7V3z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.65 6.35A7.95 7.95 0 0 0 12 4a8 8 0 1 0 7.75 10h-2.08A6 6 0 1 1 12 6c1.3 0 2.5.42 3.47 1.18L13 10h7V3z'/%3E%3C/svg%3E");
}

.button__icon--back {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 11H7.83l4.58-4.59L11 5l-7 7 7 7 1.41-1.41L7.83 13H20z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 11H7.83l4.58-4.59L11 5l-7 7 7 7 1.41-1.41L7.83 13H20z'/%3E%3C/svg%3E");
}

.button__icon--settings {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m19.14 12.94.04-.94-.04-.94 2.03-1.58a.5.5 0 0 0 .12-.64l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.48 7.48 0 0 0-1.63-.94l-.36-2.54A.5.5 0 0 0 13.9 2h-3.8a.5.5 0 0 0-.49.42l-.36 2.54c-.58.22-1.13.53-1.63.94l-2.39-.96a.5.5 0 0 0-.6.22L2.71 8.48a.5.5 0 0 0 .12.64l2.03 1.58-.04.94.04.94-2.03 1.58a.5.5 0 0 0-.12.64l1.92 3.32a.5.5 0 0 0 .6.22l2.39-.96c.5.41 1.05.72 1.63.94l.36 2.54a.5.5 0 0 0 .49.42h3.8a.5.5 0 0 0 .49-.42l.36-2.54c.58-.22 1.13-.53 1.63-.94l2.39.96a.5.5 0 0 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.64l-2.03-1.58ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m19.14 12.94.04-.94-.04-.94 2.03-1.58a.5.5 0 0 0 .12-.64l-1.92-3.32a.5.5 0 0 0-.6-.22l-2.39.96a7.48 7.48 0 0 0-1.63-.94l-.36-2.54A.5.5 0 0 0 13.9 2h-3.8a.5.5 0 0 0-.49.42l-.36 2.54c-.58.22-1.13.53-1.63.94l-2.39-.96a.5.5 0 0 0-.6.22L2.71 8.48a.5.5 0 0 0 .12.64l2.03 1.58-.04.94.04.94-2.03 1.58a.5.5 0 0 0-.12.64l1.92 3.32a.5.5 0 0 0 .6.22l2.39-.96c.5.41 1.05.72 1.63.94l.36 2.54a.5.5 0 0 0 .49.42h3.8a.5.5 0 0 0 .49-.42l.36-2.54c.58-.22 1.13-.53 1.63-.94l2.39.96a.5.5 0 0 0 .6-.22l1.92-3.32a.5.5 0 0 0-.12-.64l-2.03-1.58ZM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5Z'/%3E%3C/svg%3E");
}

.button__icon--add {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 11H13V5h-2v6H5v2h6v6h2v-6h6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 11H13V5h-2v6H5v2h6v6h2v-6h6z'/%3E%3C/svg%3E");
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.flash--success {
    color: var(--success);
    background: var(--success-soft);
}

.flash--error {
    color: var(--danger);
    background: var(--danger-soft);
}

.auth-shell {
    width: min(620px, 100%);
}

.auth-panel {
    position: relative;
    padding: 52px 46px;
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .auth-panel {
    background: linear-gradient(180deg, rgba(19, 33, 45, 0.88), rgba(19, 33, 45, 0.96));
    border-color: rgba(214, 231, 247, 0.08);
}

.auth-panel__eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.auth-panel h1,
.hero h1,
.project-header h1,
.panel h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-panel h1 {
    font-size: clamp(3rem, 6vw, 4.3rem);
    line-height: 0.94;
    margin-bottom: 34px;
}

.auth-form,
.stack-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.field input,
.field select,
.field textarea,
.cell-input {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--panel-strong);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.cell-input:focus {
    outline: none;
    border-color: rgba(22, 55, 79, 0.36);
    box-shadow: 0 0 0 4px rgba(22, 55, 79, 0.08);
}

.checkbox {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--text);
}

.checkbox input {
    width: 18px;
    height: 18px;
}

.hero,
.project-header,
.panel,
.board-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

.hero,
.project-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 30px;
    margin-bottom: 22px;
}

.hero h1,
.project-header h1,
.panel h1,
.panel h2,
.board-card h2,
.empty-state h2,
.empty-state h3 {
    margin: 6px 0 0;
}

.hero p,
.project-header p,
.project-card p,
.panel p,
.empty-state p {
    margin: 12px 0 0;
    color: var(--text-soft);
    line-height: 1.65;
}

.hero__actions,
.project-toolbar {
    display: inline-flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.hero--dashboard {
    padding: 24px 28px;
    margin-bottom: 18px;
    align-items: end;
}

.hero--dashboard h1 {
    font-size: clamp(2.4rem, 4vw, 3.2rem);
}

.hero__actions--compact {
    align-items: stretch;
}

.project-grid,
.admin-grid {
    display: grid;
    gap: 22px;
}

.project-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-grid--admin-projects {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin-bottom: 22px;
}

.panel + .admin-grid {
    margin-top: 22px;
}

.admin-grid--projects {
    grid-template-columns: 1fr;
}

.project-card {
    display: grid;
    gap: 18px;
    padding: 26px;
    border-radius: var(--radius-lg);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.project-card__top {
    display: grid;
    gap: 8px;
}

.project-card__top h2 {
    margin: 0;
}

.project-card__meta,
.muted,
.sync-box small {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.project-card__footer,
.panel__header,
.list-item__header,
.list-group__header,
.category-section__header {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    display: grid;
    gap: 8px;
    padding: 20px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.metric-card__label {
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.metric-card strong {
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1;
    font-family: var(--font-display);
}

.metric-card small {
    color: var(--text-soft);
    line-height: 1.5;
}

.dashboard-insights {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 22px;
    margin-bottom: 22px;
}

.dashboard-panel {
    padding: 24px;
}

.dashboard-panel--projects {
    margin-top: 22px;
}

.dashboard-chart {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.dashboard-chart__donut {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--line);
}

.dashboard-chart__donut::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: var(--panel-strong);
    box-shadow: inset 0 0 0 1px var(--line);
}

.dashboard-chart__donut-center {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 2px;
    text-align: center;
}

.dashboard-chart__donut-center strong {
    font-size: 2.1rem;
    line-height: 1;
    font-family: var(--font-display);
}

.dashboard-chart__donut-center span {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.dashboard-legend {
    display: grid;
    gap: 10px;
}

.dashboard-legend__item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.dashboard-legend__item:last-child {
    border-bottom: 0;
}

.dashboard-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    flex-shrink: 0;
}

.dashboard-legend__text {
    display: grid;
    gap: 2px;
}

.dashboard-legend__text span {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.dashboard-focus-list {
    display: grid;
    gap: 14px;
}

.dashboard-focus-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.dashboard-focus-card__top,
.dashboard-focus-card__meta {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.dashboard-focus-card__top small,
.dashboard-focus-card__meta {
    color: var(--text-soft);
}

.dashboard-focus-card__top small {
    display: block;
    margin-top: 4px;
}

.dashboard-bar {
    display: flex;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-soft);
}

.dashboard-bar__segment {
    display: block;
    height: 100%;
}

.dashboard-bar__segment--done {
    background: var(--chart-done);
}

.dashboard-bar__segment--in_progress {
    background: var(--chart-progress);
}

.dashboard-bar__segment--blocked {
    background: var(--chart-blocked);
}

.dashboard-bar__segment--todo {
    background: var(--chart-todo);
}

.dashboard-table-shell {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.dashboard-table th {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    border-bottom: 1px solid var(--line);
}

.dashboard-table td {
    padding: 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

.dashboard-table tbody tr:hover {
    background: var(--accent-soft);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.status-pill--done {
    background: var(--success-soft);
    color: var(--success);
}

.status-pill--progress {
    background: rgba(31, 106, 138, 0.12);
    color: var(--chart-progress);
}

.status-pill--blocked {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pill--todo {
    background: var(--warning-soft);
    color: var(--warning);
}

.project-grid--dashboard {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.project-card--compact {
    gap: 14px;
    padding: 20px;
}

.project-card--compact .project-card__top {
    gap: 6px;
}

.project-card__footer--compact {
    align-items: center;
}

.panel {
    padding: 28px;
}

.list-stack {
    display: grid;
    gap: 14px;
}

.list-group,
.category-stack,
.category-section {
    display: grid;
    gap: 18px;
}

.list-item {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.project-card--admin-project {
    height: 100%;
}

.project-card--admin-project .project-card__top {
    gap: 14px;
}

.project-card--admin-project .project-card__top h3 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
    font-family: var(--font-display);
}

.project-card--admin-project .project-card__footer {
    margin-top: auto;
    justify-content: flex-start;
}

.list-item--form {
    display: grid;
    gap: 16px;
}

.list-item__form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.list-item__actions,
.badge-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 0.82rem;
}

.badge--success {
    background: var(--success-soft);
    color: var(--success);
}

.badge--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge--dark {
    background: var(--accent);
    color: #f5f9fc;
}

html[data-theme="dark"] .badge--dark {
    color: #08111a;
}

.sync-box {
    display: grid;
    gap: 6px;
    min-width: 220px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--panel-strong);
}

.sync-box__label {
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-soft);
}

[data-sync-status][data-tone="success"] {
    color: var(--success);
}

[data-sync-status][data-tone="warning"] {
    color: var(--warning);
}

[data-sync-status][data-tone="error"] {
    color: var(--danger);
}

.board-card {
    padding: 24px;
}

.notes-panel {
    margin-bottom: 22px;
}

.notes-panel__input {
    width: 100%;
    min-height: 240px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-strong);
    color: var(--text);
    resize: vertical;
    line-height: 1.65;
}

.notes-panel__input[data-state="saving"] {
    border-color: rgba(142, 90, 24, 0.45);
    background: var(--warning-soft);
}

.notes-panel__input[data-state="dirty"] {
    border-color: rgba(22, 55, 79, 0.36);
    background: var(--accent-soft);
}

.notes-panel__input[data-state="saved"] {
    border-color: rgba(30, 106, 80, 0.3);
}

.notes-panel__input[data-state="error"] {
    border-color: rgba(163, 61, 51, 0.42);
    background: var(--danger-soft);
}

.board-card__header {
    margin-bottom: 18px;
}

.category-section {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.38);
}

html[data-theme="dark"] .category-section {
    background: rgba(18, 29, 39, 0.52);
}

.category-section__header h3 {
    margin: 6px 0 0;
}

.board-card__footer {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.table-shell {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel-strong);
}

.project-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 840px;
}

.project-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--panel-strong);
    border-bottom: 1px solid var(--line);
}

.project-table th,
.project-table td {
    padding: 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.project-table tr:last-child td {
    border-bottom: 0;
}

.project-table__index,
.row-index {
    width: 56px;
    text-align: center;
    color: var(--text-soft);
}

.project-table__actions,
.row-actions {
    width: 88px;
    text-align: center;
}

.row-actions__group {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.column-head {
    display: grid;
    gap: 4px;
}

.column-head small {
    color: var(--text-soft);
    letter-spacing: 0.12em;
}

.cell-input {
    min-width: 180px;
    padding: 12px 14px;
}

.cell-input--textarea {
    min-height: 86px;
    resize: vertical;
}

.cell-input[data-state="saving"] {
    border-color: rgba(142, 90, 24, 0.45);
    background: var(--warning-soft);
}

.cell-input[data-state="dirty"] {
    border-color: rgba(22, 55, 79, 0.36);
    background: var(--accent-soft);
}

.cell-input[data-state="saved"] {
    border-color: rgba(30, 106, 80, 0.3);
}

.cell-input[data-state="error"] {
    border-color: rgba(163, 61, 51, 0.42);
    background: var(--danger-soft);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 42px 28px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
}

.empty-state--compact {
    padding: 30px 20px;
    border: 0;
    background: transparent;
}

.empty-row td {
    padding: 0;
}

@media (max-width: 900px) {
    .topbar__inner,
    .hero,
    .project-header {
        grid-template-columns: 1fr;
    }

    .topbar__actions,
    .project-toolbar {
        justify-content: flex-start;
    }

    .page-shell {
        width: min(100vw - 24px, 1280px);
    }

    .auth-panel {
        padding: 36px 24px;
    }

    .auth-panel h1 {
        font-size: clamp(2.5rem, 14vw, 3.4rem);
    }

    .dashboard-insights {
        grid-template-columns: 1fr;
    }

    .project-grid--admin-projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-chart {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .theme-toggle--floating {
        top: 12px;
        right: 12px;
    }

    .panel,
    .board-card,
    .hero,
    .project-header,
    .project-card {
        padding: 22px;
    }

    .list-item__form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-panel {
        padding: 20px;
    }

    .dashboard-metrics,
    .dashboard-insights,
    .project-grid--admin-projects {
        grid-template-columns: 1fr;
    }

    .dashboard-chart__donut {
        width: 160px;
        height: 160px;
    }
}
