@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700&display=swap");

:root {
    --canvas: #f5f2e7;
    --canvas-deep: #ece7d9;
    --panel: #fbf8f0;
    --panel-strong: #f1ecdf;
    --control: #f0eadb;
    --line: rgba(26, 49, 45, 0.12);
    --line-strong: rgba(17, 49, 91, 0.2);
    --ink: #123249;
    --ink-soft: #4d6170;
    --ink-muted: #7b8b95;
    --leaf: #0d6c48;
    --leaf-strong: #0a5b3b;
    --leaf-soft: rgba(13, 108, 72, 0.12);
    --ocean: #16395b;
    --ocean-soft: rgba(22, 57, 91, 0.1);
    --brass: #9d7a1f;
    --brass-soft: rgba(157, 122, 31, 0.14);
    --danger: #a43b36;
    --danger-soft: rgba(164, 59, 54, 0.12);
    --success: #0b6a44;
    --success-soft: rgba(11, 106, 68, 0.12);
    --radius-sm: 16px;
    --radius-md: 22px;
    --radius-lg: 32px;
    --space: 8px;
    --page-gutter: clamp(16px, 2.4vw, 36px);
    --content-max: 1560px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    overflow-x: hidden;
    overscroll-behavior-x: none;
    background:
        radial-gradient(circle at top left, rgba(13, 108, 72, 0.11), transparent 34%),
        radial-gradient(circle at top right, rgba(22, 57, 91, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f5eb 0%, #f2ecdf 56%, #eee7d8 100%);
}

body.body-locked {
    overflow: hidden;
}

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

button,
input,
select,
textarea {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

code {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.92em;
}

.shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 220ms ease;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: calc(var(--space) * 3);
    border-right: 1px solid var(--line);
    background: rgba(245, 242, 231, 0.72);
    backdrop-filter: blur(16px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.mobile-nav-bar,
.sidebar-overlay {
    display: none;
}

.sidebar-top {
    display: flex;
    align-items: start;
    gap: 12px;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: calc(var(--space) * 2.25);
    min-height: 100%;
}

.brand {
    margin-bottom: calc(var(--space) * 0.5);
}

.brand-card,
.sidebar-card,
.page-hero,
.panel,
.login-card,
.kpi-card,
.quick-link,
.action-card,
.attention-card,
.timeline-item,
.alert-card,
.user-pill,
.story-card {
    border: 1px solid var(--line);
    background: var(--panel);
}

.brand-card {
    display: grid;
    gap: calc(var(--space) * 1.5);
    padding: calc(var(--space) * 1.75);
    border-radius: var(--radius-md);
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    min-height: 82px;
    padding: calc(var(--space) * 1.5);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(241, 236, 223, 0.96)),
        var(--panel);
    border: 1px solid rgba(17, 49, 91, 0.08);
}

.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    gap: 6px;
}

.brand-text,
.page-hero h1,
.section-head h2,
.attention-head h3,
.login-story h1,
.login-card h2 {
    font-family: "Sora", sans-serif;
}

.brand-text {
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

.brand-copy small {
    color: var(--ink-soft);
}

.nav-group {
    display: grid;
    gap: 10px;
}

.nav-group-label,
.sidebar-label,
.hero-kicker,
.login-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

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

.nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 18px;
    color: var(--ink-soft);
    border: 1px solid transparent;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav a:hover,
.nav a.is-active {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(17, 49, 91, 0.08);
    transform: translateX(2px);
}

.nav a.is-active {
    background: linear-gradient(135deg, rgba(13, 108, 72, 0.12), rgba(255, 255, 255, 0.55));
}

.nav-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--leaf);
    background: rgba(13, 108, 72, 0.1);
    border: 1px solid rgba(13, 108, 72, 0.08);
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-kicker {
    display: inline-flex;
    min-width: 26px;
    color: var(--leaf);
    font-size: 0.78rem;
    font-weight: 800;
    font-family: "IBM Plex Mono", monospace;
}

.nav-label {
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
}

.sidebar-card {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(13, 108, 72, 0.1), transparent 46%),
        var(--panel-strong);
}

.sidebar-card strong {
    font-family: "Sora", sans-serif;
    font-size: 2rem;
    letter-spacing: -0.05em;
}

.sidebar-card span {
    color: var(--ink-soft);
    line-height: 1.6;
}

.mobile-nav-bar {
    position: sticky;
    top: 0;
    z-index: 38;
    align-items: center;
    gap: 14px;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    border-bottom: 1px solid rgba(17, 49, 91, 0.1);
    background: rgba(245, 242, 231, 0.92);
    backdrop-filter: blur(16px);
}

.mobile-nav-brand {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.mobile-nav-brand strong,
.mobile-nav-brand small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-nav-brand strong {
    font-family: "Sora", sans-serif;
    font-size: 0.98rem;
    letter-spacing: -0.03em;
}

.mobile-nav-brand small {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 36;
    border: 0;
    background: rgba(18, 50, 73, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(17, 49, 91, 0.18);
    border-radius: 999px;
    border: 2px solid rgba(245, 242, 231, 0.65);
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.main {
    padding: calc(var(--space) * 4) var(--page-gutter);
    min-width: 0;
}

.content-stack {
    display: grid;
    gap: calc(var(--space) * 3);
    width: min(100%, var(--content-max));
    margin-inline: auto;
}

.app-footer {
    width: min(100%, var(--content-max));
    margin: calc(var(--space) * 3) auto 0;
    padding: 0 4px calc(var(--space) * 1.75);
    display: grid;
    justify-items: center;
}

.app-footer::before {
    content: "";
    width: min(100%, 420px);
    height: 1px;
    margin-bottom: 14px;
    background: linear-gradient(90deg, transparent, rgba(18, 50, 73, 0.24), transparent);
}

.app-footer-line {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 8px 10px;
    text-align: center;
}

.app-footer-mark {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.app-footer-brand {
    font-family: "Sora", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ocean);
}

.app-footer-copy {
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.6;
}

.app-footer-by {
    font-family: "Sora", sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--leaf-strong);
}

.page-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: calc(var(--space) * 3);
    align-items: start;
    padding: calc(var(--space) * 4);
    margin-bottom: calc(var(--space) * 3);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.52), transparent 58%),
        linear-gradient(180deg, rgba(251, 248, 240, 0.95), rgba(241, 236, 223, 0.98));
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: auto auto 24px 28px;
    width: 140px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--leaf), rgba(13, 108, 72, 0.1));
}

.page-hero::after {
    content: "";
    position: absolute;
    top: -28px;
    right: -50px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 57, 91, 0.12), transparent 70%);
}

.page-hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.page-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 2.8vw, 3.35rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.hero-copy {
    max-width: 760px;
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.75;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(17, 49, 91, 0.08);
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 700;
}

.hero-chip.danger {
    color: var(--danger);
    background: rgba(164, 59, 54, 0.08);
    border-color: rgba(164, 59, 54, 0.12);
}

.page-hero-aside {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    justify-items: stretch;
    align-content: start;
}

.user-pill {
    display: grid;
    gap: 6px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.58);
}

.user-pill-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.logout-form {
    display: contents;
}

.sidebar-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid rgba(17, 49, 91, 0.12);
    background: rgba(255, 255, 255, 0.56);
    color: var(--ink);
    cursor: pointer;
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 160ms ease, opacity 160ms ease;
}

.sidebar-toggle-inline {
    display: inline-flex;
    flex: 0 0 auto;
}

.panel,
.login-card {
    padding: calc(var(--space) * 3.5);
    border-radius: var(--radius-md);
}

.grid-two,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--space) * 3);
}

.detail-grid {
    align-items: start;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: calc(var(--space) * 2.5);
}

.section-head h2,
.attention-head h3,
.login-card h2 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.04em;
}

.section-head p,
.attention-head p,
.login-card p,
.login-story p {
    margin: 6px 0 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #f7f5ef;
    background: linear-gradient(135deg, var(--leaf), var(--ocean));
}

.btn-secondary {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.52);
    border-color: rgba(17, 49, 91, 0.12);
}

.btn-danger {
    color: #fff7f5;
    background: linear-gradient(135deg, var(--danger), #7f241f);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.86rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.badge-soft,
.badge-neutral {
    color: var(--ocean);
    background: var(--ocean-soft);
}

.badge-info {
    color: var(--ocean);
    background: rgba(25, 84, 138, 0.13);
}

.badge-violet {
    color: #66539a;
    background: rgba(102, 83, 154, 0.14);
}

.badge-warning,
.badge-orange {
    color: #8a6512;
    background: var(--brass-soft);
}

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

.messages {
    display: grid;
    gap: 12px;
}

.flash {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    font-weight: 700;
}

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

.flash-warning {
    color: #7f6218;
    background: var(--brass-soft);
}

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

.flash-info,
.flash-muted {
    color: var(--ocean);
    background: var(--ocean-soft);
}

.muted {
    color: var(--ink-soft);
}

.stack-form,
.stack-cards,
.timeline,
.quick-links {
    display: grid;
    gap: calc(var(--space) * 2);
}

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

.field label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(17, 49, 91, 0.12);
    background: var(--control);
    color: var(--ink);
    outline: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.field textarea {
    min-height: 124px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(13, 108, 72, 0.38);
    background: rgba(255, 255, 255, 0.72);
}

.field ul {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.field li label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-options ul {
    gap: 12px;
}

.field-options li {
    display: flex;
}

.field-options li label {
    width: 100%;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(17, 49, 91, 0.1);
    border-radius: 16px;
    background: rgba(240, 234, 219, 0.58);
    color: var(--ink);
    line-height: 1.45;
}

.field-options input[type="checkbox"] {
    width: 18px;
    min-width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
    border-radius: 6px;
}

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

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(17, 49, 91, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.36);
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 49, 91, 0.22) transparent;
}

.table-wrap::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(17, 49, 91, 0.22);
    border-radius: 999px;
}

.scroll-hint {
    margin-bottom: 10px;
    color: var(--ink-muted);
    font-size: 0.82rem;
}

.table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(17, 49, 91, 0.08);
    text-align: left;
    vertical-align: top;
}

.table thead th {
    color: var(--ink-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: rgba(241, 236, 223, 0.72);
}

.table tbody tr {
    transition: background 160ms ease;
}

.table tbody tr:hover {
    background: rgba(13, 108, 72, 0.05);
}

.table-compact {
    min-width: 620px;
}

.table-wo {
    min-width: 1160px;
    table-layout: fixed;
}

.table-wo-basic th:nth-child(1),
.table-wo-basic td:nth-child(1) {
    width: 5%;
}

.table-wo-basic th:nth-child(2),
.table-wo-basic td:nth-child(2) {
    width: 20%;
}

.table-wo-basic th:nth-child(3),
.table-wo-basic td:nth-child(3) {
    width: 18%;
}

.table-wo-basic th:nth-child(4),
.table-wo-basic td:nth-child(4) {
    width: 14%;
}

.table-wo-basic th:nth-child(5),
.table-wo-basic td:nth-child(5) {
    width: 10%;
}

.table-wo-basic th:nth-child(6),
.table-wo-basic td:nth-child(6) {
    width: 10%;
}

.table-wo-basic th:nth-child(7),
.table-wo-basic td:nth-child(7) {
    width: 14%;
}

.table-wo-basic th:nth-child(8),
.table-wo-basic td:nth-child(8) {
    width: 16%;
}

.table-wo-basic th:nth-child(9),
.table-wo-basic td:nth-child(9) {
    width: 8%;
}

.table-wo-admin th:nth-child(1),
.table-wo-admin td:nth-child(1) {
    width: 5%;
}

.table-wo-admin th:nth-child(2),
.table-wo-admin td:nth-child(2) {
    width: 5%;
}

.table-wo-admin th:nth-child(3),
.table-wo-admin td:nth-child(3) {
    width: 18%;
}

.table-wo-admin th:nth-child(4),
.table-wo-admin td:nth-child(4) {
    width: 14%;
}

.table-wo-admin th:nth-child(5),
.table-wo-admin td:nth-child(5) {
    width: 14%;
}

.table-wo-admin th:nth-child(6),
.table-wo-admin td:nth-child(6) {
    width: 10%;
}

.table-wo-admin th:nth-child(7),
.table-wo-admin td:nth-child(7) {
    width: 12%;
}

.table-wo-admin th:nth-child(8),
.table-wo-admin td:nth-child(8) {
    width: 16%;
}

.table-wo-admin th:nth-child(9),
.table-wo-admin td:nth-child(9) {
    width: 10%;
}

.table-wo-admin th:nth-child(10),
.table-wo-admin td:nth-child(10) {
    width: 16%;
}

.table-selection-cell,
.checkbox-cell {
    text-align: center;
}

.checkbox-cell input,
.table-selection-cell input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
}

.table-action-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.selection-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.48);
}

.selection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.selection-count {
    color: var(--ink-soft);
    font-weight: 700;
}

.action-card-copy {
    display: grid;
    gap: 6px;
}

.action-transition-line {
    margin: 0;
    color: var(--ocean);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.action-hint {
    margin: 0;
    color: var(--danger);
    font-weight: 700;
}

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

.action-confirm-modal.is-hidden,
.modal-shell.is-hidden,
.action-layer.is-hidden {
    display: none;
}

.activity-detail-disclosure {
    display: grid;
    gap: 12px;
    margin-top: 4px;
}

.activity-detail-summary {
    list-style: none;
    cursor: pointer;
    color: var(--ocean);
    font-weight: 800;
}

.activity-detail-summary::-webkit-details-marker {
    display: none;
}

.activity-detail-grid {
    display: grid;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid rgba(17, 49, 91, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
}

.wo-primary {
    display: grid;
    gap: 6px;
}

.wo-id {
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}

.wo-meta,
.wo-secondary {
    color: var(--ink-soft);
    font-size: 0.87rem;
    line-height: 1.55;
}

.wo-secondary strong {
    color: var(--ink);
    font-size: 0.95rem;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: var(--ink-soft);
    padding: 28px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--space) * 2);
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.filter-actions > * {
    flex: 0 0 auto;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: calc(var(--space) * 2.5);
}

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

.kpi-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    min-height: 150px;
    padding: 22px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(241, 236, 223, 0.76)),
        var(--panel);
}

.kpi-card::before {
    content: "";
    width: 54px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--leaf), rgba(13, 108, 72, 0.15));
}

.kpi-card span {
    color: var(--ink-soft);
    font-size: 0.94rem;
    font-weight: 600;
}

.kpi-card strong {
    font-family: "Sora", sans-serif;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.06em;
}

.kpi-card.success::before {
    background: linear-gradient(90deg, var(--success), rgba(11, 106, 68, 0.16));
}

.kpi-card.danger::before {
    background: linear-gradient(90deg, var(--danger), rgba(164, 59, 54, 0.15));
}

.metric-list,
.meta-list {
    display: grid;
    gap: 6px;
}

.metric-list div,
.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(17, 49, 91, 0.08);
}

.metric-list div:last-child,
.meta-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.metric-list span,
.meta-list span {
    color: var(--ink-soft);
}

.quick-link,
.action-card,
.activity-card,
.attention-card,
.timeline-item,
.alert-card {
    border-radius: 22px;
}

.quick-link {
    display: grid;
    gap: 6px;
    padding: 20px;
    font-weight: 800;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(13, 108, 72, 0.08), transparent 72%),
        rgba(255, 255, 255, 0.46);
}

.action-card,
.activity-card,
.attention-card,
.timeline-item {
    padding: 20px;
    background: rgba(255, 255, 255, 0.42);
}

.activity-card {
    display: grid;
    gap: 16px;
}

.activity-card-live {
    background:
        linear-gradient(135deg, rgba(13, 108, 72, 0.08), transparent 76%),
        rgba(255, 255, 255, 0.5);
}

.activity-card-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

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

.activity-meta-grid div,
.selection-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.activity-meta-grid span {
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.activity-meta-grid strong {
    font-size: 1rem;
}

.activity-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.selection-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(17, 49, 91, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.42);
}

.selection-list {
    display: grid;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.selection-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(17, 49, 91, 0.08);
    background: rgba(240, 234, 219, 0.45);
}

.selection-item small {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
}

.section-head-tight {
    margin-top: calc(var(--space) * 3);
}

.modal-shell,
.action-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 50, 73, 0.44);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    padding: 28px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(241, 236, 223, 0.96)),
        var(--panel);
}

.attention-modal-shell {
    z-index: 90;
}

.attention-modal-card {
    width: min(100%, 860px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.attention-block-list {
    max-height: calc(100vh - 210px);
    padding-right: 4px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-disclosure {
    display: grid;
    gap: 14px;
}

.cancel-summary {
    list-style: none;
    width: fit-content;
    cursor: pointer;
}

.cancel-summary::-webkit-details-marker {
    display: none;
}

.cancel-panel {
    display: grid;
    gap: 18px;
}

.cancel-actions {
    padding-top: 4px;
}

.alert-card {
    padding: 18px 20px;
    background: rgba(22, 57, 91, 0.08);
}

.alert-card.danger {
    background: var(--danger-soft);
}

.timeline-item {
    border-left: 4px solid rgba(13, 108, 72, 0.25);
}

.attention-head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 18px;
    margin-bottom: 18px;
}

.attention-head h3 {
    font-size: 1.4rem;
}

.inline-form {
    margin-top: calc(var(--space) * 2);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: calc(var(--space) * 3);
}

.login-shell {
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 460px);
    gap: calc(var(--space) * 3);
    align-items: stretch;
}

.login-story {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: calc(var(--space) * 4);
}

.login-story h1 {
    margin: 0;
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.login-lead {
    max-width: 620px;
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.8;
}

.login-story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: calc(var(--space) * 2);
}

.story-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(241, 236, 223, 0.76)),
        var(--panel);
}

.story-card span {
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.story-card strong {
    font-size: 1rem;
    line-height: 1.6;
}

.login-card {
    align-self: center;
    width: 100%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(241, 236, 223, 0.94)),
        var(--panel);
}

.login-header {
    display: grid;
    gap: 22px;
    margin-bottom: calc(var(--space) * 3);
}

.login-logo-wrap {
    width: min(100%, 260px);
    min-height: 94px;
}

.login-logo {
    width: 100%;
}

.login-card h2 {
    font-size: 1.65rem;
}

.login-card p {
    color: var(--ink-soft);
}

.sidebar-collapsed .shell {
    grid-template-columns: 104px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
    padding-inline: calc(var(--space) * 1.5);
}

.sidebar-collapsed .sidebar-top {
    flex-direction: column;
    align-items: center;
}

.sidebar-collapsed .brand-card {
    justify-items: center;
    padding: 16px 12px;
}

.sidebar-collapsed .brand-logo-wrap {
    width: 56px;
    min-height: 56px;
    padding: 8px;
    border-radius: 16px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-group-label,
.sidebar-collapsed .nav-kicker,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-card {
    display: none;
}

.sidebar-collapsed .nav a {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    min-height: 18px;
    padding: 0 4px;
    font-size: 0.62rem;
}

.sidebar-collapsed .nav a {
    position: relative;
}

.sidebar-collapsed .sidebar-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar-collapsed .sidebar-toggle span:nth-child(2) {
    opacity: 0;
}

.sidebar-collapsed .sidebar-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1180px) {
    .main {
        padding-inline: calc(var(--page-gutter) - 4px);
    }

    .page-hero {
        grid-template-columns: 1fr;
    }

    .page-hero-aside {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        align-items: stretch;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .grid-two,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .panel,
    .login-card {
        padding: calc(var(--space) * 3);
    }

    .table {
        min-width: 680px;
    }

    .table-wo {
        min-width: 980px;
    }

    .selection-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar-collapsed .shell {
        grid-template-columns: 1fr;
    }

    .mobile-nav-bar {
        display: flex;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 40;
        width: min(86vw, 360px);
        height: 100dvh;
        border-right: 1px solid var(--line);
        border-bottom: 0;
        padding: calc(var(--space) * 2.5) 16px max(16px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overflow-x: hidden;
        transform: translateX(calc(-100% - 24px));
        transition: transform 220ms ease;
        box-shadow: 0 24px 60px rgba(18, 50, 73, 0.22);
    }

    .sidebar-top {
        align-items: center;
    }

    .sidebar-inner {
        gap: calc(var(--space) * 2.5);
        min-height: auto;
    }

    .main {
        padding: calc(var(--space) * 2.25) var(--page-gutter) calc(var(--space) * 2.75);
    }

    .filter-grid,
    .kpi-grid,
    .kpi-grid.tight,
    .page-hero-aside {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .page-hero,
    .panel,
    .login-card {
        padding: calc(var(--space) * 2.5);
        border-radius: 24px;
    }

    .section-head {
        flex-direction: column;
    }

    .table-compact {
        min-width: 560px;
    }

    .table-wrap-wo {
        margin-inline: -4px;
    }

    .sidebar-collapsed .sidebar {
        padding-inline: 16px;
    }

    .sidebar-collapsed .sidebar-top {
        flex-direction: row;
        align-items: center;
    }

    .sidebar-collapsed .brand-card {
        justify-items: stretch;
        padding: calc(var(--space) * 1.75);
    }

    .sidebar-collapsed .brand-logo-wrap {
        width: min(100%, 220px);
        min-height: 82px;
        padding: calc(var(--space) * 1.5);
        border-radius: 20px;
    }

    .sidebar-collapsed .brand-copy {
        display: grid;
    }

    .sidebar-collapsed .nav-group-label,
    .sidebar-collapsed .nav-label {
        display: block;
    }

    .sidebar-collapsed .sidebar-card {
        display: grid;
    }

    .sidebar-collapsed .nav a {
        justify-content: flex-start;
        padding: 0 16px;
    }

    .sidebar-collapsed .nav-badge {
        position: static;
        min-width: 30px;
        min-height: 30px;
        padding: 0 12px;
        font-size: 0.74rem;
    }

    .sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-mobile-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }

    .hero-copy {
        font-size: 0.96rem;
        line-height: 1.65;
    }

    .page-hero-aside,
    .filter-grid,
    .kpi-grid,
    .kpi-grid.tight,
    .login-story-grid {
        grid-template-columns: 1fr;
    }

    .meta-list div,
    .metric-list div,
    .selection-head,
    .activity-meta-grid div {
        flex-direction: column;
        gap: 4px;
    }

    .activity-meta-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        min-height: 46px;
    }

    .page-hero {
        gap: calc(var(--space) * 2.25);
    }

    .page-hero::after {
        width: 180px;
        height: 180px;
        top: -34px;
        right: -60px;
    }

    .content-stack {
        gap: calc(var(--space) * 2.25);
    }

    .kpi-card {
        min-height: 132px;
        padding: 20px;
    }

    .kpi-card strong {
        font-size: 1.72rem;
    }
}

@media (max-width: 640px) {
    .login-body {
        padding: calc(var(--space) * 2);
    }

    .main {
        padding-inline: 16px;
    }

    .brand-card,
    .page-hero,
    .panel,
    .login-card {
        border-radius: 20px;
    }

    .page-hero {
        padding: 20px;
        margin-bottom: calc(var(--space) * 2);
    }

    .page-hero-copy {
        gap: 10px;
    }

    .hero-chips {
        gap: 8px;
    }

    .hero-chip {
        min-height: 34px;
        padding: 0 12px;
    }

    .nav a {
        min-height: 50px;
        padding: 0 14px;
    }

    .btn {
        width: 100%;
    }

    .filter-actions {
        display: grid;
    }

    .modal-card {
        padding: 20px;
        border-radius: 22px;
    }

    .modal-actions {
        display: grid;
    }

    .filter-actions > * {
        width: 100%;
    }

    .table th,
    .table td {
        padding: 14px;
    }

    .table {
        min-width: 620px;
    }

    .table-compact {
        min-width: 520px;
    }

    .table-wo {
        min-width: 980px;
    }

    .wo-id {
        font-size: 0.92rem;
    }

    .wo-meta,
    .wo-secondary {
        font-size: 0.82rem;
    }

    .attention-head {
        flex-direction: column;
    }

    .field input,
    .field select,
    .field textarea {
        font-size: 16px;
    }

    .section-head h2,
    .attention-head h3,
    .login-card h2 {
        font-size: 1.02rem;
    }

    .metric-list div,
    .meta-list div {
        padding: 12px 0;
    }

    .table-stack-mobile {
        min-width: 0;
        border-collapse: separate;
    }

    .table-stack-mobile thead {
        display: none;
    }

    .table-stack-mobile tbody {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .table-stack-mobile tbody tr {
        display: grid;
        gap: 10px;
        padding: 16px;
        border: 1px solid rgba(17, 49, 91, 0.08);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.62);
    }

    .table-stack-mobile tbody td {
        display: grid;
        grid-template-columns: minmax(104px, 42%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding: 0;
        border-bottom: 0;
    }

    .table-stack-mobile tbody td::before {
        content: attr(data-label);
        color: var(--ink-muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .table-stack-mobile tbody td.table-actions,
    .table-stack-mobile tbody td.empty {
        grid-template-columns: 1fr;
    }

    .table-stack-mobile tbody td.table-actions::before,
    .table-stack-mobile tbody td.empty::before {
        display: none;
    }

    .table-stack-mobile tbody td.empty {
        text-align: center;
        color: var(--ink-soft);
        padding: 8px 0;
    }

    .table-stack-mobile .btn {
        width: 100%;
    }

    .table-stack-mobile .table-actions {
        text-align: left;
        white-space: normal;
        padding-top: 4px;
    }

    .table-stack-mobile .badge {
        justify-self: start;
    }

    .login-shell {
        gap: calc(var(--space) * 2);
    }

    .login-story {
        padding: calc(var(--space) * 2.5) 8px 0;
    }

    .login-story h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .login-lead {
        font-size: 0.96rem;
        line-height: 1.7;
    }
}

@media (max-width: 960px) and (orientation: landscape) {
    .mobile-nav-bar {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: 10px;
    }

    .sidebar {
        width: min(56vw, 340px);
    }

    .page-hero {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: calc(var(--space) * 2);
        padding: 20px;
    }

    .page-hero h1 {
        font-size: clamp(1.6rem, 4vw, 2.3rem);
    }

    .hero-copy {
        font-size: 0.92rem;
        line-height: 1.55;
    }

    .page-hero-aside {
        grid-template-columns: 1fr;
        gap: 10px;
    }

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

    .kpi-card {
        min-height: 118px;
        padding: 18px;
    }

    .sidebar-card {
        padding: 14px;
    }

    .sidebar-card strong {
        font-size: 1.6rem;
    }
}

@media (max-width: 420px) {
    .page-hero,
    .panel,
    .login-card {
        padding: 18px;
    }

    .hero-chip,
    .badge {
        font-size: 0.7rem;
    }

    .sidebar-toggle {
        width: 42px;
        height: 42px;
    }

    .brand-logo-wrap {
        min-height: 70px;
    }

    .mobile-nav-bar {
        padding-inline: 12px;
    }

    .mobile-nav-brand strong {
        font-size: 0.94rem;
    }

    .table-stack-mobile tbody {
        padding: 10px;
    }

    .table-stack-mobile tbody tr {
        padding: 14px;
    }

    .table-stack-mobile tbody td {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .table-stack-mobile tbody td::before {
        font-size: 0.68rem;
    }

    .table-action-stack {
        align-items: stretch;
    }
}
