<style>*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f3ee;
    --surface: #ffffff;
    --surface2: #f9f8f5;
    --border: #e4e0d8;
    --border-strong: #c8c2b8;
    --text: #1a1714;
    --text-secondary: #6b6560;
    --text-muted: #a09a93;
    --accent: #c0392b;
    --accent-soft: #fdf0ee;
    --accent-hover: #a93226;
    --accent2: #d4870a;
    --accent2-soft: #fef9ec;
    --accent3: #2563a8;
    --accent3-soft: #eef4fc;
    --green: #1a7a4a;
    --green-soft: #edf7f2;
    --sidebar-w: 240px;
    --header-h: 64px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* HEADER */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 200;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #f0cdc9;
    padding: 3px 9px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 16px;
    flex-shrink: 0;
}

.header-title {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: var(--text);
    letter-spacing: -0.01em;
    flex: 1;
}

.header-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
}

/* LAYOUT */
.layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: 100vh;
}

/* SIDEBAR */
nav {
    width: var(--sidebar-w);
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 0 32px;
    z-index: 100;
}

.nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0 20px;
    margin-bottom: 8px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

nav a:hover {
    background: var(--surface2);
    color: var(--text);
}

nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.nav-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

nav a.active .nav-num {
    color: var(--accent);
    opacity: 0.6;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 20px;
}

/* MAIN */
main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 40px 48px 80px;
}

/* SECTION */
.section {
    display: none;
    animation: fadeIn 0.2s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.section-header h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    font-weight: normal;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.2;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.section-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface2);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
}

.btn-ghost:hover {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

.btn-edit {
    background: var(--accent3-soft);
    color: var(--accent3);
    border: 1px solid #bfd5ef;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
}

.btn-edit:hover {
    background: #d8e8f7;
    border-color: var(--accent3);
}

.btn-delete {
    background: transparent;
    color: var(--accent);
    border: 1px solid #f0cdc9;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
}

.btn-delete:hover {
    background: var(--accent-soft);
}

.btn-save {
    background: var(--accent);
    color: white;
}

.btn-save:hover {
    background: var(--accent-hover);
}

/* ACTION CELL */
.action-cell {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 10, 0.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    transform: translateY(12px);
    transition: transform 0.2s ease;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
    border-radius: 14px 14px 0 0;
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 20px;
    font-weight: normal;
    letter-spacing: -0.01em;
}

.modal-header-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    font-family: 'JetBrains Mono', monospace;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.12s;
}

.modal-close:hover {
    background: var(--surface2);
    color: var(--text);
}

.modal-body {
    padding: 24px 28px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 28px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--surface);
    border-radius: 0 0 14px 14px;
    flex-shrink: 0;
}

.modal-footer-left {
    display: flex;
    gap: 8px;
}

.modal-footer-right {
    display: flex;
    gap: 8px;
}

/* FORM */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'JetBrains Mono', monospace;
}

.form-label span {
    color: var(--accent);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent3);
    box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.1);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a09a93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

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

.form-section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    grid-column: 1 / -1;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

/* TOOLBAR */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-wrap input {
    width: 100%;
    padding: 9px 13px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    background: var(--surface);
    outline: none;
    color: var(--text);
    transition: border-color 0.15s;
}

.search-wrap input:focus {
    border-color: var(--accent3);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.filter-select {
    padding: 9px 32px 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a09a93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s;
}

.filter-select:focus {
    border-color: var(--accent3);
}

/* TABLE */
.jobs-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.jobs-table thead th {
    background: var(--surface2);
    padding: 10px 14px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.jobs-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.jobs-table tbody tr:last-child {
    border-bottom: none;
}

.jobs-table tbody tr:hover {
    background: var(--surface2);
}

.jobs-table td {
    padding: 11px 14px;
    vertical-align: middle;
}

.td-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent3);
    font-weight: 500;
    white-space: nowrap;
}

.td-title {
    font-weight: 500;
    color: var(--text);
}

.td-title small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1px;
    font-family: 'JetBrains Mono', monospace;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-open {
    background: var(--accent3-soft);
    color: var(--accent3);
    border: 1px solid #bfd5ef;
}

.badge-progress {
    background: var(--accent2-soft);
    color: var(--accent2);
    border: 1px solid #f5dfa0;
}

.badge-resolved {
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid #b3dfc9;
}

.badge-pending {
    background: #f5f3ee;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-closed {
    background: #f0ede8;
    color: #7a6e65;
    border: 1px solid #ddd8d0;
}

.badge-critical {
    background: #fdf0ee;
    color: var(--accent);
    border: 1px solid #f0cdc9;
}

.badge-high {
    background: var(--accent2-soft);
    color: #a06200;
    border: 1px solid #f5dfa0;
}

.badge-medium {
    background: var(--accent3-soft);
    color: var(--accent3);
    border: 1px solid #bfd5ef;
}

.badge-low {
    background: #f5f3ee;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.badge-draft {
    background: #f0ede8;
    color: #7a6e65;
    border: 1px solid #ddd8d0;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state h4 {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* DETAIL PANEL */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 10, 0.3);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.detail-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.detail-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: 480px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    z-index: 401;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.detail-overlay.open .detail-panel {
    transform: translateX(0);
}

.detail-panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
    flex-shrink: 0;
}

.detail-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.detail-panel-header h3 {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 8px;
    line-height: 1.3;
}

.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.detail-panel-body {
    padding: 0 24px 24px;
    flex: 1;
    overflow-y: auto;
}

.detail-section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 16px 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.detail-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
}

.detail-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding-top: 3px;
}

.detail-val {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.detail-val.muted {
    color: var(--text-muted);
    font-style: italic;
}

/* STATS */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
}

.stat-card-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.stat-card-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.stat-card-val.red {
    color: var(--accent);
}

.stat-card-val.amber {
    color: var(--accent2);
}

.stat-card-val.green {
    color: var(--green);
}

.stat-card-val.blue {
    color: var(--accent3);
}

/* CONFIRM DIALOG */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 10, 0.5);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.confirm-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.confirm-box {
    background: var(--surface);
    border-radius: 12px;
    padding: 28px;
    max-width: 360px;
    width: 100%;
    margin: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.96);
    transition: transform 0.15s;
}

.confirm-overlay.open .confirm-box {
    transform: scale(1);
}

.confirm-box h4 {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    font-weight: normal;
    margin-bottom: 8px;
}

.confirm-box p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

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

/* TOAST */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1a1714;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 700;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success::before {
    content: '✓  ';
    color: #4ade80;
}

.toast.deleted::before {
    content: '✕  ';
    color: #f87171;
}

/* SPEC STYLES */
.kv-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    gap: 24px;
    align-items: start;
}

.kv-row:first-child {
    border-top: 1px solid var(--border);
}

.kv-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding-top: 2px;
}

.kv-val {
    color: var(--text);
    font-size: 14px;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: 13px;
}

.spec-table th {
    background: var(--surface2);
    padding: 10px 14px;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.spec-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table tbody tr:hover {
    background: var(--surface2);
}

.spec-table td:first-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent3);
    font-weight: 500;
}

.spec-table td.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-secondary);
}

.req-dot {
    color: var(--accent);
    font-weight: 700;
}

.progress-bar-wrap {
    background: var(--border);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
    transition: width 0.35s ease;
}

.progress-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.checklist-group {
    margin-bottom: 28px;
}

.checklist-group-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
    border: 1px solid transparent;
    margin-bottom: 3px;
    user-select: none;
}

.check-item:hover {
    background: var(--surface2);
    border-color: var(--border);
}

.check-item.checked {
    background: var(--surface2);
    opacity: 0.6;
}

.check-box {
    width: 17px;
    height: 17px;
    border-radius: 4px;
    border: 1.5px solid var(--border-strong);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: white;
}

.check-item.checked .check-box {
    background: var(--accent);
    border-color: var(--accent);
}

.check-tick {
    color: white;
    font-size: 10px;
    display: none;
}

.check-item.checked .check-tick {
    display: block;
}

.check-text {
    flex: 1;
    font-size: 13px;
}

.check-item.checked .check-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.priority-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.must {
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid #f0cdc9;
}

.should {
    color: var(--accent2);
    background: var(--accent2-soft);
    border: 1px solid #f5dfa0;
}

.could {
    color: var(--accent3);
    background: var(--accent3-soft);
    border: 1px solid #bfd5ef;
}

.q-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: box-shadow 0.15s;
}

.q-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.q-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    padding-top: 1px;
    flex-shrink: 0;
}

.q-text {
    color: var(--text);
    font-size: 13px;
    line-height: 1.6;
}

.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--accent2-soft);
    border: 1px solid #f5dfa0;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 13px;
    color: #7a5200;
}

.callout-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.col-preview {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 24px;
}

.col-preview-header {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.col-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 16px;
}

.col-tag {
    font-size: 12px;
    padding: 4px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.col-tag.key {
    background: var(--accent3-soft);
    border-color: #bfd5ef;
    color: var(--accent3);
}

.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.ov-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
}

.ov-stat-card-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.ov-stat-card-val {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 900px) {
    nav {
        width: 200px;
    }

    main {
        margin-left: 200px;
        padding: 28px 20px 60px;
    }

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

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

    .detail-panel {
        width: 100%;
    }
}

/* ── LOGIN SCREEN ── */
#login-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#login-box {
    width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.login-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent2);
    margin-bottom: 28px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.login-title {
    font-family: 'DM Serif Display', serif;
    font-size: 24px;
    font-weight: 400;
    color: var(--text);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.login-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.login-error {
    font-size: 13px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 18px;
    line-height: 1.5;
}

.login-error.login-success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.login-group {
    margin-bottom: 16px;
}

.login-group label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.login-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.login-group input:focus {
    border-color: var(--accent2);
    background: var(--surface);
}

.login-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent2);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}

.login-btn:hover { opacity: 0.88; }
.login-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.login-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 18px;
    margin-bottom: 0;
}

.login-switch a { color: var(--accent2); text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }

.header-signout {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
}

.header-signout:hover { text-decoration: underline; color: var(--accent); }

</style>