:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel-soft: #fbfcfd;
    --line: #e5e7eb;
    --line-strong: #d7dce3;
    --text: #111827;
    --muted: #6b7280;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: #e6f6f4;
    --danger-soft: #fee2e2;
    --danger-text: #b91c1c;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.06), transparent 22%),
        linear-gradient(180deg, #f8fafc 0%, #f4f6f8 100%);
    font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

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

strong {
    font-weight: 650;
}

.site-shell {
    min-height: 100vh;
}

.shell-width {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.shell-width.dashboard-shell {
    max-width: none;
    width: 100%;
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(248, 250, 252, 0.88);
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.brand-title,
.brand-subtitle {
    display: block;
}

.brand-title {
    font-size: 1rem;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.82rem;
}

.main-nav,
.header-actions,
.inline-actions,
.filter-actions,
.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav {
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 12px;
    border-radius: 999px;
    color: #374151;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: #eef2f7;
}

.nav-link-create {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.nav-link-admin {
    background: #fff7ed;
    color: #9a3412;
}

.user-chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2f7;
    color: #374151;
    font-size: 0.92rem;
}

.main-content {
    padding: 28px 24px 48px;
}

.messages {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.message {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.message.success {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.message.error {
    background: #fef2f2;
    border-color: #fecaca;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-heading h1 {
    margin: 8px 0 0;
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.eyebrow {
    margin: 0;
    color: var(--brand-strong);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
}

.section-copy,
.muted-text,
.muted-label,
.hint,
small {
    color: var(--muted);
}

.button {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.94rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.button-primary {
    background: var(--brand);
    color: #fff;
}

.button-primary:hover {
    background: var(--brand-strong);
}

.button-secondary {
    background: #ecfeff;
    color: #155e75;
    border-color: #bae6fd;
}

.button-secondary:hover {
    background: #dff7fb;
}

.button-ghost {
    background: #fff;
    color: var(--text);
    border-color: var(--line-strong);
}

.button-ghost:hover {
    background: #f9fafb;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr);
    gap: 18px;
    padding: 20px 22px;
    margin-bottom: 18px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #111827 55%, #1f2937 100%);
    color: #f8fafc;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.dashboard-hero .eyebrow,
.dashboard-hero .section-copy {
    color: rgba(226, 232, 240, 0.78);
}

.dashboard-hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.85rem, 3vw, 2.65rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    max-width: 12ch;
}

.dashboard-hero-main {
    display: grid;
    align-content: space-between;
    gap: 18px;
}

.dashboard-hero-side {
    display: grid;
    gap: 14px;
}

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

.hero-signal-card,
.spotlight-card {
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    padding: 14px 16px;
}

.hero-signal-card span,
.spotlight-card p {
    color: rgba(226, 232, 240, 0.74);
}

.hero-signal-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.spotlight-card h3 {
    margin: 6px 0;
    font-size: 1rem;
    line-height: 1.3;
}

.spotlight-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 14px 0 16px;
    flex-wrap: wrap;
}

.spotlight-date {
    color: rgba(226, 232, 240, 0.8);
    font-size: 0.9rem;
}

.status-panel-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.status-panel {
    padding: 15px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: var(--shadow);
}

.status-panel-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.status-panel h3 {
    margin: 0;
    font-size: 0.9rem;
}

.status-panel strong {
    font-size: 1.45rem;
    letter-spacing: -0.05em;
}

.status-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.status-teal { box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.08), var(--shadow); }
.status-amber { box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.08), var(--shadow); }
.status-indigo { box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.08), var(--shadow); }
.status-rose { box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.08), var(--shadow); }
.status-slate { box-shadow: inset 0 0 0 1px rgba(71, 85, 105, 0.08), var(--shadow); }

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

.dashboard-section {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.section-span-two {
    grid-column: span 2;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.mission-column {
    padding: 12px;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0)),
        #f8fafc;
    border: 1px solid var(--line);
}

.mission-column header {
    display: grid;
    gap: 2px;
    margin-bottom: 12px;
}

.mission-column header strong {
    font-size: 0.92rem;
}

.mission-column header span {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.mission-card {
    display: grid;
    gap: 10px;
    padding: 10px 11px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(215, 220, 227, 0.8);
}

.mission-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.mission-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.compact-metric-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.compact-metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.compact-metric-row span {
    color: var(--muted);
    font-size: 0.9rem;
}

.compact-metric-row strong {
    font-size: 1rem;
}

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

.mini-list-row {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.mini-list-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.mini-list-row p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.mini-list-row span {
    color: var(--muted);
    font-size: 0.84rem;
}

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

.aging-band {
    display: grid;
    gap: 8px;
}

.aging-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.aging-label span {
    color: var(--muted);
    font-size: 0.84rem;
}

.aging-track {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef2f7;
}

.aging-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #14b8a6, #0f766e);
}

.journal-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.journal-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #334155;
}

.journal-pill strong {
    font-size: 0.88rem;
    color: var(--brand-strong);
}

.chart-panel {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    min-height: 160px;
}

.chart-bar-wrap {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 8px;
}

.chart-value {
    color: var(--muted);
    font-size: 0.84rem;
}

.chart-bar {
    width: 100%;
    max-width: 46px;
    border-radius: 16px 16px 8px 8px;
    background: linear-gradient(180deg, #34d399, #0f766e);
    box-shadow: inset 0 -10px 18px rgba(15, 23, 42, 0.12);
}

.chart-label {
    color: var(--muted);
    font-size: 0.84rem;
}

.timeline.dense {
    gap: 14px;
}

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

.ledger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.ledger-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ledger-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ledger-ratio {
    color: var(--muted);
    font-size: 0.82rem;
}

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

.published-card {
    display: grid;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #f8fffd);
}

.published-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.published-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.stat-card,
.data-card,
.table-card,
.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 18px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
    letter-spacing: -0.03em;
}

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

.span-two {
    grid-column: span 2;
}

.data-card,
.table-card {
    padding: 20px;
}

.section-header,
.detail-topline,
.content-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.section-header h3,
.content-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.stack-list,
.timeline {
    display: grid;
    gap: 12px;
}

.list-row,
.kanban-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
}

.list-row p,
.kanban-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.row-meta {
    display: grid;
    gap: 8px;
    justify-items: end;
    text-align: right;
}

.meta-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.kanban-column {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fafafa;
    padding: 14px;
}

.kanban-column header {
    margin-bottom: 10px;
    color: #374151;
    font-size: 0.92rem;
    font-weight: 700;
}

.kanban-column .kanban-item {
    display: block;
    margin-bottom: 10px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 12px 1fr;
    gap: 12px;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 999px;
    background: var(--brand);
}

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

.field-grid.single {
    grid-template-columns: 1fr;
}

.field-span-2 {
    grid-column: span 2;
}

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

label {
    font-size: 0.92rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

textarea {
    min-height: 112px;
    resize: vertical;
}

.field-error {
    color: var(--danger-text);
    font-size: 0.88rem;
}

.table-card {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

td:first-child,
th:first-child {
    white-space: normal;
}

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

.info-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
}

.note-box {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    margin: 14px 0;
}

.ai-result {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f0fdfa;
    border: 1px solid #ccfbf1;
}

.auth-shell {
    max-width: 920px;
    margin: 36px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 420px);
    gap: 24px;
    align-items: start;
}

.auth-copy h1 {
    margin: 10px 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.auth-copy p {
    color: var(--muted);
    max-width: 42ch;
}

.auth-card {
    padding: 22px;
}

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

.auth-footnote {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-footnote a {
    color: var(--brand-strong);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-slate { background: #e5e7eb; color: #374151; }
.badge-sand { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-amber { background: #fde68a; color: #92400e; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: var(--danger-soft); color: var(--danger-text); }
.badge-zinc { background: #e5e7eb; color: #4b5563; }
.badge-rose { background: #ffe4e6; color: #be123c; }
.badge-emerald { background: #d1fae5; color: #047857; }
.badge-gray { background: #f3f4f6; color: #4b5563; }

.empty-state,
.empty-wrap {
    color: var(--muted);
}

@media (max-width: 1080px) {
    .dashboard-hero,
    .dashboard-main-grid,
    .mission-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .content-grid,
    .detail-grid,
    .kanban-grid,
    .published-grid,
    .filters,
    .field-grid,
    .info-grid,
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .span-two,
    .field-span-2,
    .section-span-two {
        grid-column: span 1;
    }

    .main-nav {
        justify-content: start;
        order: 3;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .header-inner,
    .main-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .dashboard-hero {
        padding: 18px;
        border-radius: 22px;
    }

    .hero-signal-grid,
    .status-panel-grid {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .section-header,
    .detail-topline,
    .content-heading,
    .inline-actions,
    .filter-actions,
    .header-actions {
        align-items: start;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-panel {
        min-height: 140px;
    }
}
