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

:root {
    --bg: #F8FAFC; /* Light gray base */
    --surface: #FFFFFF; /* Pure white card surface */
    --surface2: #F1F5F9; /* Alternate highlights / tab row */
    --surface3: #E2E8F0; /* Selected states / chip backs */
    --border: rgba(0, 173, 239, 0.16); /* Rich theme border */
    --border2: rgba(0, 173, 239, 0.35); /* Focus theme border */
    --text: #0F172A; /* Slate-900 for high readability */
    --muted: #475569; /* Slate-600 */
    --faint: #94A3B8; /* Slate-400 */
    --accent: #00ADEF; /* Theme Sky Blue Accent */
    --accent2: #008BC0; /* Darker Theme Blue */
    --accentbg: rgba(0, 173, 239, 0.08); /* Soft blue tint */
    --red: #DC2626;
    --redbg: rgba(220, 38, 38, 0.08);
    --redtext: #B91C1C;
    --yellow: #D97706;
    --yellowbg: rgba(217, 119, 6, 0.08);
    --yellowtext: #B45309;
    --green: #059669;
    --greenbg: rgba(5, 150, 105, 0.08);
    --greentext: #047857;
    --blue: #2563EB;
    --bluebg: rgba(37, 99, 235, 0.08);
    --bluetext: #1D4ED8;
    --purple: #7C3AED;
    --purplebg: rgba(124, 58, 237, 0.08);
    --purpletext: #6D28D9;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--faint);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Sidebar styling */
#sidebar {
    width: 240px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow: hidden;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.01);
}
#sidebar.collapsed {
    width: 68px;
    position: relative;
}
#sidebar.collapsed .sb-brand,
#sidebar.collapsed .sb-icon,
#sidebar.collapsed .nav-item span:not(.ni),
#sidebar.collapsed .nav-lbl,
#sidebar.collapsed .uinfo {
    display: none;
}
.logo-expanded {
    display: block;
}
.logo-collapsed {
    display: none;
}
#sidebar.collapsed .logo-expanded {
    display: none;
}
#sidebar.collapsed .logo-collapsed {
    display: block;
}
#sidebar.collapsed .sb-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 0;
    gap: 8px;
}
#sidebar.collapsed #sb-toggle {
    position: static;
    margin: 0 auto;
}
#sidebar.collapsed .user-card {
    padding: 8px 4px;
    justify-content: center;
}
#sidebar.collapsed nav {
    padding: 14px 4px;
}
#sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
}
.sb-logo {
    padding: 22px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.sb-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    color: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(181, 148, 16, 0.2);
}
.sb-brand .name {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 2px;
}
.sb-brand .sub {
    font-size: 9px;
    color: var(--accent);
    letter-spacing: 1.5px;
    margin-top: 2px;
}
#sb-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}
#sb-toggle:hover {
    color: var(--text);
    transform: scale(1.1);
}
nav {
    padding: 14px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.logout-btn {
    margin-top: auto;
    color: var(--redtext) !important;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}
.logout-btn:hover {
    background: var(--redbg) !important;
    color: var(--red) !important;
}
.nav-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent2);
    padding: 8px 10px 4px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0.8;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 4px;
    text-align: left;
    transition: all 0.2s;
    text-decoration: none;
}
.nav-item:hover {
    background: var(--surface2);
    color: var(--accent);
}
.nav-item.active {
    background: var(--accentbg);
    color: var(--accent2);
    font-weight: 600;
    border-left: 2px solid var(--accent);
}
.ni {
    flex-shrink: 0;
    width: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ni svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.sb-footer {
    padding: 14px;
    border-top: 1px solid var(--border);
}
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
}
.uavatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #FFFFFF;
    font-weight: 800;
    flex-shrink: 0;
}
.uinfo {
    min-width: 0;
}
.uinfo .uname {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uinfo .urole {
    font-size: 10px;
    color: var(--accent2);
    text-transform: capitalize;
}

/* Main Area */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}
#content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
#topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex-shrink: 0;
}
.tb-left h1 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}
.tb-left p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.tb-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    outline: none;
}
.btn-primary {
    background: var(--accent);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 173, 239, 0.15);
}
.btn-primary:hover {
    background: var(--accent2);
    box-shadow: 0 6px 16px rgba(0, 139, 192, 0.3);
    transform: translateY(-1px);
}
.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent2);
}
.btn-danger {
    background: var(--redbg);
    color: var(--red);
    border: 1px solid rgba(220, 38, 38, 0.15);
}
.btn-danger:hover {
    background: var(--red);
    color: #FFFFFF;
}
.btn-success {
    background: var(--greenbg);
    color: var(--green);
    border: 1px solid rgba(5, 150, 105, 0.15);
}
.btn-success:hover {
    background: var(--green);
    color: #FFFFFF;
}
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
}
.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent2);
}
.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 99px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.b-high { background: var(--redbg); color: var(--red); }
.b-medium { background: var(--yellowbg); color: var(--yellow); }
.b-low { background: var(--greenbg); color: var(--green); }
.b-inprogress { background: var(--bluebg); color: var(--blue); }
.b-planning { background: var(--purplebg); color: var(--purple); }
.b-onhold { background: var(--yellowbg); color: var(--yellow); }
.b-completed { background: var(--greenbg); color: var(--green); }
.b-pending { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.b-delivered { background: var(--greenbg); color: var(--green); }
.b-approved { background: var(--greenbg); color: var(--green); }
.b-rejected { background: var(--redbg); color: var(--red); }
.b-neutral { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.b-rev { background: var(--accentbg); color: var(--accent2); border: 1px solid var(--border); }

/* Progress */
.prog-wrap {
    background: var(--surface2);
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
    width: 100%;
}
.prog-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Priority dot */
.pdot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.pdot-high { background-color: var(--red); }
.pdot-medium { background-color: var(--yellow); }
.pdot-low { background-color: var(--green); }

/* Filters */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar select, .fbar-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 12px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.filter-bar select:focus, .fbar-input:focus {
    border-color: var(--accent);
}
.fsep {
    flex: 1;
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent2);
    letter-spacing: 0.5px;
}
.card-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--surface2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-row:last-child {
    border-bottom: none;
}

/* ── STAT CARDS ────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.stat::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.05;
    background: var(--accent);
}
.stat .ico {
    font-size: 20px;
    margin-bottom: 10px;
}
.stat .val {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.stat .lbl {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Table */
.tbl-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
thead tr {
    background: var(--surface2);
}
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}
td {
    padding: 12px 16px;
    border-top: 1px solid var(--surface2);
    vertical-align: middle;
    color: var(--text);
}
tbody tr {
    transition: background 0.15s;
}
tbody tr:hover {
    background: var(--surface2);
}
tr.od-row {
    background: var(--redbg);
}
td.od-cell {
    color: var(--red);
    font-weight: 600;
}
td select {
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    outline: none;
}
td select:focus {
    border-color: var(--accent);
}

/* Forms (Standard & Settings pages) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.fg-full {
    grid-column: 1 / -1;
}
.fg, .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.fg label, .form-group label {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent2);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.fg input, .fg select, .fg textarea,
.form-group input, .form-group select, .form-group textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: all 0.2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus,
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(0, 173, 239, 0.08);
}
.fg select option, .form-group select option {
    background: var(--surface);
}
.fg textarea, .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Projects grid */
.proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.proj-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left-width: 4px;
    border-left-style: solid;
    position: relative;
    box-shadow: var(--shadow);
}
.proj-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.pc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}
.pc-name {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.pc-meta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}
.pc-progress {
    margin: 14px 0 8px;
}
.pc-prog-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
    color: var(--muted);
}
.pc-prog-val {
    font-weight: 700;
    color: var(--text);
}
.pc-foot {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--surface2);
}

/* Detail Panel and tabs (fixing styling & alignment) */
#detail-panel {
    margin-top: 24px;
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
#detail-panel.show {
    display: block;
}
.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}
.dp-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent2);
}
.dp-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 20px 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.dtab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.18s;
    outline: none;
}
.dtab:hover {
    color: var(--accent);
}
.dtab.active {
    color: var(--accent2);
    border-bottom-color: var(--accent);
    background: var(--accentbg);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}
.dp-body {
    padding: 20px;
    background: var(--surface);
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Drawing Sheets pane & Revisions */
.drawing-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}
.drawing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
}
.drawing-header:hover {
    background: var(--surface3);
}
.drawing-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.drawing-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}
.drawing-body {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    display: none;
    background: var(--surface);
}
.drawing-body.open {
    display: block;
}
.rev-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.rev-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.rev-tag {
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--accentbg);
    color: var(--accent2);
    min-width: 38px;
    text-align: center;
}
.rev-tag.latest {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(181, 148, 16, 0.15);
}
.rev-info {
    flex: 1;
    min-width: 0;
}
.rev-fname {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rev-date {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.rev-note {
    font-size: 11px;
    color: var(--accent2);
    margin-top: 2px;
    font-style: italic;
}
.rev-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.file-thumb {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.thumb-pdf { background: var(--redbg); color: var(--red); }
.thumb-img { background: var(--bluebg); color: var(--blue); }
.thumb-dwg { background: var(--accentbg); color: var(--accent2); }
.thumb-doc { background: var(--greenbg); color: var(--green); }
.thumb-xls { background: var(--greenbg); color: var(--green); }
.thumb-other { background: var(--surface3); color: var(--muted); }

.upload-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
    background: var(--surface);
}
.upload-zone:hover, .upload-zone.drag {
    border-color: var(--accent);
    background: var(--accentbg);
}
.upload-zone p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}
.upload-zone .icon {
    font-size: 24px;
}

/* Modals */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4); /* Light overlay with blur */
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.overlay.open {
    display: flex;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
}
.modal-wide {
    max-width: 800px;
}
.mhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}
.mhead h2 {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent2);
    letter-spacing: 1px;
}
.mclose {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.2s;
    padding: 4px;
}
.mclose:hover {
    color: var(--accent);
}
.mbody {
    padding: 24px;
}

/* Pre-sheet templates checklist */
.tmpl-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow: auto;
    margin-bottom: 12px;
}
.tmpl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.tmpl-item input[type=checkbox] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.tmpl-item label {
    flex: 1;
    cursor: pointer;
    color: var(--text);
}
.tmpl-type {
    font-size: 11px;
    color: var(--muted);
}

/* Step Indicators (2-Step Project Creation) */
.step-indicator {
    display: flex;
    margin-bottom: 24px;
}
.step {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}
.step:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.step:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.step.active {
    background: var(--accentbg);
    border-color: var(--border2);
    color: var(--accent2);
}
.step.done {
    background: var(--greenbg);
    border-color: rgba(5, 150, 105, 0.2);
    color: var(--green);
}
.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--surface3);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-right: 6px;
    font-weight: 700;
}
.step.active .step-num {
    background: var(--accent);
    color: #FFFFFF;
}
.step.done .step-num {
    background: var(--green);
    color: #FFFFFF;
}

/* Chips */
.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
}
.chip-close {
    cursor: pointer;
    color: var(--faint);
    font-size: 11px;
    transition: color 0.15s;
}
.chip-close:hover {
    color: var(--red);
}

/* Toasts and notify */
.notif-wrap {
    position: relative;
}
.nbadge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #FFFFFF;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 2px solid var(--surface);
}

#notif-tray {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}
.toast {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 3px solid var(--accent);
    border-top: 1px solid var(--surface2);
    border-right: 1px solid var(--surface2);
    border-bottom: 1px solid var(--surface2);
}
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--yellow); }
.toast-title { font-size: 13px; font-weight: 700; color: var(--text); }
.toast-msg { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.toast-close { background: none; border: none; font-size: 14px; cursor: pointer; color: var(--faint); margin-left: auto; flex-shrink: 0; }
.toast-close:hover { color: var(--accent); }

.od-alert {
    background: var(--redbg);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
}

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty .eico { font-size: 32px; margin-bottom: 12px; }
.empty p { font-size: 13px; }

/* Responsive layout adjustments */
.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}
.three-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

@media(max-width: 900px) {
    #sidebar { width: 68px; }
    .sb-brand, .nav-item span:not(.ni), .uinfo { display: none; }
    .two-col, .three-col { grid-template-columns: 1fr; }
    .proj-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}
@media(max-width: 600px) {
    #content { padding: 14px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    #topbar {
        padding: 0 16px;
        height: 56px;
    }
    .tb-left h1 {
        font-size: 15px;
    }
    .tb-left p {
        display: none;
    }
}

/* Spinner & Loading State */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.spinner {
    border: 4px solid var(--surface2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* 2-Step Project Creation Wizard Styles */
.step-indicator {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}
.step {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}
.step:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.step:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.step.active {
    background: var(--accentbg);
    border-color: rgba(181, 148, 16, 0.35); /* Match Gold Accent */
    color: var(--accent);
}
.step.done {
    background: var(--greenbg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--green);
}
.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    margin-right: 6px;
    color: var(--surface);
}
.step-pane {
    display: none;
}
.step-pane.active {
    display: block;
}
