:root {
    --bg: #f4f7f5;
    --bg-soft: #edf3ef;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-strong: #ffffff;
    --surface-alt: #12261d;
    --text: #13231b;
    --text-soft: #50645a;
    --border: rgba(19, 35, 27, 0.09);
    --border-strong: rgba(19, 35, 27, 0.15);
    --primary: #0f766e;
    --secondary: #d97706;
    --success: #15803d;
    --danger: #dc2626;
    --shadow: 0 24px 60px rgba(9, 30, 23, 0.08);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Manrope", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 24%),
        radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 18%),
        linear-gradient(180deg, #f7faf8 0%, #eef4f0 100%);
    color: var(--text);
}

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

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 40px 32px;
}

.auth-page {
    width: min(100%, 1120px);
}

.auth-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
    gap: 22px;
    padding: 22px;
    border: 1px solid rgba(19, 35, 27, 0.1);
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    box-shadow: 0 36px 80px rgba(9, 30, 23, 0.12);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: auto auto -80px -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.22), transparent 70%);
    pointer-events: none;
}

.auth-copy {
    position: relative;
    padding: 40px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top right, rgba(251, 191, 36, 0.24), transparent 28%),
        linear-gradient(145deg, rgba(15, 118, 110, 0.96), rgba(6, 95, 70, 0.9));
    color: #f8fffc;
    overflow: hidden;
    display: grid;
    gap: 18px;
}

.auth-copy::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -56px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
    pointer-events: none;
}

.auth-copy h1,
.sidebar-brand h1,
.auth-panel-header h2,
.topbar h2,
.hero-panel h3,
.panel-header h3,
.summary-title h3,
.page-headline h3,
.job-card h3,
.modal-header h3,
.empty-state h3 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
}

.login-kicker {
    display: inline-flex;
    align-self: start;
    align-items: center;
    justify-self: start;
    margin: 0;
    padding: 4px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-copy h1 {
    font-size: clamp(2.25rem, 5vw, 3.7rem);
    line-height: 0.98;
    max-width: 10ch;
}

.auth-lead {
    margin: 0;
    max-width: 44ch;
    line-height: 1.65;
    color: rgba(248, 255, 252, 0.88);
}

.auth-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 8px;
}

.auth-feature {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-feature-wide {
    grid-column: 1 / -1;
}

.auth-feature-label {
    color: rgba(251, 191, 36, 0.98);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-feature strong {
    font-size: 1.02rem;
}

.auth-feature p {
    margin: 0;
    color: rgba(248, 255, 252, 0.82);
    line-height: 1.55;
}

.auth-panel {
    display: grid;
    align-self: stretch;
    gap: 22px;
    padding: 32px 30px 26px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(19, 35, 27, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-panel-header {
    display: grid;
    gap: 10px;
}

.auth-panel-header .eyebrow {
    margin-bottom: 0;
}

.auth-panel-header h2 {
    font-size: 1.9rem;
}

.auth-panel-header p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 16px;
    border: 0;
}

.auth-submit {
    margin-top: 4px;
}

.auth-panel-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(19, 35, 27, 0.08);
    color: var(--text-soft);
    font-size: 0.9rem;
}

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

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    background: linear-gradient(180deg, rgba(18, 38, 29, 0.98), rgba(9, 24, 19, 0.95));
    color: #f5fffb;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--secondary);
}

.sidebar .eyebrow {
    color: rgba(251, 191, 36, 0.94);
}

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

.sidebar-nav a {
    padding: 14px 16px;
    border-radius: 18px;
    color: rgba(245, 255, 251, 0.72);
    transition: 180ms ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-caption {
    margin: 0;
    font-weight: 700;
}

.sidebar-copy {
    margin: 8px 0 0;
    color: rgba(245, 255, 251, 0.66);
}

.app-main {
    padding: 24px 28px 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-pill {
    display: grid;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

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

.page-content {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.hero-panel,
.panel,
.summary-hero,
.job-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.hero-panel,
.panel,
.summary-hero {
    padding: 24px;
}

.hero-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.hero-panel p,
.panel-header p,
.job-card-copy,
.summary-title p,
.modal-copy {
    color: var(--text-soft);
}

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

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

.filters-grid-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

.form-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.required {
    color: var(--danger);
}

.form-control,
.ts-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: #fbfdfc;
    color: var(--text);
    transition: 140ms ease;
}

.form-control:focus,
.ts-control.focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.form-control-textarea {
    min-height: 110px;
    resize: vertical;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.field-help,
.field-errors,
.cell-subtitle,
.progress-copy,
.empty-inline,
.back-link {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.field-errors {
    display: grid;
    gap: 4px;
}

.field-errors p,
.form-errors-banner p {
    margin: 0;
    color: var(--danger);
}

.form-errors-banner {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.18);
}

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

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

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

.data-table th {
    color: var(--text-soft);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.actions-col,
.actions-cell {
    text-align: right;
}

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

.badge-row,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.badge-success {
    color: #0f5132;
    background: rgba(134, 239, 172, 0.36);
}

.badge-danger {
    color: #991b1b;
    background: rgba(254, 202, 202, 0.5);
}

.badge-warning {
    color: #92400e;
    background: rgba(253, 230, 138, 0.52);
}

.badge-info {
    color: #155e75;
    background: rgba(165, 243, 252, 0.6);
}

.badge-neutral {
    color: #475569;
    background: rgba(226, 232, 240, 0.8);
}

.cards-grid,
.summary-metrics,
.detail-grid {
    display: grid;
    gap: 18px;
}

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

.job-card {
    padding: 22px;
    display: grid;
    gap: 18px;
}

.job-card-header,
.panel-header,
.modal-header,
.summary-main,
.checklist-head,
.note-card header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.job-card-header h3 a:hover,
.back-link:hover {
    color: var(--primary);
}

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

.meta-grid dt {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.meta-grid dd {
    margin: 6px 0 0;
    font-weight: 700;
}

.progress-block,
.metric-card-progress {
    display: grid;
    gap: 10px;
}

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

.progress-bar {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.2);
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #2dd4bf);
}

.job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    transition: 160ms ease;
}

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

.button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), #0d9488);
}

.button-secondary {
    color: #0f3b34;
    background: rgba(15, 118, 110, 0.12);
}

.button-ghost {
    color: var(--text);
    background: transparent;
    border: 1px solid var(--border-strong);
}

.button-danger {
    color: #ffffff;
    background: linear-gradient(135deg, var(--danger), #ef4444);
}

.button-small {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.button-block {
    width: 100%;
}

.summary-hero {
    display: grid;
    gap: 20px;
}

.summary-title {
    display: grid;
    gap: 10px;
    max-width: 70ch;
}

.summary-title p {
    margin: 0;
    line-height: 1.65;
}

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

.metric-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    display: grid;
    gap: 8px;
}

.metric-card span {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.summary-notes {
    padding: 18px;
    border-radius: 20px;
    background: rgba(15, 118, 110, 0.06);
}

.summary-notes p:last-child {
    margin-bottom: 0;
    line-height: 1.7;
}

.detail-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
    align-items: start;
}

.sticky-panel {
    position: sticky;
    top: 20px;
}

.checklist-stack,
.notes-stack,
.stack-form {
    display: grid;
    gap: 14px;
}

.compact-stack {
    gap: 10px;
}

.compact-form .field {
    gap: 6px;
}

.checklist-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fcfffd;
    display: grid;
    gap: 14px;
}

.checklist-card.is-complete {
    background: rgba(240, 253, 244, 0.85);
}

.checklist-title-wrap {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.check-toggle {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    background: #ffffff;
    font-weight: 900;
    color: transparent;
    cursor: pointer;
}

.check-toggle.done {
    color: #ffffff;
    background: linear-gradient(135deg, var(--success), #22c55e);
    border-color: transparent;
}

.checklist-card h4,
.item-notes h5 {
    margin: 0;
}

.checklist-copy,
.editor-note p,
.note-card p {
    margin: 0;
    line-height: 1.65;
}

.editor-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(217, 119, 6, 0.08);
}

.item-notes {
    display: grid;
    gap: 10px;
}

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

.note-card {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border);
}

.note-card-compact {
    padding: 12px 14px;
}

.note-card header span {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.page-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    display: inline-flex;
    margin-bottom: 12px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 10, 0.48);
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 50;
}

.modal-card {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
}

.modal-card-compact {
    width: min(480px, 100%);
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-soft);
}

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

.empty-state {
    padding: 24px;
    border-radius: 20px;
    border: 1px dashed rgba(15, 118, 110, 0.24);
    text-align: center;
    display: grid;
    gap: 12px;
}

.empty-state p,
.empty-inline {
    margin: 0;
}

.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    display: grid;
    gap: 10px;
    z-index: 60;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255, 0.95);
}

.page-headline,
.summary-main,
.panel-header,
.job-card-header,
.checklist-head {
    flex-wrap: wrap;
}

@media (max-width: 1120px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
    }

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

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 860px) {
    .auth-card,
    .filters-grid,
    .filters-grid-wide,
    .two-columns,
    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .app-main {
        padding: 18px;
    }

    .hero-panel,
    .job-card-footer,
    .topbar,
    .topbar-actions,
    .actions-cell,
    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .user-pill {
        width: 100%;
    }

    .button,
    .button-small {
        width: 100%;
    }

    .auth-copy,
    .auth-panel {
        padding: 24px;
    }

    .auth-highlights {
        grid-template-columns: 1fr;
    }

    .auth-feature-wide {
        grid-column: auto;
    }

    .auth-panel-footer {
        flex-direction: column;
    }

    .actions-cell form,
    .inline-actions,
    .inline-actions form {
        width: 100%;
    }
}
