/* ─── Variables ─── */
:root {
    --bg-deep: #0a0a0f;
    --bg-card: rgba(18, 18, 28, 0.7);
    --bg-input: rgba(28, 28, 42, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f4f4f6;
    --text-secondary: #8b8b9e;
    --text-muted: #5a5a6e;
    --accent-cyan: #00d4aa;
    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
    --mobile-header-height: 56px;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 0%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 100%, rgba(0, 212, 170, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* ─── Loading Screen ─── */
.loading-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-deep);
}
.loading-content { text-align: center; }
.loading-title {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 3rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.loading-sub { color: var(--text-muted); font-size: 1rem; margin-bottom: 2rem; }
.spinner {
    width: 32px; height: 32px; margin: 0 auto 1rem;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-status { color: var(--text-secondary); font-size: 0.85rem; }

/* Page-level loading state — shown while page fetches its data */
.page-loader {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 40vh; gap: 0.75rem;
}
.page-loader .spinner { margin: 0; }
.page-loader-text { color: var(--text-muted); font-size: 0.9rem; }
.page-content.loading { display: none; }

/* ─── App Layout ─── */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width); min-height: 100vh;
    background: var(--bg-card);
    backdrop-filter: blur(40px);
    border-right: 1px solid var(--border-subtle);
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
}
.sidebar-header { padding: 1.5rem 1.5rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.sidebar-logo {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary);
}
.v2-badge {
    font-size: 0.65rem; font-weight: 600;
    background: var(--accent-cyan); color: var(--bg-deep);
    padding: 2px 6px; border-radius: 4px;
    vertical-align: super;
}
.nav-container { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-subtle); }
.user-info {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem; background: var(--bg-input); border-radius: var(--radius-md);
    font-size: 0.85rem; color: var(--text-primary); font-weight: 500;
    margin-bottom: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-feedback {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%; padding: 0.625rem 0.75rem;
    background: transparent; border: none;
    color: var(--text-muted); border-radius: 10px;
    font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease;
    font-family: inherit;
}
.btn-feedback:hover { background: var(--bg-input); color: var(--text-primary); }
.sidebar-footer-buttons { display: flex; flex-direction: column; gap: 0.25rem; }

/* ─── Simulate User ─── */
.btn-simulate {
    display: flex; align-items: center; gap: 0.5rem;
    width: 100%; padding: 0.625rem 0.75rem;
    background: transparent; border: none;
    color: var(--accent-purple); border-radius: 10px;
    font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease;
    font-family: inherit;
}
.btn-simulate:hover { background: rgba(139,92,246,0.12); }

.simulate-panel {
    display: none; flex-direction: column;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); margin-top: 0.5rem;
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.simulate-panel.open { display: flex; max-height: 400px; overflow: visible; }

.sim-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.625rem 0.75rem; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle);
}
.btn-sim-stop {
    background: rgba(239,68,68,0.15); color: var(--accent-red);
    border: none; border-radius: 6px; padding: 0.25rem 0.6rem;
    font-size: 0.7rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-sim-stop:hover { background: rgba(239,68,68,0.25); }

.sim-banner {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    padding: 0.5rem 0.75rem; font-size: 0.75rem;
    background: rgba(139,92,246,0.1); color: var(--accent-purple);
    border-bottom: 1px solid var(--border-subtle);
}
.sim-banner strong { color: var(--text-primary); }

.sim-search {
    margin: 0.5rem 0.75rem; padding: 0.4rem 0.6rem;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: 6px; color: var(--text-primary); font-size: 0.78rem;
    font-family: inherit; outline: none;
}
.sim-search:focus { border-color: var(--accent-purple); }

.sim-user-list {
    max-height: 240px; overflow-y: auto; padding: 0 0.5rem 0.5rem;
}
.sim-user-item {
    padding: 0.5rem 0.6rem; border-radius: 8px; cursor: pointer;
    transition: background 0.15s;
}
.sim-user-item:hover { background: var(--bg-input); }
.sim-user-item.active { background: rgba(139,92,246,0.15); border-left: 2px solid var(--accent-purple); }
.sim-user-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.sim-user-roles { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ─── Navigation ─── */
.nav-section { margin-bottom: 1.5rem; }
.nav-section-label {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--text-muted);
    padding: 0.85rem 1.5rem 0.5rem;
    margin: 0.75rem 0.5rem 0;
    border-top: 1px solid var(--border-subtle);
}
.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 1rem; margin: 0.25rem 0.5rem;
    border-radius: var(--radius-md); cursor: pointer;
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s ease; text-decoration: none;
}
.nav-item:hover { background: var(--bg-input); color: var(--text-primary); transform: translateX(4px); }
.nav-item.active { background: rgba(0, 212, 170, 0.1); color: var(--accent-cyan); }
.nav-item svg { width: 20px; height: 20px; opacity: 0.7; flex-shrink: 0; transition: transform 0.2s ease; }
.nav-item:hover svg { transform: scale(1.1); }
.nav-item.active svg { opacity: 1; }
.nav-expandable-label {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.875rem 1rem; margin: 0.25rem 0.5rem;
    border-radius: var(--radius-md); cursor: pointer;
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
    transition: all 0.2s ease;
}
.nav-expandable-label:hover { background: var(--bg-input); color: var(--text-primary); }
.nav-expandable-label .chevron { transition: transform 0.2s ease; font-size: 1.2rem; }
.nav-expandable-label.open .chevron { transform: rotate(90deg); }
.nav-submenu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.nav-submenu.open { max-height: 500px; }
.nav-submenu .nav-item { padding-left: 2.5rem; font-size: 0.85rem; }

/* ─── Main Content ─── */
.main {
    flex: 1; margin-left: var(--sidebar-width);
    padding: 2rem; min-height: 100vh;
    overflow-x: hidden; overflow-y: auto;
}
.page-container { margin: 0 auto; position: relative; }

/* ─── Page Module Content ─── */
.page-header { margin-bottom: 2rem; }
.page-title {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}
.page-desc { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.9rem; }

/* ─── Cards ─── */
.card {
    background: rgba(18, 18, 28, 0.95);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    padding: 1.5rem; margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }
.card-title {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-weight: 700; margin-bottom: 1rem; font-size: 1rem;
}

/* ─── Stats Grid ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--bg-card); backdrop-filter: blur(40px);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
    padding: 1.25rem; text-align: center;
    transition: all 0.3s ease;
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); }
.stat-value {
    font-family: 'Cabinet Grotesk', sans-serif;
    font-size: 1.75rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ─── Table Tools ─── */
.table-tools { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 400px; }
.search-box input, .search-box-input {
    width: 100%; padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: 8px; color: var(--text-primary); font-size: 0.875rem;
    font-family: inherit; outline: none; transition: border-color 0.15s;
}
.search-box input:focus, .search-box-input:focus { border-color: var(--accent-cyan); }
.search-box input::placeholder, .search-box-input::placeholder { color: var(--text-muted); }
.search-box svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.result-count, .table-info { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ─── Filter Button ─── */
.filter-btn {
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: 6px; padding: 0.5rem 0.75rem; color: var(--text-secondary);
    font-size: 0.8rem; cursor: pointer; display: flex; align-items: center;
    gap: 0.5rem; transition: all 0.2s ease; font-family: inherit; white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent-cyan); color: var(--text-primary); }
.filter-btn.active { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.filter-btn.select-all-btn { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.filter-btn.select-all-btn:hover { border-color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.filter-btn.deselect-all-btn { color: #f87171; border-color: rgba(248, 113, 113, 0.3); }
.filter-btn.deselect-all-btn:hover { border-color: #f87171; background: rgba(248, 113, 113, 0.1); }
.filter-select {
    padding: 0.5rem 0.75rem; background: var(--bg-input);
    border: 1px solid var(--border-subtle); border-radius: 6px;
    color: var(--text-secondary); font-size: 0.8rem; font-family: inherit;
    outline: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--accent-cyan); }
.filter-select option { background: var(--bg-deep); }

/* ─── Filter Dropdown ─── */
.filter-dropdown { position: relative; }
.filter-menu {
    position: absolute; top: 100%; left: 0; margin-top: 0.5rem;
    background: #12121c; border: 1px solid var(--border-subtle);
    border-radius: 8px; min-width: 180px; z-index: 100;
    display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.filter-menu.open { display: block; }
.filter-option { padding: 0.625rem 1rem; cursor: pointer; font-size: 0.85rem; color: var(--text-secondary); }
.filter-option:hover { background: var(--bg-input); color: var(--text-primary); }
.filter-option.selected { color: var(--accent-cyan); }
.filter-option:first-child { border-radius: 8px 8px 0 0; }
.filter-option:last-child { border-radius: 0 0 8px 8px; }

/* ─── Active Filters Bar ─── */
.active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; align-items: center; }
.filter-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(0, 212, 170, 0.15); border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 20px; font-size: 0.75rem; color: var(--accent-cyan);
}
.filter-tag-remove { cursor: pointer; opacity: 0.7; font-size: 1rem; line-height: 1; }
.filter-tag-remove:hover { opacity: 1; }
.filter-clear-all {
    padding: 0.35rem 0.75rem; background: transparent;
    border: 1px solid var(--border-subtle); border-radius: 20px;
    font-size: 0.75rem; color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.filter-clear-all:hover { border-color: var(--text-muted); color: var(--text-secondary); }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.extras-hidden .col-extra { display: none; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 3px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: max-content; }
thead { background: var(--bg-card); }
th {
    padding: 0.75rem 0.75rem; text-align: left; font-weight: 600;
    color: var(--text-muted); font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap; user-select: none;
    position: sticky; top: 0; background: var(--bg-card);
}
th .th-content { cursor: pointer; }
th .th-content:hover { color: var(--text-primary); }
th .sort-arrow { margin-left: 4px; font-size: 0.65rem; color: var(--accent-cyan); }
td {
    padding: 0.75rem 0.75rem; border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
/* Sticky first column */
th:first-child, td:first-child { position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
tr:hover td:first-child { background: rgba(18, 18, 28, 0.95); }
.badge {
    display: inline-block; padding: 0.25rem 0.625rem; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-active { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge-inactive { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-terminated { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ─── Column Filter ─── */
.col-filter-wrap { display: inline-block; vertical-align: middle; position: relative; }
.col-filter-icon {
    cursor: pointer; margin-left: 0.25rem; opacity: 0.4;
    transition: all 0.2s ease; display: inline-flex; vertical-align: middle;
}
.col-filter-icon:hover { opacity: 1; color: var(--accent-cyan); }
.col-filter-icon.active { opacity: 1; color: var(--accent-cyan); }
.col-filter-dropdown {
    position: fixed; min-width: 220px; max-width: 280px;
    background: #12121c; border: 1px solid var(--border-subtle);
    border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); z-index: 9000;
}
.col-filter-header {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
}
.col-filter-search { padding: 0.5rem; border-bottom: 1px solid var(--border-subtle); }
.col-filter-search input, .col-filter-search-input {
    width: 100%; padding: 0.5rem 0.75rem;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: 6px; color: var(--text-primary); font-size: 0.8rem;
    font-family: inherit; outline: none;
}
.col-filter-search input:focus, .col-filter-search-input:focus { border-color: var(--accent-cyan); }
.col-filter-options { max-height: 200px; overflow-y: auto; padding: 0.5rem 0; }
.col-filter-option {
    display: flex; align-items: center; padding: 0.5rem 1rem;
    cursor: pointer; font-size: 0.85rem; color: var(--text-secondary);
    transition: all 0.15s ease; gap: 0.5rem;
}
.col-filter-option:hover { background: var(--bg-input); color: var(--text-primary); }
.col-filter-option input[type="checkbox"] { accent-color: var(--accent-cyan); flex-shrink: 0; }
.col-filter-actions {
    padding: 0.75rem; border-top: 1px solid var(--border-subtle);
    display: flex; gap: 0.5rem; justify-content: flex-end;
}
.col-filter-actions button {
    padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.75rem;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}
.col-filter-actions .apply-btn { background: var(--accent-cyan); color: var(--bg-deep); border: none; font-weight: 600; }
.col-filter-actions .apply-btn:hover { opacity: 0.9; }
.col-filter-actions .clear-btn { background: transparent; color: var(--text-muted); border: 1px solid var(--border-subtle); }
.col-filter-actions .clear-btn:hover { border-color: var(--text-muted); color: var(--text-secondary); }

/* ─── Action Menu ─── */
.action-cell { position: relative; }
.action-btn {
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: 6px; padding: 0.4rem 0.75rem; color: var(--text-secondary);
    font-size: 0.75rem; cursor: pointer; display: flex; align-items: center;
    gap: 0.4rem; transition: all 0.2s ease; font-family: inherit;
}
.action-btn:hover { border-color: var(--accent-cyan); color: var(--text-primary); }
.action-btn svg { width: 14px; height: 14px; }
.action-menu {
    position: fixed; background: #12121c; border: 1px solid var(--border-subtle);
    border-radius: 8px; min-width: 200px; z-index: 1000;
    display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.5); overflow: hidden;
}
.action-menu.open { display: block; }
.action-menu-item {
    padding: 0.75rem 1rem; cursor: pointer; font-size: 0.85rem;
    color: var(--text-secondary); display: flex; align-items: center;
    gap: 0.75rem; transition: all 0.15s ease;
}
.action-menu-item:hover { background: var(--bg-input); color: var(--text-primary); }
.action-menu-item svg { width: 16px; height: 16px; opacity: 0.7; }
.action-menu-item:hover svg { opacity: 1; }
.action-menu-divider { height: 1px; background: var(--border-subtle); margin: 0.25rem 0; }
/* SR Users inline counts */
.sr-counts {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.8rem; font-weight: 600; padding: 0.25rem 0;
}
.sr-count {
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: 8px; padding: 0.35rem 0.7rem;
}
.sr-count-sep { color: var(--border-subtle); font-weight: 300; }

/* Birthday banner */
.spr-birthday-banner {
    background: linear-gradient(135deg, rgba(255,200,50,0.12), rgba(255,140,50,0.10));
    border: 1px solid rgba(255,180,50,0.25);
    border-radius: 12px; padding: 0.75rem 1.25rem;
    font-size: 0.9rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.spr-birthday-icon { font-size: 1.3rem; }
.spr-birthday-name { font-weight: 600; }

.action-menu-header {
    padding: 0.75rem 1rem; font-weight: 600; color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
    border: none; transition: all 0.15s; font-family: inherit;
}
.btn-primary { background: var(--accent-cyan); color: var(--bg-deep); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ─── Forms ─── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.25rem; }
.form-input, .form-textarea, .form-select {
    width: 100%; padding: 0.5rem 0.75rem;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.85rem; outline: none; transition: border-color 0.15s;
    font-family: inherit;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent-cyan); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ─── Welcome Grid ─── */
.welcome-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.welcome-section {
    background: var(--bg-card); backdrop-filter: blur(40px);
    border: 1px solid var(--border-subtle); border-radius: 16px;
    padding: 1.5rem;
}
.welcome-section-header {
    display: flex; align-items: center; gap: 0.6rem;
    font-family: 'Cabinet Grotesk', sans-serif; font-size: 1rem; font-weight: 700;
    color: var(--text-primary); margin-bottom: 1rem;
}
.welcome-section-header svg { width: 20px; height: 20px; color: var(--accent-cyan); flex-shrink: 0; }
.welcome-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; }
.welcome-page-btn {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 0.9rem; border-radius: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    cursor: pointer; transition: all 0.2s ease;
    font-size: 0.85rem; color: var(--text-primary);
}
.welcome-page-btn:hover {
    border-color: var(--accent-cyan); background: rgba(0, 207, 253, 0.06);
    transform: translateY(-1px);
}
.welcome-page-btn svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.welcome-page-btn:hover svg { color: var(--accent-cyan); }

/* ─── Role Badge ─── */
.role-badge {
    display: inline-block; padding: 0.25rem 0.625rem; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
    background: rgba(255, 255, 255, 0.08); color: var(--text-secondary);
}
.status-aktiv { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.status-innaktiv { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* ─── Modal ─── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-content {
    position: relative; z-index: 1; width: 90%; max-width: 480px;
    background: #12121c; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg); padding: 1.5rem;
    max-height: 90vh; overflow-y: auto;
}
.modal-content h3 { font-family: 'Cabinet Grotesk', sans-serif; margin-bottom: 1rem; }
.modal-content select, .modal-content textarea {
    width: 100%; padding: 0.5rem; margin-bottom: 0.75rem;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: inherit; font-size: 0.85rem; outline: none;
}
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ─── Toast ─── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
    padding: 0.75rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; animation: toastIn 0.3s ease;
    max-width: 350px;
}
.toast-success { background: rgba(0,212,170,0.15); border: 1px solid rgba(0,212,170,0.3); color: var(--accent-cyan); }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--accent-red); }
.toast-info { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.3); color: var(--accent-purple); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ─── Mobile ─── */
.mobile-header {
    display: none; position: fixed; top: 0; left: 0; right: 0;
    height: var(--mobile-header-height);
    background: var(--bg-card); backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1rem; align-items: center; gap: 0.75rem; z-index: 99;
}
.btn-menu { background: none; border: none; color: var(--text-primary); cursor: pointer; }
.mobile-logo { font-family: 'Cabinet Grotesk', sans-serif; font-weight: 700; font-size: 1rem; color: var(--text-primary); }

/* ─── Sortable Header ─── */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--accent-cyan); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* ─── Image Upload ─── */
.image-upload-area { border: 2px dashed var(--border-subtle); border-radius: 8px; padding: 1.5rem; text-align: center; cursor: pointer; transition: all 0.2s ease; background: var(--bg-input); }
.image-upload-area:hover { border-color: var(--accent-cyan); background: rgba(0, 212, 170, 0.05); }
.image-upload-area.dragover { border-color: var(--accent-cyan); background: rgba(0, 212, 170, 0.1); }
.image-upload-area.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.image-upload-area svg { margin-bottom: 0.5rem; color: var(--text-muted); }
.image-upload-area p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.image-upload-area .hint { font-size: 0.7rem; margin-top: 0.25rem; }
.image-preview-container { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.image-preview { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-subtle); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview-remove { position: absolute; top: 4px; right: 4px; background: rgba(239, 68, 68, 0.9); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.7rem; line-height: 1; }
.image-preview-remove:hover { background: rgb(220, 38, 38); }

/* ─── Announcement Layout ─── */
.announcement-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; height: calc(100vh - 180px); }
.announcement-recipients { overflow-y: auto; display: flex; flex-direction: column; }
.announcement-recipients .search-box { flex: 0 0 auto; max-width: none; }

/* Announcement Message Type Toggle */
.msg-type-toggle { display: flex; border: 1px solid var(--border-subtle); border-radius: 12px; overflow: hidden; margin-bottom: 1.25rem; }
.msg-type-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1rem; background: transparent; border: none; color: var(--text-secondary); font-family: 'Satoshi', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.msg-type-btn:first-child { border-right: 1px solid var(--border-subtle); }
.msg-type-btn.active { background: var(--accent-cyan); color: var(--bg-deep); }
.msg-type-btn:hover:not(.active) { background: rgba(255,255,255,0.03); }
.msg-type-btn svg { width: 16px; height: 16px; }

/* Announcement Send Button */
.ann-send-btn { width: 100%; padding: 0.875rem 1.5rem; background: linear-gradient(135deg, var(--accent-cyan) 0%, #00b894 100%); color: var(--bg-deep); border: none; border-radius: 12px; font-family: 'Satoshi', sans-serif; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: all 0.3s ease; margin-top: 0.5rem; }
.ann-send-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3); }

/* ─── Contract Link ─── */
.contract-link-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--accent-cyan); background: rgba(0,212,170,0.08); border: 1px solid rgba(0,212,170,0.2); border-radius: 6px; text-decoration: none; white-space: nowrap; transition: all 0.15s; }
.contract-link-btn:hover { background: rgba(0,212,170,0.15); border-color: var(--accent-cyan); }
.contract-edit-btn { cursor: pointer; opacity: 0.3; transition: opacity 0.15s; }
.contract-edit-btn:hover { opacity: 0.8; color: var(--accent-cyan); }

/* ─── Editable Cells ─── */
.th-editable .th-content { color: var(--accent-cyan); opacity: 0.8; }
.editable-cell { cursor: pointer; transition: color 0.15s; }
.editable-cell:hover { color: var(--accent-cyan); }
.editable-date-input { padding: 0.25rem 0.4rem; background: var(--bg-input); border: 1px solid var(--accent-cyan); border-radius: 4px; color: var(--text-primary); font-size: 0.8rem; font-family: inherit; outline: none; width: 120px; }

/* ─── Text Edit Popup ─── */
.text-edit-popup { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.text-edit-popup-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.text-edit-popup-box { position: relative; background: #12121c; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.25rem; width: 400px; max-width: 90vw; box-shadow: 0 16px 48px rgba(0,0,0,0.6); }
.text-edit-popup-header { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.text-edit-popup-input { width: 100%; min-height: 120px; padding: 0.75rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; color: var(--text-primary); font-family: inherit; font-size: 0.85rem; resize: vertical; outline: none; }
.text-edit-popup-input:focus { border-color: var(--accent-cyan); }
.text-edit-popup-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; }

/* ─── Char Counter ─── */
.char-counter { font-size: 0.75rem; color: var(--text-muted); text-align: right; margin-top: 0.25rem; }

/* ─── Activity Layout ─── */
.activity-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; overflow: hidden; }
.activity-columns > .card { overflow: hidden; min-width: 0; }
@media (max-width: 1100px) { .activity-columns { grid-template-columns: 1fr; } }

/* ─── Hourly Activity Chart ─── */
.hourly-chart { display: flex; flex-direction: column; gap: 0.25rem; }
.hourly-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 0 2px; }
.hourly-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.hourly-bar { width: 100%; min-width: 8px; background: linear-gradient(180deg, var(--accent-cyan), rgba(0, 212, 170, 0.3)); border-radius: 3px 3px 0 0; transition: height 0.4s ease; }
.hourly-bar-col:hover .hourly-bar { background: linear-gradient(180deg, var(--accent-cyan), rgba(0, 212, 170, 0.6)); }
.hourly-bar-val { font-size: 0.6rem; color: var(--text-muted); margin-top: 2px; min-height: 12px; }
.hourly-labels { display: flex; gap: 3px; padding: 0 2px; }
.hourly-label { flex: 1; text-align: center; font-size: 0.6rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ─── Activity Matrix ─── */
.matrix-scroll { overflow-x: auto; overflow-y: auto; max-height: 420px; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.matrix-scroll::-webkit-scrollbar { height: 4px; width: 4px; }
.matrix-scroll::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 2px; }
.matrix-scroll::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }
.matrix-hint { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; display: none; }
.activity-matrix { width: 100%; border-collapse: collapse; }
.activity-matrix th, .activity-matrix td { padding: 0.45rem 0.4rem; text-align: center; font-size: 0.85rem; }
.activity-matrix th { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; letter-spacing: 0.03em; position: sticky; top: 0; background: var(--bg-card); z-index: 2; }
.activity-matrix th:first-child, .activity-matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-card); z-index: 3; }
.activity-matrix td:first-child { cursor: pointer; transition: color 0.2s ease; font-size: 0.85rem; }
.activity-matrix td:first-child:hover { color: var(--accent-cyan); }
.activity-matrix tr.active-seller td:first-child { color: var(--accent-cyan); font-weight: 700; }
.activity-matrix .matrix-icon { width: 18px; height: 18px; vertical-align: middle; }
.activity-matrix .matrix-total { font-weight: 700; color: var(--accent-cyan); }

/* ─── Activity Filter ─── */
.activity-filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.activity-filter-btn { padding: 0.5rem 1rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 100px; color: var(--text-secondary); font-family: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.activity-filter-btn:hover { border-color: var(--border-hover); color: var(--text-primary); transform: translateY(-1px); }
.activity-filter-btn:active { transform: translateY(0); }
.activity-filter-btn.active { background: var(--accent-cyan); border-color: var(--accent-cyan); color: var(--bg-deep); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3); }
.activity-refresh-btn { padding: 0.5rem 0.75rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 100px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s ease; margin-left: auto; display: flex; align-items: center; justify-content: center; }
.activity-refresh-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); background: rgba(0, 212, 170, 0.1); }
.activity-refresh-btn.loading svg { animation: spin 1s linear infinite; }
.activity-refresh-btn svg { width: 18px; height: 18px; }

/* ─── Event Feed ─── */
.event-feed-scroll { overflow-y: auto; max-height: 520px; }
.event-feed-scroll::-webkit-scrollbar { width: 4px; }
.event-feed-scroll::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 2px; }
.event-feed-scroll::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }
.event-feed { list-style: none; padding: 0; margin: 0; }
.event-item { display: flex; align-items: center; justify-content: space-between; padding: 0.625rem 0; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.15s; }
.event-item:hover { background: rgba(255,255,255,0.02); }
.event-item:last-child { border-bottom: none; }
.event-left { display: flex; align-items: center; gap: 0.625rem; }
.event-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-input); flex-shrink: 0; }
.event-icon img { width: 22px; height: 22px; }
.event-status { font-weight: 600; font-size: 0.875rem; }
.event-seller { color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.1rem; }
.event-time { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; white-space: nowrap; }

/* ─── SR Seller Filter Banner ─── */
.sr-seller-filter-info { display: none; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.sr-seller-filter-info.visible { display: flex; }
.sr-seller-filter-top { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: rgba(0, 212, 170, 0.08); border: 1px solid rgba(0, 212, 170, 0.25); border-radius: 10px; font-size: 0.85rem; }
.sr-seller-filter-top .sr-seller-name { color: var(--accent-cyan); font-weight: 700; font-size: 1rem; }
.sr-seller-filter-top .sr-seller-period { color: var(--text-muted); font-size: 0.8rem; }
.sr-seller-filter-top .sr-seller-clear { background: rgba(0, 212, 170, 0.15); border: 1px solid rgba(0, 212, 170, 0.3); color: var(--accent-cyan); border-radius: 6px; padding: 0.3rem 0.75rem; cursor: pointer; font-size: 0.8rem; transition: all 0.2s ease; margin-left: auto; }
.sr-seller-filter-top .sr-seller-clear:hover { background: rgba(0, 212, 170, 0.25); }
.sr-seller-time-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.sr-seller-time-box { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0.875rem 1rem; text-align: center; }
.sr-seller-time-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.35rem; font-weight: 600; }
.sr-seller-time-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
/* Show more button */
.sr-show-more-btn { display: block; width: 100%; padding: 0.75rem; margin-top: 0.5rem; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary); border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: all 0.2s ease; text-align: center; font-family: inherit; }
.sr-show-more-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }

/* ─── SR Active Filter Banner (used by sr-project map filter) ─── */
.sr-active-filter { display: none; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: rgba(0,212,170,0.1); border: 1px solid rgba(0,212,170,0.3); border-radius: 8px; margin-bottom: 1rem; font-size: 0.85rem; color: var(--accent-cyan); }
.sr-active-filter.visible { display: flex; }
.sr-active-filter-text { flex: 1; }
.sr-clear-filter-btn { background: rgba(0,212,170,0.15); border: 1px solid rgba(0,212,170,0.3); color: var(--accent-cyan); border-radius: 6px; padding: 0.3rem 0.75rem; cursor: pointer; font-size: 0.8rem; transition: all 0.2s ease; font-family: inherit; }
.sr-clear-filter-btn:hover { background: rgba(0,212,170,0.25); }

/* ─── Onboarding ─── */
.onboarding-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.onboarding-form-col { min-width: 0; }
.onboarding-sidebar { position: sticky; top: 2rem; }
.onboarding-sidebar-card { background: var(--bg-card); backdrop-filter: blur(40px); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 1.25rem; }
.onboarding-sidebar-title { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.onboarding-sidebar-progress { height: 4px; background: var(--bg-input); border-radius: 2px; margin-bottom: 1.25rem; overflow: hidden; }
.onboarding-sidebar-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple)); border-radius: 2px; transition: width 0.4s ease; }
.onboarding-sidebar-fields { display: flex; flex-direction: column; gap: 0.125rem; }
.onboarding-summary-row { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); gap: 0.75rem; }
.onboarding-summary-row:last-child { border-bottom: none; }
.onboarding-summary-label { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.onboarding-summary-value { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboarding-summary-value.empty { color: var(--text-muted); font-style: italic; font-weight: 400; }
.onboarding-summary-section { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-cyan); padding: 0.625rem 0 0.25rem; }
.onboarding-summary-empty { font-size: 0.85rem; color: var(--text-muted); text-align: center; padding: 1.5rem 0; }
.onboarding-main-card { background: var(--bg-card); backdrop-filter: blur(40px); border: 1px solid var(--border-subtle); border-radius: 24px; overflow: hidden; }
.onboarding-main-card.locked { opacity: 0.5; pointer-events: none; user-select: none; }
.onboarding-section { padding: 2rem; border-bottom: 1px solid var(--border-subtle); }
.onboarding-section:last-of-type { border-bottom: none; }
.onboarding-section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.onboarding-section-number { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%); border-radius: 8px; font-size: 0.8rem; font-weight: 700; color: var(--bg-deep); }
.onboarding-section-title { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; }
.onboarding-parse-section { background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(0, 212, 170, 0.05) 100%); }
.onboarding-contract-section { background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(0, 212, 170, 0.05) 100%); }
.onboarding-contract-section.disabled { opacity: 0.5; pointer-events: none; }
.onboarding-contract-section.disabled::after { content: 'Fyll inn personlig informasjon først'; display: block; margin-top: 1rem; padding: 0.75rem 1rem; background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 10px; font-size: 0.85rem; color: var(--accent-purple); text-align: center; }

/* Onboarding Form */
.onboarding-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.onboarding-form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.onboarding-full-width { grid-column: 1 / -1; }
.onboarding-form-label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; }
.onboarding-required { color: #ec4899; }
.onboarding-form-input, .onboarding-form-select { width: 100%; padding: 0.875rem 1rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 12px; color: var(--text-primary); font-family: 'Satoshi', sans-serif; font-size: 0.95rem; transition: all 0.3s ease; }
.onboarding-form-input:focus, .onboarding-form-select:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.2); }
.onboarding-form-input.error, .onboarding-form-select.error { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
.onboarding-form-input.warning { border-color: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
.onboarding-email-error { font-size: 0.8rem; color: #ef4444; min-height: 1.2em; display: block; }
.onboarding-form-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238b8b9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.onboarding-form-select option { background: var(--bg-deep); color: var(--text-primary); }
.onboarding-textarea { width: 100%; min-height: 140px; padding: 1.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 16px; color: var(--text-primary); font-family: 'Satoshi', sans-serif; font-size: 0.95rem; resize: vertical; transition: all 0.3s ease; }
.onboarding-textarea:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.2); }
.onboarding-textarea::placeholder { color: var(--text-muted); }
.onboarding-parse-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }

/* Onboarding Phone */
.onboarding-phone-group { display: flex; gap: 0.5rem; }
.onboarding-country-code { width: 100px; flex-shrink: 0; }

/* Onboarding Buttons */
.onboarding-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.5rem; border: none; border-radius: 12px; font-family: 'Satoshi', sans-serif; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; }
.onboarding-btn-primary { background: linear-gradient(135deg, var(--accent-cyan) 0%, #00b894 100%); color: var(--bg-deep); }
.onboarding-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3); }
.onboarding-btn-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: var(--bg-deep); }
.onboarding-btn-warning:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); }
.onboarding-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.onboarding-btn .onboarding-spinner-small { width: 18px; height: 18px; border: 2px solid rgba(0,0,0,0.2); border-top-color: currentColor; border-radius: 50%; animation: spin 0.8s linear infinite; }
.onboarding-reset-btn { padding: 0.5rem 1.25rem; background: transparent; border: 1px solid var(--border-subtle); border-radius: 10px; color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.4rem; }
.onboarding-reset-btn:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.onboarding-reset-btn svg { width: 16px; height: 16px; }

/* Onboarding Team Pills */
.onboarding-team-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.onboarding-team-pill { padding: 0.625rem 1.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 100px; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: all 0.3s ease; font-family: inherit; color: var(--text-secondary); }
.onboarding-team-pill:hover { border-color: var(--border-hover); }
.onboarding-team-pill.selected { background: var(--accent-cyan); border-color: var(--accent-cyan); color: var(--bg-deep); }
.onboarding-custom-pill { border-style: dashed; }
.onboarding-custom-pill.selected { border-style: solid; }

/* Onboarding Project Cards */
.onboarding-projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.onboarding-project-card { position: relative; padding: 1.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 16px; cursor: pointer; transition: all 0.3s ease; }
.onboarding-project-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.onboarding-project-card.selected { border-color: var(--accent-cyan); background: rgba(0, 212, 170, 0.08); }
.onboarding-project-header { display: flex; align-items: center; justify-content: space-between; }
.onboarding-project-name { font-weight: 600; font-size: 1rem; }
.onboarding-project-check { width: 22px; height: 22px; border: 2px solid var(--border-subtle); border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.onboarding-project-card.selected .onboarding-project-check { background: var(--accent-cyan); border-color: var(--accent-cyan); }
.onboarding-project-check svg { width: 14px; height: 14px; stroke: var(--bg-deep); stroke-width: 3; opacity: 0; transform: scale(0.5); transition: all 0.2s ease; }
.onboarding-project-card.selected .onboarding-project-check svg { opacity: 1; transform: scale(1); }
.onboarding-project-role { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); display: none; }
.onboarding-project-card.selected .onboarding-project-role { display: block; }
.onboarding-project-role-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; display: block; }
.onboarding-project-role .onboarding-form-select { padding: 0.625rem 0.875rem; font-size: 0.85rem; }

/* Onboarding Submit */
.onboarding-submit-section { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2rem; background: linear-gradient(180deg, transparent 0%, rgba(0, 212, 170, 0.03) 100%); }
.onboarding-btn-submit { width: 100%; max-width: 400px; padding: 1.125rem 2rem; font-size: 1rem; justify-content: center; }
.onboarding-submit-hint { font-size: 0.8rem; color: var(--text-muted); }

/* Onboarding Contract */
.onboarding-contract-box { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 16px; cursor: pointer; transition: all 0.3s ease; }
.onboarding-contract-box:hover { border-color: var(--border-hover); }
.onboarding-contract-box.checking { border-color: var(--accent-purple); background: rgba(139, 92, 246, 0.1); cursor: wait; }
.onboarding-contract-box.verified { border-color: var(--accent-cyan); background: rgba(0, 212, 170, 0.1); cursor: default; }
.onboarding-contract-box.failed { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); cursor: default; }
.onboarding-contract-checkbox { width: 24px; height: 24px; border: 2px solid var(--text-muted); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.3s ease; }
.onboarding-contract-box.verified .onboarding-contract-checkbox { background: var(--accent-cyan); border-color: var(--accent-cyan); }
.onboarding-contract-box.failed .onboarding-contract-checkbox { background: #ef4444; border-color: #ef4444; }
.onboarding-contract-checkbox svg { width: 14px; height: 14px; stroke: var(--bg-deep); stroke-width: 3; opacity: 0; transition: all 0.2s ease; }
.onboarding-contract-box.verified .onboarding-check-icon { opacity: 1; }
.onboarding-contract-box.failed .onboarding-x-icon { opacity: 1; }
.onboarding-contract-spinner { width: 24px; height: 24px; border: 2px solid var(--border-subtle); border-top-color: var(--accent-purple); border-radius: 50%; animation: spin 0.8s linear infinite; display: none; }
.onboarding-contract-box.checking .onboarding-contract-spinner { display: block; }
.onboarding-contract-box.checking .onboarding-contract-checkbox { display: none; }
.onboarding-contract-content { flex: 1; }
.onboarding-contract-title { font-weight: 600; margin-bottom: 0.25rem; }
.onboarding-contract-desc { font-size: 0.85rem; color: var(--text-muted); }
.onboarding-contract-result { margin-top: 1.25rem; padding: 1.25rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 16px; display: none; }
.onboarding-contract-result.show { display: block; }
.onboarding-contract-result.success { border-color: rgba(0, 212, 170, 0.3); background: rgba(0, 212, 170, 0.05); }
.onboarding-contract-result.error { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.05); }
.onboarding-contract-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.onboarding-contract-info-item { padding: 0.75rem; background: rgba(0, 0, 0, 0.2); border-radius: 10px; }
.onboarding-contract-info-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.onboarding-contract-info-value { font-weight: 600; color: var(--text-primary); }

/* Onboarding Employment */
.onboarding-employment-display { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: rgba(0, 212, 170, 0.1); border: 1px solid rgba(0, 212, 170, 0.3); border-radius: 12px; margin-top: 1rem; }
.onboarding-employment-icon { width: 40px; height: 40px; background: var(--accent-cyan); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--bg-deep); }
.onboarding-employment-icon svg { width: 20px; height: 20px; }
.onboarding-unknown-employment { margin-top: 1rem; padding: 1.25rem; background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.3); border-radius: 16px; display: none; }
.onboarding-unknown-employment.show { display: block; }
.onboarding-manual-override { margin-top: 1.25rem; padding: 1.25rem; background: rgba(245, 158, 11, 0.1); border: 1px dashed rgba(245, 158, 11, 0.4); border-radius: 16px; display: none; }
.onboarding-manual-override.show { display: block; }
.onboarding-manual-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.onboarding-manual-icon { width: 36px; height: 36px; background: rgba(245, 158, 11, 0.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #f59e0b; }
.onboarding-manual-icon svg { width: 18px; height: 18px; }
.onboarding-manual-title { font-weight: 600; color: #f59e0b; }
.onboarding-manual-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Onboarding License Overlay */
.onboarding-license-overlay { position: absolute; inset: 0; background: rgba(10, 10, 15, 0.9); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(4px); border-radius: 24px; }
.onboarding-license-overlay.hidden { display: none; }
.onboarding-license-box { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 2rem; text-align: center; max-width: 400px; }
.onboarding-license-spinner { width: 48px; height: 48px; border: 3px solid var(--border-subtle); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1.5rem; }
.onboarding-license-text { color: var(--text-secondary); font-size: 1rem; }

/* Onboarding Error Banner */
.onboarding-error-banner { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 16px; padding: 1.5rem; margin-bottom: 2rem; display: none; }
.onboarding-error-banner.show { display: block; }
.onboarding-error-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.onboarding-error-icon { width: 48px; height: 48px; background: rgba(239, 68, 68, 0.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #ef4444; flex-shrink: 0; }
.onboarding-error-icon svg { width: 24px; height: 24px; }
.onboarding-error-title { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; color: #ef4444; }
.onboarding-error-desc { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

/* Onboarding Success Modal */
.onboarding-success-modal { position: fixed; inset: 0; background: rgba(10, 10, 15, 0.9); display: none; align-items: center; justify-content: center; z-index: 1100; backdrop-filter: blur(4px); }
.onboarding-success-modal.show { display: flex; }
.onboarding-success-box { background: var(--bg-card); border: 1px solid rgba(0, 212, 170, 0.3); border-radius: 24px; padding: 2rem; max-width: 500px; width: 90%; }
.onboarding-success-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.onboarding-success-icon { width: 56px; height: 56px; background: rgba(0, 212, 170, 0.2); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--accent-cyan); flex-shrink: 0; }
.onboarding-success-icon svg { width: 28px; height: 28px; }
.onboarding-success-title { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--accent-cyan); }
.onboarding-success-subtitle { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; }
.onboarding-success-summary { background: var(--bg-input); border-radius: 12px; padding: 1rem; margin-bottom: 1.5rem; }
.onboarding-success-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); }
.onboarding-success-row:last-child { border-bottom: none; }
.onboarding-success-label { color: var(--text-muted); font-size: 0.85rem; }
.onboarding-success-value { color: var(--text-primary); font-weight: 500; font-size: 0.9rem; }
.onboarding-success-actions { display: flex; gap: 0.75rem; }
.onboarding-success-close { flex: 1; padding: 1rem; background: transparent; border: 1px solid var(--border-subtle); border-radius: 12px; color: var(--text-secondary); font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; font-family: inherit; }
.onboarding-success-close:hover { border-color: var(--text-primary); color: var(--text-primary); }
.onboarding-success-new { flex: 1; padding: 1rem; background: var(--accent-cyan); border: none; border-radius: 12px; color: var(--bg-deep); font-weight: 600; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; font-family: inherit; }
.onboarding-success-new:hover { opacity: 0.9; transform: translateY(-2px); }

/* Onboarding Age Warning */
.onboarding-age-warning { display: none; margin-top: 0.25rem; padding: 0.5rem 0.75rem; background: rgba(30, 25, 15, 0.95); border: 1px solid rgba(245, 158, 11, 0.5); border-radius: 8px; font-size: 0.8rem; color: #f59e0b; backdrop-filter: blur(8px); align-items: center; gap: 0.5rem; }
.onboarding-age-warning.show { display: flex; }

/* ─── SR Project Page ─── */
.sr-project-layout { display: grid; grid-template-columns: 1fr 480px; gap: 1.5rem; overflow: hidden; }
.sr-project-layout > .card { min-width: 0; overflow: hidden; }
.sr-project-filters { display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: flex-end; }
.sr-filter-group { display: flex; flex-direction: column; gap: 0.25rem; }
.sr-filter-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sr-filter-select, .sr-filter-input { background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.6rem 0.875rem; color: var(--text-primary); font-size: 0.85rem; min-width: 160px; transition: all 0.2s ease; }
.sr-filter-select:focus, .sr-filter-input:focus { outline: none; border-color: var(--accent-cyan); }

.sr-loading-overlay { position: absolute; inset: 0; background: rgba(10,10,18,0.7); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.sr-loading-overlay.active { opacity: 1; pointer-events: all; }
.sr-loading-spinner { width: 48px; height: 48px; border: 3px solid var(--border-subtle); border-top-color: var(--accent-cyan); border-radius: 50%; animation: spin 0.8s linear infinite; }
.sr-loading-text { margin-top: 1rem; color: var(--text-muted); font-size: 0.9rem; }

.sr-map-card { padding: 1.25rem; }
.sr-map-card.fullscreen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9998; border-radius: 0; margin: 0; padding: 1rem; overflow-y: auto; background: var(--bg-card); }
.sr-map-card.fullscreen .sr-map-container { height: calc(100vh - 240px); border-radius: 8px; }
.sr-map-expand-btn { position: absolute; top: 10px; right: 10px; z-index: 1000; background: rgba(18,18,28,0.85); border: 1px solid var(--border-subtle); color: var(--text-primary); border-radius: 8px; padding: 0.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.sr-map-expand-btn:hover { background: rgba(30,30,50,0.95); border-color: var(--accent-cyan); }
.sr-map-expand-btn svg { width: 18px; height: 18px; }
.sr-map-container { position: relative; width: 100%; height: 500px; background: var(--bg-input); border-radius: 12px; overflow: hidden; }
#sr-norway-map { width: 100%; height: 100%; border-radius: 12px; z-index: 1; }

.leaflet-container { background: var(--bg-input) !important; font-family: 'Satoshi', sans-serif !important; }
.leaflet-popup-content-wrapper { background: rgba(18,18,28,0.95) !important; color: var(--text-primary) !important; border: 1px solid var(--border-subtle) !important; border-radius: 10px !important; }
.leaflet-popup-tip { background: rgba(18,18,28,0.95) !important; }
.leaflet-popup-content { margin: 12px 14px !important; }
.sr-popup-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.sr-popup-fylke { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.sr-popup-row { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.sr-popup-row span:last-child { font-weight: 600; color: var(--text-primary); }
.sr-popup-tildelt { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border-subtle); }

.sr-map-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
.sr-legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); }
.sr-legend-color { width: 14px; height: 14px; border-radius: 4px; }

.sr-region-summary { margin-top: 1.5rem; }
.sr-region-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-secondary); }
.sr-region-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.sr-region-name { font-size: 0.8rem; width: 100px; flex-shrink: 0; color: var(--text-secondary); }
.sr-region-progress { flex: 1; height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; }
.sr-region-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.sr-region-count { font-size: 0.75rem; color: var(--text-muted); width: 70px; text-align: right; font-variant-numeric: tabular-nums; }

.sr-tech-breakdown { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }
.sr-tech-item { background: var(--bg-input); padding: 0.875rem; border-radius: 10px; }
.sr-tech-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sr-tech-value { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.25rem; font-weight: 700; margin-top: 0.25rem; }

.sr-tildelt-badge { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.sr-tildelt-badge:hover { transform: scale(1.05); filter: brightness(1.2); }
.sr-tildelt-leads-bank { background: rgba(234,179,8,0.2); color: #facc15; }
.sr-tildelt-ost { background: rgba(59,130,246,0.2); color: #60a5fa; }
.sr-tildelt-vest { background: rgba(168,85,247,0.2); color: #a78bfa; }
.sr-tildelt-nord { background: rgba(20,184,166,0.2); color: #2dd4bf; }
.sr-tildelt-sor { background: rgba(249,115,22,0.2); color: #fb923c; }
.sr-tildelt-other { background: rgba(34,197,94,0.2); color: #4ade80; }
.sr-tildelt-ikke-importert { background: rgba(107,114,128,0.2); color: #9ca3af; }

.sr-move-modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 1000; align-items: center; justify-content: center; }
.sr-move-modal-overlay.active { display: flex; }
.sr-move-modal { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 1.5rem; max-width: 400px; width: 90%; backdrop-filter: blur(20px); }
.sr-move-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sr-move-modal-title { font-size: 1.1rem; font-weight: 700; }
.sr-move-modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; padding: 0.25rem; }
.sr-move-modal-close:hover { color: var(--text-primary); }
.sr-move-modal-info { background: var(--bg-input); border-radius: 10px; padding: 0.875rem; margin-bottom: 1rem; }
.sr-move-modal-kommune { font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }
.sr-move-modal-fylke { font-size: 0.8rem; color: var(--text-muted); }
.sr-move-modal-current { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.85rem; }
.sr-move-modal-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.sr-move-region-options { display: flex; flex-direction: column; gap: 0.5rem; }
.sr-move-region-btn { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; cursor: pointer; transition: all 0.15s ease; color: var(--text-primary); font-size: 0.9rem; }
.sr-move-region-btn:hover { border-color: var(--accent-cyan); background: rgba(0,212,170,0.1); }
.sr-move-region-btn.current { opacity: 0.5; cursor: not-allowed; }
.sr-move-region-btn.current:hover { border-color: var(--border-subtle); background: var(--bg-input); }
.sr-move-region-btn.selected { border-color: var(--accent-cyan); background: rgba(0,212,170,0.1); }
.sr-move-region-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.sr-move-modal-footer { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ─── SR Address Search ─── */
.sra-search-box { max-width: 640px; margin: 0 auto 1.5rem; }
.sra-search-bar { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0.2rem 0.2rem 0.2rem 0.75rem; transition: border-color 0.2s ease; }
.sra-search-bar:focus-within { border-color: var(--accent-cyan); }
.sra-search-icon { color: var(--text-muted); display: flex; align-items: center; flex-shrink: 0; margin-right: 0.5rem; }
.sra-search-bar input { background: transparent; border: none; color: var(--text-primary); font-size: 0.85rem; font-family: 'Satoshi', sans-serif; outline: none; padding: 0.55rem 0; }
.sra-search-bar input::placeholder { color: var(--text-muted); }
.sra-search-bar input.sra-street { flex: 1; min-width: 0; }
.sra-search-bar .sra-zip-input { width: 72px; flex-shrink: 0; text-align: center; font-weight: 500; }
.sra-search-divider { width: 1px; height: 20px; background: var(--border-hover); margin: 0 0.4rem; flex-shrink: 0; }
.sra-search-btn { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border-radius: 8px; margin-left: 0.35rem; flex-shrink: 0; background: var(--accent-cyan); color: var(--bg-deep); border: none; font-size: 0.875rem; font-weight: 600; cursor: pointer; font-family: 'Satoshi', sans-serif; transition: all 0.2s ease; white-space: nowrap; }
.sra-search-btn:hover { opacity: 0.9; }
.sra-search-btn:disabled { background: var(--text-muted); cursor: wait; }
.sra-tips { background: rgba(234,160,50,0.08); border: 1px solid rgba(234,160,50,0.2); border-radius: 8px; padding: 0.6rem 0.75rem; margin-top: 0.65rem; }
.sra-tips-title { display: flex; align-items: center; gap: 0.35rem; font-size: 0.65rem; font-weight: 600; color: #eaa032; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.sra-tips-list { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; color: #c9a46a; line-height: 1.5; padding-left: 1.15rem; }
.sra-tips-list li { position: relative; padding-left: 0.7rem; }
.sra-tips-list li::before { content: ''; position: absolute; left: 0; top: 0.55em; width: 4px; height: 4px; border-radius: 50%; background: rgba(234,160,50,0.4); }
.sra-tips-list strong { color: #eaa032; font-weight: 600; }
.sra-tips-list code { background: rgba(234,160,50,0.15); color: #eaa032; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.68rem; font-family: 'Satoshi', sans-serif; font-weight: 600; }
.sra-mode-toggle { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
.sra-mode-btn { display: flex; align-items: center; gap: 0.3rem; background: none; border: none; color: var(--text-muted); font-size: 0.6rem; font-family: 'Satoshi', sans-serif; cursor: pointer; padding: 0.2rem 0; transition: color 0.2s ease; }
.sra-mode-btn:hover { color: var(--text-secondary); }
.sra-hint { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.7rem; color: var(--text-muted); }
.sra-hint .spinner { width: 12px; height: 12px; }
.sra-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #f87171; padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.85rem; max-width: 640px; margin-left: auto; margin-right: auto; }
.sra-picker { margin-bottom: 1.5rem; }
.sra-picker h2 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.sra-picker .sra-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.sra-picker-list { list-style: none; max-height: 500px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 0; }
.sra-picker-item { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: start; padding: 0.875rem 1rem; border: 1px solid var(--border-subtle); border-radius: 12px; cursor: pointer; transition: all 0.2s ease; }
.sra-picker-item:hover { border-color: var(--accent-cyan); background: rgba(0,212,170,0.05); }
.sra-pi-addr { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.2rem; }
.sra-pi-meta { font-size: 0.7rem; color: var(--text-muted); }
.sra-pi-details { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.4rem; }
.sra-pi-tag { font-size: 0.65rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.25rem; }
.sra-pi-tag strong { color: var(--text-primary); font-weight: 500; }
.sra-pi-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; flex-shrink: 0; }
.sra-pi-date { font-size: 0.6rem; color: var(--text-muted); }
.sra-map-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
.sra-map { height: 520px; border-radius: 16px; border: 1px solid var(--border-subtle); }
.sra-sidebar { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 16px; display: flex; flex-direction: column; max-height: 520px; }
.sra-sidebar-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.sra-sidebar-header h3 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.sra-sidebar-header .sra-sub { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0; }
.sra-sidebar-controls { padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border-subtle); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
.sra-sidebar-controls label { margin: 0; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.sra-sidebar-controls select { padding: 0.35rem 0.5rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 6px; color: var(--text-primary); font-size: 0.75rem; font-family: 'Satoshi', sans-serif; max-width: 120px; outline: none; }
.sra-sidebar-controls select option { background: var(--bg-deep); color: var(--text-primary); }
.sra-label-toggle { background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-muted); padding: 0.3rem 0.5rem; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 0.3rem; font-size: 0.65rem; font-family: 'Satoshi', sans-serif; transition: all 0.2s ease; margin-left: auto; }
.sra-label-toggle:hover { border-color: var(--accent-cyan); color: var(--text-primary); }
.sra-label-toggle.active { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.sra-sidebar-list { overflow-y: auto; flex: 1; }
.sra-lead-row { padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; transition: all 0.15s ease; }
.sra-lead-row:hover { background: rgba(255,255,255,0.02); }
.sra-lead-row.active { background: rgba(0,212,170,0.08); border-left: 3px solid var(--accent-cyan); }
.sra-lead-row .sra-addr { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.sra-lead-row .sra-dist { font-size: 0.7rem; color: var(--text-muted); }
.sra-map-loading { position: absolute; inset: 0; background: rgba(10,10,15,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; border-radius: 16px; font-size: 0.9rem; color: var(--text-secondary); }
.sra-back-btn { background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-secondary); padding: 0.4rem 0.8rem; border-radius: 8px; cursor: pointer; font-size: 0.75rem; font-weight: 500; font-family: 'Satoshi', sans-serif; transition: all 0.2s ease; margin-bottom: 1rem; }
.sra-back-btn:hover { border-color: var(--accent-cyan); color: var(--text-primary); }
.sra-badge { display: inline-block; padding: 0.2rem 0.625rem; border-radius: 6px; font-size: 0.7rem; font-weight: 600; }
.sra-badge-salg { background: rgba(234,179,8,0.2); color: #facc15; }
.sra-badge-prospect { background: rgba(34,197,94,0.2); color: #4ade80; }
.sra-badge-nei { background: rgba(239,68,68,0.2); color: #f87171; }
.sra-badge-aktiv { background: rgba(37,99,235,0.2); color: #60a5fa; }
.sra-badge-tilbud { background: rgba(249,115,22,0.2); color: #fb923c; }
.sra-badge-oppfolging { background: rgba(156,163,175,0.2); color: #9ca3af; }
.sra-badge-ikkehjem { background: rgba(139,92,246,0.2); color: #a78bfa; }
.sra-badge-avtale { background: rgba(153,27,27,0.2); color: #dc2626; }
.sra-badge-mdu { background: rgba(153,27,27,0.2); color: #dc2626; }
.sra-badge-ikkeakt { background: rgba(153,27,27,0.2); color: #dc2626; }
.sra-badge-ikkebeb { background: rgba(0,0,0,0.3); color: #a1a1aa; }
.sra-badge-hytte { background: rgba(219,39,119,0.2); color: #f472b6; }
.sra-badge-default { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.sra-detail { margin-top: 1rem; }
@keyframes sraDetailFlash { 0% { border-color: var(--accent-cyan); } 100% { border-color: var(--border-subtle); } }
.sra-detail h3 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.sra-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.sra-detail-grid .sra-item label { font-size: 0.65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; display: block; margin-bottom: 0; }
.sra-detail-grid .sra-item .sra-val { font-size: 0.85rem; font-weight: 500; margin-top: 0.15rem; color: var(--text-primary); }
.sra-custom-fields { margin-top: 0.75rem; }
.sra-custom-fields h4 { font-family: 'Cabinet Grotesk', sans-serif; font-size: 0.85rem; font-weight: 600; color: var(--accent-cyan); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-subtle); }
.sra-custom-fields table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.sra-custom-fields th { text-align: left; padding: 0.4rem 0.75rem; color: var(--text-muted); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border-subtle); }
.sra-custom-fields td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.sra-custom-fields td:first-child { color: var(--text-primary); font-weight: 500; }
.sra-tl-item { display: flex; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.sra-tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-cyan); margin-top: 5px; flex-shrink: 0; }
.sra-tl-date { font-size: 0.7rem; color: var(--text-muted); min-width: 120px; }
.sra-tl-info { font-size: 0.85rem; }
.sra-tl-user { font-size: 0.7rem; color: var(--text-muted); }
#sra-map .leaflet-popup-content-wrapper { background: rgba(18,18,28,0.95) !important; border: 1px solid var(--border-subtle) !important; border-radius: 12px !important; color: var(--text-primary) !important; }
#sra-map .leaflet-popup-tip { background: rgba(18,18,28,0.95) !important; }
#sra-map .leaflet-popup-content { margin: 10px 12px !important; font-size: 0.8rem; line-height: 1.4; }
.sra-popup-addr { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.4rem; }
.sra-popup-row { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.3rem; font-size: 0.7rem; color: var(--text-secondary); }
.sra-lead-label { background: transparent !important; border: none !important; box-shadow: none !important; font-size: 0.6rem; font-weight: 600; color: #333; white-space: nowrap; text-shadow: 0 0 3px rgba(255,255,255,0.9), 0 0 6px rgba(255,255,255,0.7); }

/* ─── Tablet ─── */
@media (max-width: 1024px) {
    .announcement-layout { grid-template-columns: 1fr; height: auto; }
    .announcement-recipients { max-height: 350px; }
    .stats-grid { gap: 0.75rem; }
    .stat-card { padding: 0.85rem 1rem; }
    .stat-value { font-size: 1.75rem; }
    .onboarding-form-grid, .onboarding-projects-grid { grid-template-columns: 1fr; }
    .onboarding-layout { grid-template-columns: 1fr; }
    .onboarding-sidebar { position: static; }
    .sr-project-layout { grid-template-columns: 1fr 400px; }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { display: flex; }
    .main { margin-left: 0; padding: 0.75rem; padding-top: calc(var(--mobile-header-height) + 0.75rem); }
    /* Page content */
    .page-header { margin-bottom: 0.75rem; }
    .page-title { font-size: 1.25rem; margin-bottom: 0.25rem; }
    .page-desc { font-size: 0.75rem; }
    .card { padding: 0.75rem; margin-bottom: 0.75rem; border-radius: 10px; }
    .card-title { font-size: 0.85rem; margin-bottom: 0.5rem; }
    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 0.75rem; }
    .stat-card { padding: 0.65rem 0.75rem; border-radius: 10px; }
    .stat-value { font-size: 1.25rem; line-height: 1.2; }
    .stat-label { font-size: 0.65rem; margin-top: 0.125rem; }
    /* Table */
    .table-tools { gap: 0.5rem; margin-bottom: 0.5rem; }
    .search-box { min-width: 150px; }
    .search-box input, .search-box-input { padding: 0.5rem 0.75rem 0.5rem 2rem; font-size: 0.8rem; border-radius: 6px; }
    .search-box svg { left: 0.5rem; width: 16px; height: 16px; }
    .filter-btn, .filter-select { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    .table-info, .result-count { font-size: 0.7rem; }
    table { font-size: 0.75rem; }
    th, td { padding: 0.5rem 0.35rem; }
    th { font-size: 0.65rem; letter-spacing: 0.03em; }
    /* Badges */
    .badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
    .role-badge { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
    /* Action */
    .action-btn { padding: 0.35rem 0.5rem; font-size: 0.65rem; gap: 0.25rem; }
    .action-btn svg { width: 12px; height: 12px; }
    /* Welcome */
    .welcome-grid { gap: 0.75rem; }
    .welcome-section { padding: 1rem; }
    .welcome-pages { grid-template-columns: 1fr; gap: 0.5rem; }
    .welcome-page-btn { font-size: 0.8rem; padding: 0.55rem 0.75rem; }
    /* Announcement */
    .announcement-layout { display: flex; flex-direction: column-reverse; gap: 0.75rem; }
    .announcement-recipients { max-height: none; }
    /* Activity */
    .activity-filter-bar { flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.75rem; }
    .activity-filter-btn { padding: 0.35rem 0.6rem; font-size: 0.65rem; }
    .activity-refresh-btn { padding: 0.35rem 0.5rem; }
    .activity-refresh-btn svg { width: 14px; height: 14px; }
    .matrix-scroll { margin: 0 -0.75rem; padding: 0 0.75rem; }
    .matrix-hint { display: block; font-size: 0.65rem; }
    .activity-matrix th, .activity-matrix td { padding: 0.3rem 0.25rem; font-size: 0.65rem; }
    .activity-matrix .matrix-icon { width: 14px; height: 14px; }
    .activity-matrix th:first-child, .activity-matrix td:first-child { min-width: 80px; max-width: 80px; font-size: 0.6rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .event-item { padding: 0.5rem 0; }
    .event-icon { width: 32px; height: 32px; }
    .event-icon img { width: 20px; height: 20px; }
    .event-status { font-size: 0.8rem; }
    .event-seller { font-size: 0.7rem; }
    .event-time { font-size: 0.65rem; }
    /* Onboarding */
    .onboarding-section { padding: 1.5rem; }
    .onboarding-form-grid, .onboarding-projects-grid, .onboarding-contract-info-grid { grid-template-columns: 1fr; }
    .onboarding-phone-group { flex-direction: column; }
    .onboarding-country-code { width: 100%; }
    .onboarding-sidebar { display: none; }
    /* SR Project */
    .sr-project-layout { grid-template-columns: 1fr; }
    .sr-map-card { order: -1; }
    .sr-map-container { height: 300px; }
    .sr-project-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .sr-project-filters .sr-filter-group:last-child { grid-column: 1 / -1; }
    .sr-filter-select, .sr-filter-input { min-width: auto; width: 100%; font-size: 0.8rem; padding: 0.5rem 0.7rem; }
    .sr-map-legend { gap: 0.5rem; }
    .sr-legend-item { font-size: 0.65rem; }
    .sr-legend-color { width: 10px; height: 10px; }
    .sr-region-name { width: 70px; font-size: 0.7rem; }
    .sr-region-count { font-size: 0.65rem; width: 55px; }
    .sr-tech-breakdown { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .sr-tech-item { padding: 0.65rem; }
    .sr-tech-label { font-size: 0.6rem; }
    .sr-tech-value { font-size: 1rem; }
    .sr-tildelt-badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
    /* SR Address */
    .sra-map-layout { grid-template-columns: 1fr; gap: 0.75rem; }
    .sra-map { height: 300px; border-radius: 12px; }
    .sra-sidebar { max-height: 260px; border-radius: 12px; }
    .sra-detail-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .sra-picker-item { grid-template-columns: 1fr; }
    .sra-badge { font-size: 0.6rem; padding: 0.15rem 0.5rem; }
    .sra-search-bar { flex-wrap: wrap; gap: 0.5rem; padding: 0.5rem; }
    .sra-search-divider { display: none; }
    .sra-search-bar input.sra-street { flex: 1 1 100%; }
    /* Toast */
    .toast-container { bottom: 0.75rem; right: 0.75rem; left: 0.75rem; }
    .toast { max-width: none; }
    /* Popups/modals on mobile */
    .text-edit-popup-box { width: 95%; max-width: 100%; padding: 1rem; }
    .modal-content { width: 95%; padding: 1rem; }
    .col-filter-dropdown { min-width: 160px; max-width: calc(100vw - 2rem); }
    .action-menu { min-width: 160px; max-width: calc(100vw - 2rem); }
    .editable-date-input { width: 100px; font-size: 0.75rem; }
}

/* ─── Small Mobile ─── */
@media (max-width: 480px) {
    .main { padding: 0.5rem; padding-top: calc(var(--mobile-header-height) + 0.5rem); }
    .card { padding: 0.65rem; margin-bottom: 0.65rem; }
    .page-title { font-size: 1.1rem; }
    .page-desc { font-size: 0.7rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.35rem; }
    .stat-card { padding: 0.5rem 0.6rem; }
    .stat-value { font-size: 1.1rem; }
    .stat-label { font-size: 0.6rem; }
    .search-box { min-width: 100px; max-width: 100%; }
    table { font-size: 0.7rem; }
    th, td { padding: 0.35rem 0.25rem; }
    th { font-size: 0.6rem; }
    th:first-child, td:first-child { min-width: 60px; max-width: 80px; }
    .activity-matrix th:first-child, .activity-matrix td:first-child { min-width: 60px; max-width: 60px; }
    .welcome-section { padding: 0.75rem; }
    .sr-project-filters { grid-template-columns: 1fr; }
    .sr-filter-label { font-size: 0.6rem; }
}
