:root {
    color-scheme: light;
    --ink: #20211f;
    --muted: #69645c;
    --line: #d7d0c3;
    --paper: #f6efe4;
    --paper-deep: #ece2d2;
    --surface: #fffdf8;
    --surface-warm: #fbf6ee;
    --accent: #0b6d68;
    --accent-dark: #064849;
    --accent-soft: rgba(11, 109, 104, 0.13);
    --ai-blue: #1f91bd;
    --ai-blue-dark: #146b91;
    --ai-soft: #e8f6fb;
    --sage: #dfeae4;
    --sage-strong: #bfd2c8;
    --ocher: #a8661b;
    --ocher-soft: #f3e2bd;
    --rust: #9b3f24;
    --rust-soft: #f2ded5;
    --shadow: 0 18px 44px rgba(39, 34, 27, 0.11), 0 2px 8px rgba(39, 34, 27, 0.05);
    --shadow-soft: 0 10px 24px rgba(39, 34, 27, 0.07);
    --shadow-hover: 0 22px 54px rgba(39, 34, 27, 0.15), 0 4px 12px rgba(39, 34, 27, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    background-image:
        repeating-linear-gradient(0deg, rgba(94, 78, 55, 0.025) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.24) 0 1px, transparent 1px 9px),
        linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button,
input {
    font: inherit;
}

select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(220px, 280px) 1fr;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 28px 20px;
    border-right: 1px solid rgba(93, 78, 55, 0.2);
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.38), rgba(236, 226, 210, 0.52)),
        #efe7da;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.mobile-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid rgba(12, 75, 77, 0.18);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.mobile-nav-toggle:hover {
    border-color: rgba(20, 107, 145, 0.34);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.mobile-nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent-dark);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 8px 18px rgba(6, 72, 73, 0.16);
    overflow: hidden;
}

.brand-mark img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.brand strong {
    display: block;
    font-size: 1rem;
}

.brand small,
.nav-label,
.eyebrow,
.panel-kicker {
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand .brand-version {
    margin-top: 4px;
    letter-spacing: 0;
    text-transform: none;
}

.nav-list {
    display: grid;
    gap: 6px;
}

.nav-label {
    margin-top: 16px;
}

.nav-list a,
.logout-form button {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-list a:hover,
.logout-form button:hover,
.nav-list a.active {
    color: var(--accent-dark);
    background: rgba(11, 109, 104, 0.13);
    box-shadow: inset 3px 0 0 rgba(11, 109, 104, 0.32);
}

.logout-form {
    margin-top: auto;
}

.logout-form button {
    cursor: pointer;
}

.main-panel {
    padding: clamp(28px, 5vw, 64px);
}

.page-header {
    max-width: 760px;
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 6px 0 12px;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 0.95;
}

.compact-header h1 {
    font-size: clamp(2rem, 4vw, 3.8rem);
}

.lede {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.6;
}

.line-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    width: min(100%, 1080px);
    margin-bottom: 18px;
}

.stat-strip div,
.board-column,
.board-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
    box-shadow: var(--shadow);
}

.stat-strip div {
    padding: 16px;
}

.stat-strip span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 1.8rem;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: 14px;
    width: min(100%, 1320px);
}

.board-column {
    min-width: 0;
    padding: 14px;
    box-shadow: none;
}

.board-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.board-column-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.board-column-header span {
    border-radius: 999px;
    padding: 3px 8px;
    color: var(--accent-dark);
    background: var(--sage);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 1px 2px rgba(39, 34, 27, 0.08);
    font-weight: 800;
}

.board-card-list {
    display: grid;
    gap: 10px;
}

.board-card {
    padding: 14px;
    box-shadow: var(--shadow-soft);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.board-card:hover {
    border-color: rgba(11, 109, 104, 0.28);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.board-card-alert {
    border-color: rgba(155, 63, 36, 0.42);
    background: linear-gradient(180deg, #fffaf6 0%, var(--rust-soft) 100%);
}

.board-card h3 {
    margin: 8px 0;
    font-size: 1.08rem;
}

.board-card h3 a {
    text-decoration: none;
}

.board-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.next-step {
    display: grid;
    gap: 4px;
    margin-top: 12px;
}

.next-step span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.next-step strong {
    line-height: 1.4;
}

.status-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-top: 12px;
}

.panel,
.empty-state,
.login-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
    box-shadow: var(--shadow);
}

.panel {
    min-height: 220px;
    padding: 22px;
}

.panel h2 {
    margin: 10px 0 12px;
    font-size: 1.4rem;
}

.panel p,
.empty-state p {
    color: var(--muted);
    line-height: 1.6;
}

.panel a {
    display: inline-flex;
    margin-top: 12px;
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.panel a:hover,
.dashboard-row-title:hover,
.dashboard-link:hover,
.link-list a:hover,
.data-care-link-list a:hover,
.data-care-actions a:hover,
.danger-link:hover {
    color: var(--ai-blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(100%, 1280px);
}

.dashboard-block {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
    box-shadow: var(--shadow);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-block:hover {
    border-color: rgba(11, 109, 104, 0.24);
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.dashboard-block-primary {
    border-color: rgba(11, 109, 104, 0.24);
    background: linear-gradient(180deg, #fffdf8 0%, #edf5f1 100%);
}

.dashboard-block-ready {
    border-color: rgba(168, 102, 27, 0.32);
    background: linear-gradient(180deg, #fffdf8 0%, #fbf0d8 100%);
}

.dashboard-block-attention {
    border-color: rgba(155, 63, 36, 0.26);
    background: linear-gradient(180deg, #fffdf8 0%, #f7e9e2 100%);
}

.dashboard-block-ai {
    border-color: rgba(31, 145, 189, 0.28);
    background: linear-gradient(180deg, #fffdf8 0%, var(--ai-soft) 100%);
}

.dashboard-block-wide {
    grid-column: 1 / -1;
}

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

.dashboard-block-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.dashboard-block-header h2 {
    margin: 6px 0 0;
    font-size: 1.15rem;
}

.dashboard-count {
    display: grid;
    min-width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    color: var(--accent-dark);
    background: linear-gradient(180deg, #eef6f2 0%, var(--sage) 100%);
    font-size: 1.1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(39, 34, 27, 0.08);
}

.dashboard-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-list li {
    border-top: 1px solid var(--line);
    padding: 12px 0;
}

.dashboard-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.dashboard-list li:last-child {
    padding-bottom: 0;
}

.dashboard-list-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
}

.dashboard-list-columns li:nth-child(2) {
    border-top: 0;
    padding-top: 0;
}

.dashboard-row-title,
.dashboard-link {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.dashboard-row-title {
    overflow-wrap: anywhere;
}

.dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.date-meta {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.dashboard-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-link {
    display: inline-flex;
    margin-top: 16px;
}

.data-care-link-list {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding-left: 18px;
}

.data-care-link-list a {
    color: var(--accent-dark);
    font-weight: 700;
}

.data-care-link-list small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
}

.data-care-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.data-care-actions a,
.danger-link {
    color: var(--accent-dark);
    font-weight: 800;
}

.danger-link {
    color: var(--rust);
}

.empty-state {
    max-width: 760px;
    padding: 28px;
}

.flash-message {
    width: min(100%, 1280px);
    margin-bottom: 20px;
    border: 1px solid rgba(0, 111, 114, 0.28);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--accent-dark);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(223, 234, 228, 0.7));
    font-weight: 700;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    min-width: 0;
}

.primary-action,
.danger-action,
.form-actions a,
.form-actions button,
.filter-bar button,
.bulk-action-bar button,
.status-form button,
.stacked-action button,
.secondary-button,
.row-primary-action,
.row-action,
.attach-form button,
.login-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 11px 14px;
    color: #fff;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 10px rgba(6, 72, 73, 0.16);
    cursor: pointer;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-action:hover,
.form-actions a:hover,
.form-actions button:hover,
.filter-bar button:hover,
.bulk-action-bar button:hover,
.status-form button:hover,
.stacked-action button:hover,
.row-primary-action:hover,
.attach-form button:hover,
.login-form button:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.primary-action:disabled,
.form-actions button:disabled,
.filter-bar button:disabled,
.bulk-action-bar button:disabled,
.status-form button:disabled,
.stacked-action button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.danger-action,
.danger-button {
    background: linear-gradient(180deg, #aa4a2b 0%, var(--rust) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 10px rgba(155, 63, 36, 0.18);
}

.danger-action:hover,
.danger-button:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.secondary-button {
    color: var(--accent-dark);
    background: linear-gradient(180deg, #eef6f2 0%, var(--sage) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 2px 6px rgba(39, 34, 27, 0.08);
}

.secondary-button:hover,
.row-action:hover,
.form-actions a:hover {
    color: var(--accent-dark);
    background: linear-gradient(180deg, #f5faf7 0%, #d7e6df 100%);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transform: translateY(-1px);
}

.ai-action {
    color: #fff;
    background: linear-gradient(180deg, var(--ai-blue) 0%, var(--ai-blue-dark) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 10px rgba(20, 107, 145, 0.18);
}

.ai-action:hover {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.filter-bar,
.editor-panel,
.detail-panel,
.item-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-warm) 100%);
    box-shadow: var(--shadow);
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
    gap: 12px;
    align-items: end;
    width: min(100%, 960px);
    margin-bottom: 18px;
    padding: 16px;
}

.filter-bar:hover,
.editor-panel:hover,
.detail-panel:hover,
.item-row:hover {
    box-shadow: var(--shadow-hover);
}

.filter-bar-wide {
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) minmax(130px, 170px) auto;
}

.filter-bar-many {
    grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(130px, 170px)) auto;
    width: min(100%, 1320px);
}

.bulk-action-form {
    width: min(100%, 960px);
}

.bulk-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bulk-action-bar p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.filter-bar label,
.field {
    display: grid;
    gap: 7px;
}

.filter-bar span,
.field span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.filter-bar input,
.filter-bar select,
.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink);
    box-shadow: inset 0 1px 2px rgba(39, 34, 27, 0.04);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.filter-bar input:focus,
.filter-bar select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(31, 145, 189, 0.58);
    box-shadow: 0 0 0 3px rgba(31, 145, 189, 0.12), inset 0 1px 2px rgba(39, 34, 27, 0.04);
}

.autocomplete-field {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(11, 109, 104, 0.2);
    border-radius: 8px;
    padding: 6px;
    background: var(--surface);
    box-shadow: var(--shadow-hover);
    transform: translateY(calc(100% + 6px));
}

.autocomplete-menu[hidden] {
    display: none;
}

.autocomplete-menu button {
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.autocomplete-menu button:hover,
.autocomplete-menu button[aria-selected="true"] {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.editor-panel {
    width: min(100%, 960px);
    padding: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-spaced {
    margin-top: 22px;
}

.field-span {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
}

.form-actions a,
.row-action {
    color: var(--accent-dark);
    background: linear-gradient(180deg, #f5faf7 0%, var(--sage) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 2px 5px rgba(39, 34, 27, 0.06);
    font-weight: 800;
    text-decoration: none;
}

.row-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
    max-width: min(100%, 980px);
}

.compact-actions {
    gap: 8px;
}

.compact-actions .primary-action,
.compact-actions .danger-action,
.compact-actions button {
    padding: 8px 10px;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: normal;
}

.delete-confirm-panel {
    width: min(100%, 760px);
}

.delete-confirm-panel p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.6;
}

.trash-list {
    display: grid;
    gap: 16px;
    width: min(100%, 1080px);
}

.trash-group h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.trash-items {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.trash-items li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.trash-items small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.item-list {
    display: grid;
    gap: 12px;
    width: min(100%, 960px);
}

.search-summary {
    margin: 0 0 14px;
    color: var(--muted);
    font-weight: 800;
}

.search-results {
    width: min(100%, 1080px);
}

.item-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.item-row:hover {
    border-color: rgba(11, 109, 104, 0.22);
    transform: translateY(-1px);
}

.selectable-row {
    align-items: flex-start;
}

.selection-cell {
    display: flex;
    flex: 0 0 auto;
    padding-top: 8px;
}

.selection-cell input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-dark);
}

.item-row-content {
    flex: 1 1 auto;
    min-width: 0;
}

.item-row h2 {
    margin: 8px 0;
    font-size: 1.25rem;
}

.item-row h2 a {
    text-decoration: none;
}

.item-row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.88rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(11, 109, 104, 0.12);
    padding: 4px 9px;
    color: var(--accent-dark);
    background: linear-gradient(180deg, #eef6f2 0%, var(--sage) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 1px 3px rgba(39, 34, 27, 0.08);
    font-weight: 800;
}

.status-primary {
    color: var(--accent-dark);
    border-color: rgba(11, 109, 104, 0.22);
    background: linear-gradient(180deg, #edf7f3 0%, #d4e8df 100%);
}

.status-ai {
    color: var(--ai-blue-dark);
    border-color: rgba(31, 145, 189, 0.24);
    background: linear-gradient(180deg, #f3fbfd 0%, var(--ai-soft) 100%);
}

.status-ready {
    color: #6c4111;
    border-color: rgba(168, 102, 27, 0.24);
    background: linear-gradient(180deg, #fff8ea 0%, var(--ocher-soft) 100%);
}

.status-attention {
    color: #77311d;
    border-color: rgba(155, 63, 36, 0.22);
    background: linear-gradient(180deg, #fff8f4 0%, var(--rust-soft) 100%);
}

.status-muted {
    color: #5f5b53;
    border-color: rgba(105, 100, 92, 0.18);
    background: linear-gradient(180deg, #faf8f3 0%, #e8e1d5 100%);
}

.aside-status {
    display: inline-flex;
    margin-bottom: 14px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag-list a {
    border-radius: 999px;
    border: 1px solid rgba(11, 109, 104, 0.1);
    padding: 3px 8px;
    color: var(--accent-dark);
    background: linear-gradient(180deg, #f2f8f5 0%, var(--sage) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.tag-list a:hover {
    color: var(--ai-blue-dark);
    border-color: rgba(31, 145, 189, 0.22);
    background: linear-gradient(180deg, #f6fcff 0%, var(--ai-soft) 100%);
    text-decoration: none;
}

.compact-tags {
    margin-top: 0;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: min(100%, 1080px);
}

.archive-panel h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.pagination-wrap {
    width: min(100%, 960px);
    margin-top: 16px;
}

.pagination-wrap nav > div:first-child {
    display: none;
}

.pagination-wrap nav > div:last-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    gap: 16px;
    width: min(100%, 1080px);
}

.detail-panel {
    padding: 22px;
}

.detail-main h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.detail-main h2:not(:first-child) {
    margin-top: 24px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0 0 12px;
}

.row-actions .inline-form {
    margin: 0;
}

.detail-main p {
    color: var(--muted);
    line-height: 1.65;
}

.pre-line {
    white-space: pre-line;
}

.note-block {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    line-height: 1.6;
    white-space: pre-wrap;
}

.writing-editor-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    width: min(100%, 1240px);
}

.writing-editor-panel {
    width: 100%;
}

.draft-editor {
    min-height: 560px;
    resize: vertical;
    font-size: 1rem;
    line-height: 1.65;
}

.draft-body {
    font-size: 1rem;
}

.draft-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 24px;
}

.data-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.data-list div {
    display: grid;
    gap: 4px;
}

.data-list dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.data-list dd {
    margin: 0;
}

.retrospective-list dd {
    color: var(--muted);
    line-height: 1.5;
    white-space: pre-line;
}

.stacked-action {
    margin-top: 22px;
}

.evaluation-summary,
.score-list,
.score-grid {
    display: grid;
    gap: 12px;
}

.evaluation-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 14px 0 18px;
}

.evaluation-summary div,
.score-list div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: linear-gradient(180deg, #fff 0%, var(--surface-warm) 100%);
    box-shadow: var(--shadow-soft);
}

.evaluation-summary span,
.score-list span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.evaluation-summary strong {
    display: block;
    margin-top: 4px;
    font-size: 1.3rem;
}

.score-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0 4px;
}

.score-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

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

.stacked-links {
    display: grid;
    gap: 10px;
    margin-top: 22px;
}

.aside-heading {
    margin: 26px 0 12px;
    font-size: 1rem;
}

.ai-title,
.ai-heading {
    color: var(--ai-blue-dark);
}

.muted-copy {
    color: var(--muted);
    line-height: 1.5;
}

.link-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
}

.link-list a {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.link-list small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.4;
}

.attach-form {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.attach-form button {
    width: fit-content;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 440px);
    padding: 28px;
}

.login-brand {
    align-items: flex-start;
    margin-bottom: 26px;
}

.login-brand h1 {
    margin: 0 0 6px;
    font-size: 1.8rem;
}

.login-brand p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    font-weight: 700;
}

.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    background: #fff;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 500;
}

.login-form button {
    margin-top: 8px;
}

.field-error {
    margin: -4px 0 4px;
    color: var(--rust);
    font-size: 0.92rem;
}

@media (max-width: 860px) {
    .app-shell,
    .line-grid,
    .dashboard-grid,
    .worklist-grid,
    .dashboard-list-columns,
    .stat-strip,
    .board-grid,
    .filter-bar,
    .filter-bar-many,
    .form-grid,
    .status-form,
    .detail-grid,
    .archive-grid,
    .evaluation-summary,
    .score-grid,
    .score-list {
        grid-template-columns: 1fr;
    }

    .header-row,
    .item-row,
    .form-actions,
    .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        gap: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 16px 20px;
    }

    .mobile-nav-toggle {
        display: grid;
        place-content: center;
        gap: 5px;
    }

    .sidebar .nav-list,
    .sidebar .logout-form {
        display: none;
    }

    .sidebar.is-open .nav-list {
        display: grid;
    }

    .sidebar.is-open .logout-form {
        display: block;
    }

    .main-panel {
        padding: 28px 20px 44px;
    }
}
