/* Ziptility Design System
   ========================
   Color palette, typography, and base styles
*/

* {
    box-sizing: border-box;
}

/* Ziptility Color Palette */
:root {
    --brand: #FF4B26;
    --brand-hover: #e64322;
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-150: #E7EDF3;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-350: #AFBCCD;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;
    --slate-950: #020617;
    --error: #DC2626;
    --success: #16A34A;

    /* Badge colors */
    --green-100: #DCFCE7;
    --green-500: #22C55E;
    --green-600: #16A34A;
    --red-100: #FFE2E2;
    --red-500: #EF4444;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--slate-100);
    color: var(--slate-900);
}

strong, b {
    font-weight: 600;
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-hover);
}

.primary-sidebar__item {
    color: var(--slate-700);
}

.primary-sidebar__item:hover {
    color: var(--slate-700);
}

/* Mapbox popup overrides */
.mapboxgl-popup-content {
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(71, 85, 105, 0.35);
}

a.link--subtle {
    color: var(--slate-700);
    text-decoration: underline;
}

a.link--subtle:hover {
    color: var(--slate-900);
}

a.link--muted {
    color: var(--slate-500);
    text-decoration: underline;
}

a.link--muted:hover {
    color: var(--slate-700);
}

/* ============================================================
   Typography
   ============================================================ */

.h1 { font-size: 26px; font-weight: 900; line-height: 1.25; color: var(--slate-900); margin: 0; }
.h2 { font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--slate-900); margin: 0; }
.h3 { font-size: 19px; font-weight: 600; line-height: 1.25; color: var(--slate-900); margin: 0; }
.h4 { font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--slate-900); margin: 0; }
.body-1 { font-size: 17px; font-weight: 400; line-height: 1.35; color: var(--slate-700); }
.body-2 { font-size: 15px; font-weight: 400; line-height: 1.35; color: var(--slate-700); }
.body-3 { font-size: 13px; font-weight: 400; line-height: 1.35; color: var(--slate-700); }
.label { font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--slate-700); }

/* ============================================================
   Icons
   ============================================================ */

/* Filled icon variant - use with .material-symbols-sharp */
.icon-filled {
    font-variation-settings: 'FILL' 1;
}

/* ============================================================
   Badge
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
}

.badge--sm {
    padding: 3px 8px;
    font-size: 13px;
}

/* Success */
.badge--success {
    background: var(--green-500);
    color: white;
}

.badge--success.badge--light {
    background: var(--green-100);
    color: var(--green-600);
}

/* Error */
.badge--error {
    background: var(--red-500);
    color: white;
}

.badge--error.badge--light {
    background: var(--red-100);
    color: var(--red-500);
}

/* Neutral */
.badge--neutral {
    background: var(--slate-700);
    color: white;
}

.badge--neutral.badge--light {
    background: var(--slate-50);
    color: var(--slate-700);
}

/* Neutral Alt */
.badge--neutral-alt {
    background: var(--slate-600);
    color: white;
}

.badge--neutral-alt.badge--light {
    background: var(--slate-100);
    color: var(--slate-700);
}

/* ============================================================
   Checkbox
   ============================================================ */

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox__box {
    position: relative;
    width: 20px;
    height: 20px;
    border: 1px solid var(--slate-350);
    border-radius: 5px;
    background: white;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

/* Checkmark icon (hidden by default) */
.checkbox__box::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Checked state */
.checkbox__input:checked + .checkbox__box {
    background: var(--slate-700);
    border-color: var(--slate-700);
}

.checkbox__input:checked + .checkbox__box::after {
    opacity: 1;
}

/* Focus state */
.checkbox__input:focus-visible + .checkbox__box {
    box-shadow: 0 0 0 1px var(--slate-500);
}

/* Disabled state */
.checkbox__input:disabled + .checkbox__box {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox__input:disabled ~ .checkbox__label {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox__label {
    font-size: 15px;
    line-height: 1.35;
    color: var(--slate-700);
}

/* ============================================================
   Radio
   ============================================================ */

.radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.radio__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio__circle {
    position: relative;
    width: 20px;
    height: 20px;
    border: 1px solid var(--slate-350);
    border-radius: 999px;
    background: white;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

/* Inner dot (hidden by default) */
.radio__circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--slate-700);
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Checked state */
.radio__input:checked + .radio__circle {
    border-color: var(--slate-700);
}

.radio__input:checked + .radio__circle::after {
    opacity: 1;
}

/* Focus state */
.radio__input:focus-visible + .radio__circle {
    box-shadow: 0 0 0 1px var(--slate-500);
}

/* Disabled state */
.radio__input:disabled + .radio__circle {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio__input:disabled ~ .radio__label {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio__label {
    font-size: 15px;
    line-height: 1.35;
    color: var(--slate-700);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.35;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn .material-symbols-sharp {
    font-size: 20px;
}

.btn-icon {
    padding: 8px;
}

.btn-default {
    background: var(--slate-100);
    border: 1px solid var(--slate-300);
    color: var(--slate-700);
}

.btn-default:hover:not(:disabled) {
    background: var(--slate-150);
}

.btn-primary {
    background: var(--slate-700);
    border: none;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--slate-800);
}

.btn-branded {
    background: var(--brand);
    border: none;
    color: white;
}

.btn-branded:hover:not(:disabled) {
    background: var(--brand-hover);
}

.btn-danger {
    background: var(--error);
    border: none;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--slate-700);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--slate-100);
}

.btn-ghost-destructive {
    background: #fef2f2;
    border: none;
    color: var(--error);
}

.btn-ghost-destructive:hover:not(:disabled) {
    background: #fee2e2;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* ============================================================
   Button Group (Segmented Control)
   ============================================================ */

.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 5px 0 0 5px;
}

.btn-group .btn:last-child {
    border-radius: 0 5px 5px 0;
}

.btn-group .btn:not(:first-child) {
    margin-left: -1px;
}

.btn-group .btn.active {
    background: white;
    border-color: var(--slate-300);
    color: var(--slate-900);
    position: relative;
    z-index: 1;
}

.btn-group .btn.active:hover {
    background: white;
}

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--slate-700);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 1.2s linear infinite;
}

.spinner--sm {
    width: 16px;
    height: 16px;
}

.spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.spinner--light {
    border-color: white;
    border-right-color: transparent;
}

@keyframes spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Close Button
   ============================================================ */

.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: 1px solid var(--slate-300);
    border-radius: 6px;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.close-btn:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.close-btn .material-symbols-sharp {
    font-size: 20px;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.visible .modal {
    transform: scale(1);
}

.modal__header {
    padding: 20px 24px 0;
}

.modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
}

.modal__body {
    padding: 12px 24px 24px;
    font-size: 14px;
    color: var(--slate-600);
    line-height: 1.5;
}

.modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--slate-200);
}

/* ============================================================
   Form Elements
   ============================================================ */

.form-input {
    padding: 8px 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.35;
    border: 1px solid var(--slate-350);
    border-radius: 5px;
    background: #fff;
    color: var(--slate-700);
}

.form-input::placeholder {
    color: var(--slate-400);
}

.form-input:focus {
    outline: none;
    border-color: var(--slate-500);
    box-shadow: 0 0 0 1px var(--slate-500);
}

.form-input:disabled {
    background: var(--slate-50);
    opacity: 0.5;
    cursor: not-allowed;
}

.form-input--error {
    border-color: var(--error);
    color: var(--error);
}

.form-input--error:focus {
    border-color: var(--error);
    box-shadow: 0 0 0 1px var(--error);
}

/* Form field (label + input + hint) */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-field__label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-900);
    line-height: 1.35;
    margin-bottom: 2px;
}

.form-field__label--required::after {
    content: '*';
    margin-left: 1px;
}

/* Form field caption - use for field-level messages (errors, hints) */
.form-field__caption {
    font-size: 13px;
    color: var(--slate-500);
    line-height: 1.35;
}

.form-field__caption--error {
    color: var(--error);
}

/* OTP Input - 6-digit verification code entry */
.otp-inputs {
    display: flex;
    gap: 8px;
}

/* OTP inputs extend .form-input with overrides for single-digit entry */
.otp-inputs .form-input {
    flex: 1;
    width: auto;
    min-width: 0;
    height: 66px;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
}

/* Select component - use directly on <select> element */
.select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 8px 32px 8px 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.35;
    color: var(--slate-700);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--slate-350);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.select:hover {
    border-color: var(--slate-400);
}

.select:focus {
    outline: none;
    border-color: var(--slate-500);
    box-shadow: 0 0 0 1px var(--slate-500);
}

.select--skipped {
    color: var(--slate-400);
    font-style: italic;
}

/* Legacy wrapper pattern - prefer using .select directly */
.select-wrapper {
    position: relative;
    display: block;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--slate-500);
    pointer-events: none;
}

.select__input {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 8px 32px 8px 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.35;
    color: var(--slate-700);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--slate-350);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.select__input:hover {
    border-color: var(--slate-400);
}

.select__input:focus {
    outline: none;
    border-color: var(--slate-500);
    box-shadow: 0 0 0 1px var(--slate-500);
}

.select__input.skipped {
    color: var(--slate-400);
    font-style: italic;
}

/* ============================================================
   Dialog Layout
   ============================================================ */

.dialog {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #fff;
}

.dialog__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid var(--slate-300);
    flex-shrink: 0;
}

.dialog__header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--slate-900);
    flex: 1;
}

.dialog__step-indicator {
    font-size: 14px;
    color: var(--slate-500);
}

.dialog__content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.dialog__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid var(--slate-300);
    flex-shrink: 0;
}

.dialog__footer-info {
    font-size: 13px;
    color: var(--slate-500);
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--slate-300);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar__header {
    padding: 20px;
    border-bottom: 1px solid var(--slate-300);
}

.sidebar__header h2 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--slate-900);
}

.sidebar__subtitle {
    font-size: 13px;
    color: var(--slate-500);
}

.sidebar__list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.sidebar__footer {
    padding: 15px 20px;
    border-top: 1px solid var(--slate-300);
    background: var(--slate-50);
}

/* ============================================================
   Layer Controls (for map pages)
   ============================================================ */

.layer-group {
    border-bottom: 1px solid var(--slate-300);
}

.layer-group:last-child {
    border-bottom: none;
}

.layer-group-header {
    padding: 12px 20px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-500);
    background: var(--slate-50);
    position: sticky;
    top: 0;
}

.layer-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--slate-200);
    transition: background 0.15s;
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-item:hover {
    background: var(--slate-150);
}

.layer-item .checkbox {
    width: 100%;
}

.layer-item .checkbox__label {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Ensure consistent width for map-marker and line-asset in layer items */
.layer-item .checkbox__label .map-marker,
.layer-item .checkbox__label .line-asset {
    flex-shrink: 0;
    width: 24px;
    margin-right: 8px;
}

.layer-item .checkbox__label .line-asset {
    /* Center the line asset within the 24px container */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.layer-item .checkbox__label .line-asset::before {
    content: '';
    display: block;
    border-radius: 25px;
    background: #3B82F6;
}

.layer-item .checkbox__label .line-asset--water::before {
    background: #3B82F6;
}

.layer-item .checkbox__label .line-asset--sewer::before {
    background: #FBBF24;
}

.layer-item .checkbox__label .line-asset--sm::before {
    width: 13px;
    height: 4px;
}

.layer-item .checkbox__label .line-asset--md::before {
    width: 17px;
    height: 6px;
}

.layer-item .checkbox__label .line-asset--lg::before {
    width: 19px;
    height: 8px;
}

.layer-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 10px;
    flex-shrink: 0;
}

.layer-count {
    color: var(--slate-500);
    font-size: 13px;
    margin-left: auto;
    padding-left: 8px;
}

/* ============================================================
   Map Style Toggle
   ============================================================ */

.map-style-toggle {
    position: absolute;
    top: 10px;
    right: 50px;
    z-index: 1;
}

/* ============================================================
   Dropzone
   ============================================================ */

.dropzone-container {
    width: 100%;
    max-width: 600px;
}

.dropzone {
    border: 2px dashed var(--slate-300);
    border-radius: 8px;
    padding: 64px 48px;
    text-align: center;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropzone:hover {
    border-color: var(--slate-400);
    background: var(--slate-50);
}

.dropzone.dragover {
    border-color: var(--brand);
    background: rgba(255, 75, 38, 0.05);
}

.dropzone-icon {
    margin-bottom: 16px;
    color: var(--slate-400);
}

.dropzone-icon .material-symbols-sharp {
    font-size: 48px;
}

.dropzone-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.dropzone-subtitle {
    font-size: 14px;
    color: var(--slate-500);
    margin-bottom: 24px;
    line-height: 1.5;
}

.dropzone-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    background: var(--slate-700);
    border: none;
    color: white;
    transition: all 0.15s ease;
}

.dropzone-button:hover {
    background: var(--slate-800);
}

.dropzone-button .material-symbols-sharp {
    font-size: 20px;
}

.dropzone-formats {
    margin-top: 24px;
    font-size: 13px;
    color: var(--slate-500);
}

/* ============================================================
   File List
   ============================================================ */

.file-list {
    margin-top: 24px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 6px;
    margin-bottom: 8px;
}

.file-item-icon {
    color: var(--slate-500);
}

.file-item-icon .material-symbols-sharp {
    font-size: 24px;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-900);
}

.file-item-size {
    font-size: 13px;
    color: var(--slate-500);
}

.file-item-status {
    color: var(--success);
}

.file-item-status .material-symbols-sharp {
    font-size: 20px;
}

.file-item-remove {
    padding: 4px;
    background: none;
    border: none;
    color: var(--slate-400);
    cursor: pointer;
    border-radius: 4px;
}

.file-item-remove:hover {
    color: var(--error);
    background: var(--slate-100);
}

.file-item-remove .material-symbols-sharp {
    font-size: 20px;
}

/* ============================================================
   Import Cards (Homepage)
   ============================================================ */

.import-card {
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    padding: 32px 40px;
    width: 280px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.import-card:hover {
    border-color: var(--slate-400);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.import-card__icon {
    margin-bottom: 16px;
    color: var(--slate-500);
}

.import-card__icon .material-symbols-sharp {
    font-size: 48px;
}

.import-card__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.import-card__description {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.5;
}

.import-card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.import-card--disabled:hover {
    border-color: var(--slate-300);
    box-shadow: none;
}

/* ============================================================
   Data Table
   ============================================================ */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}

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

.data-table th {
    font-weight: 600;
    color: var(--slate-700);
    background: #fff;
    border-bottom-color: var(--slate-300);
    white-space: nowrap;
}

.data-table td {
    color: var(--slate-900);
    background: #fff;
}

.data-table tbody tr:hover {
    background: var(--slate-50);
}

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

.source-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-field__name {
    font-weight: 500;
    color: var(--slate-900);
}

.source-field__samples {
    font-size: 13px;
    color: var(--slate-500);
}

/* ============================================================
   Panel Layout (for step-4)
   ============================================================ */

.panel {
    flex: 1;
    background: var(--slate-50);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel__header {
    padding: 24px 32px 16px;
    background: var(--slate-50);
}

.panel__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-900);
    margin: 0 0 4px 0;
}

.panel__subtitle {
    font-size: 14px;
    color: var(--slate-500);
    margin: 0;
}

.panel__content {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 32px;
}

/* ============================================================
   Tooltips
   ============================================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    background: var(--slate-800);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 7px solid transparent;
    border-right-color: var(--slate-800);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

[data-tooltip].tooltip-hidden::after,
[data-tooltip].tooltip-hidden::before {
    opacity: 0;
    visibility: hidden;
}

/* ============================================================
   Dialog Modal (centered modal dialogs)
   ============================================================ */

.dialog-modal {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--slate-300);
    width: 100%;
    max-width: 506px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(71, 85, 105, 0.45);
}

.dialog-modal--wide {
    max-width: 896px;
}

.dialog-modal--full-height {
    max-width: 700px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}

.dialog-modal--full-height .dialog-modal__header .dialog-modal__title {
    flex: 1;
    text-align: center;
}

.dialog-modal--full-height .dialog-modal__content {
    flex: 1;
    overflow-y: auto;
}

.dialog-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-300);
}

.dialog-modal__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--slate-900);
    margin: 0;
    line-height: 1.35;
}

.dialog-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--slate-600);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}

.dialog-modal__close:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.dialog-modal__close .material-symbols-sharp {
    font-size: 24px;
}

.dialog-modal__content {
    display: flex;
    flex-direction: column;
}

.dialog-modal__body {
    padding: 16px;
}

.dialog-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--slate-300);
}

.dialog-modal__footer--end {
    justify-content: flex-end;
    gap: 8px;
}

.dialog-modal__btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: var(--slate-700);
    background: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.dialog-modal__btn-back:hover {
    background: var(--slate-100);
}

.dialog-modal__btn-back .material-symbols-sharp {
    font-size: 18px;
}

.dialog-modal__btn-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: #fff;
    background: var(--brand);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.dialog-modal__btn-next:hover {
    background: var(--brand-hover);
}

.dialog-modal__btn-next .material-symbols-sharp {
    font-size: 18px;
}

.dialog-overlay {
    position: relative;
    background: rgba(51, 65, 85, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   Alert
   ============================================================ */

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border-radius: 4px;
    width: 100%;
}

.alert--default {
    border: 1px solid;
}

.alert--in-frame {
    border-radius: 0;
    max-width: none;
}

/* Alert: Neutral Light */
.alert--neutral.alert--light {
    background: var(--slate-50);
    border-color: var(--slate-200);
}

.alert--neutral.alert--light .alert__icon {
    color: var(--slate-500);
}

.alert--neutral.alert--light .alert__content {
    color: var(--slate-700);
}

/* Alert: Neutral Dark */
.alert--neutral.alert--dark {
    background: var(--slate-700);
}

.alert--neutral.alert--dark .alert__icon {
    color: rgba(255, 255, 255, 0.7);
}

.alert--neutral.alert--dark .alert__content {
    color: #fff;
}

/* Alert: Error Light */
.alert--error.alert--light {
    background: #fef2f2;
    border-color: #fca5a5;
}

.alert--error.alert--light .alert__icon {
    color: var(--error);
}

.alert--error.alert--light .alert__content {
    color: var(--error);
}

/* Alert: Error Dark */
.alert--error.alert--dark {
    background: var(--slate-700);
}

.alert--error.alert--dark .alert__icon {
    color: var(--red-500);
}

.alert--error.alert--dark .alert__content {
    color: #fff;
}

/* Alert: Success Light */
.alert--success.alert--light {
    background: #f0fdf4;
    border-color: #86efac;
}

.alert--success.alert--light .alert__icon {
    color: #15803d;
}

.alert--success.alert--light .alert__content {
    color: #15803d;
}

/* Alert: Success Dark */
.alert--success.alert--dark {
    background: var(--slate-700);
}

.alert--success.alert--dark .alert__icon {
    color: var(--success);
}

.alert--success.alert--dark .alert__content {
    color: #fff;
}

/* Alert: Warning Light */
.alert--warning.alert--light {
    background: #FEF3C7;
    border-color: #FCD34D;
}

.alert--warning.alert--light .alert__icon {
    color: #92400E;
}

.alert--warning.alert--light .alert__content {
    color: #92400E;
}

.alert--warning.alert--light .alert__content a {
    color: #92400E;
    font-weight: 600;
    text-decoration: underline;
}

.alert__icon {
    flex-shrink: 0;
}

.alert__icon .material-symbols-sharp {
    font-size: 24px;
}

.alert__content {
    flex: 1;
    font-size: 15px;
    line-height: 1.35;
    padding-top: 2px;
}

.alert__close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s;
}

.alert--light .alert__close {
    color: var(--slate-500);
}

.alert--light .alert__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.alert--dark .alert__close {
    color: rgba(255, 255, 255, 0.5);
}

.alert--dark .alert__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.alert__close .material-symbols-sharp {
    font-size: 20px;
}

/* ============================================================
   Dropzone
   ============================================================ */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px;
    border: 1px dashed var(--slate-400);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #fff;
    text-align: center;
}

.dropzone:hover {
    border-color: var(--slate-500);
    background: var(--slate-50);
}

.dropzone:focus-within {
    border-color: var(--brand);
    outline: none;
}

.dropzone--dragging {
    border-color: var(--brand);
    background: rgba(255, 75, 38, 0.05);
}

.dropzone--error {
    border-color: var(--error);
    background: #fef2f2;
}

.dropzone--success {
    border-color: var(--success);
    background: #f0fdf4;
}

.dropzone--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dropzone__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--slate-100);
    border-radius: 9999px;
    color: var(--slate-600);
}

.dropzone__icon .material-symbols-sharp {
    font-size: 24px;
}

.dropzone--dragging .dropzone__icon {
    background: rgba(255, 75, 38, 0.1);
    color: var(--brand);
}

.dropzone--error .dropzone__icon {
    background: #fee2e2;
    color: var(--error);
}

.dropzone--success .dropzone__icon {
    background: #dcfce7;
    color: var(--success);
}

.dropzone__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.dropzone__title {
    font-size: 17px;
    font-weight: 500;
    color: var(--slate-900);
    line-height: 1.35;
}

.dropzone__subtitle {
    font-size: 15px;
    font-weight: 400;
    color: var(--slate-700);
    line-height: 1.35;
}

.dropzone--error .dropzone__title {
    color: var(--error);
}

.dropzone--success .dropzone__title {
    color: var(--success);
}

.dropzone__file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--slate-50);
    border-radius: 8px;
    margin-top: 8px;
}

.dropzone__file-icon {
    color: var(--slate-500);
}

.dropzone__file-icon .material-symbols-sharp {
    font-size: 24px;
}

.dropzone__file-info {
    flex: 1;
    text-align: left;
}

.dropzone__file-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-900);
    line-height: 1.35;
}

.dropzone__file-size {
    font-size: 13px;
    color: var(--slate-500);
    line-height: 1.35;
}

.dropzone__file-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.15s;
}

.dropzone__file-remove:hover {
    background: var(--slate-200);
    color: var(--slate-700);
}

.dropzone__file-remove .material-symbols-sharp {
    font-size: 20px;
}


/* ============================================================
   Map Marker
   ============================================================ */

/* Map Marker Colors */
:root {
    --marker-lime: #A3E635;
    --marker-red: #EF4444;
    --marker-darkslate: #334155;
    --marker-purple: #A855F7;
    --marker-aqua: #14B8A6;
    --marker-yellow: #FACC15;
    --marker-pink: #EC4899;
    --marker-skyblue: #38BDF8;
    --marker-opalblue: #3B82F6;
    --marker-lightbrown: #D4A574;
    --marker-grey: #9CA3AF;
    --marker-orange: #F97316;
    --marker-navy: #1E3A8A;
    --marker-forestgreen: #22C55E;
    --marker-auburn: #991B1B;
}

.map-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
    flex-shrink: 0;
}

.map-marker--lg {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-width: 2.5px;
}

/* Color variants */
.map-marker--lime { background-color: var(--marker-lime); color: #1a2e05; }
.map-marker--red { background-color: var(--marker-red); }
.map-marker--darkslate { background-color: var(--marker-darkslate); }
.map-marker--purple { background-color: var(--marker-purple); }
.map-marker--aqua { background-color: var(--marker-aqua); }
.map-marker--yellow { background-color: var(--marker-yellow); color: #713f12; }
.map-marker--pink { background-color: var(--marker-pink); }
.map-marker--skyblue { background-color: var(--marker-skyblue); color: #0c4a6e; }
.map-marker--opalblue { background-color: var(--marker-opalblue); }
.map-marker--lightbrown { background-color: var(--marker-lightbrown); color: #451a03; }
.map-marker--grey { background-color: var(--marker-grey); color: #1f2937; }
.map-marker--orange { background-color: var(--marker-orange); }
.map-marker--navy { background-color: var(--marker-navy); }
.map-marker--forestgreen { background-color: var(--marker-forestgreen); }
.map-marker--auburn { background-color: var(--marker-auburn); }

/* Icon inner element */
.map-marker__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* SVG icon using mask for color inheritance - all icons are 18x18 */
.map-marker__icon::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.map-marker--lg .map-marker__icon::before {
    width: 18px;
    height: 18px;
}

/* Letter M icon */
.map-marker--icon-m .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.75 13.5V4.5L8.75 10.5L13.25 4.5V13.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.75 13.5V4.5L8.75 10.5L13.25 4.5V13.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Vertical line icon */
.map-marker--icon-line-vert .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4V14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4V14' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Horizontal line icon */
.map-marker--icon-line-hor .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.0049 8.995L4.00488 8.99499' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.0049 8.995L4.00488 8.99499' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Arrow up icon */
.map-marker--icon-arrow-up .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 13.75V4.25M9 4.25L4.5 8.75M9 4.25L13.5 8.75' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 13.75V4.25M9 4.25L4.5 8.75M9 4.25L13.5 8.75' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Arrow down icon */
.map-marker--icon-arrow-down .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4.25L9 13.75M9 13.75L13.5 9.25M9 13.75L4.5 9.25' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 4.25L9 13.75M9 13.75L13.5 9.25M9 13.75L4.5 9.25' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Cross/X icon */
.map-marker--icon-cross .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.25 5.25L12.75 12.75M12.75 5.25L5.25 12.75' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.25 5.25L12.75 12.75M12.75 5.25L5.25 12.75' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Circle icon */
.map-marker--icon-circle .map-marker__icon::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='4.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}



/* ============================================================
   Alert Dialog
   ============================================================ */

.alert-dialog {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(71, 85, 105, 0.45);
    width: 440px;
    max-width: calc(100vw - 48px);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.alert-dialog__message {
    font-size: 15px;
    line-height: 1.5;
    color: var(--slate-700);
    margin: 0;
}

.alert-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Line Asset Type */
.line-asset {
    display: inline-block;
    border-radius: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Sizes */
.line-asset--sm {
    width: 13px;
    height: 4px;
}

.line-asset--md {
    width: 17px;
    height: 6px;
}

.line-asset--lg {
    width: 19px;
    height: 8px;
}

/* Colors */
.line-asset--water {
    background: #3B82F6;
}

.line-asset--sewer {
    background: #FBBF24;
}

/* ============================================================
   Avatar Menu
   ============================================================ */

.primary-sidebar__avatar-wrapper {
    position: relative;
}

.primary-sidebar__avatar {
    cursor: pointer;
}

.avatar-menu {
    display: none;
    position: absolute;
    bottom: 0;
    left: calc(100% + 8px);
    width: 260px;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 200;
    overflow: hidden;
}

.avatar-menu.is-open {
    display: block;
}

.avatar-menu__group {
    padding: 6px 0;
    border-bottom: 1px solid var(--slate-200);
}

.avatar-menu__group:last-child {
    border-bottom: none;
}

.avatar-menu__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 15px;
    color: var(--slate-700);
    text-decoration: none;
    transition: background 0.1s;
    cursor: pointer;
    line-height: 1.4;
}

.avatar-menu__item:hover {
    background: var(--slate-50);
}

.avatar-menu__item--org {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
}

.avatar-menu__org-name {
    font-weight: 600;
    color: var(--slate-800);
}

.avatar-menu__org-sub {
    font-size: 13px;
    color: var(--slate-500);
}

.avatar-menu__item--has-arrow .material-symbols-sharp {
    font-size: 18px;
    color: var(--slate-400);
}

.avatar-menu__item--danger {
    color: var(--error);
}

.avatar-menu__item--danger:hover {
    background: #FEF2F2;
}

/* ============================================================
   Search Popup
   ============================================================ */

.search-popup {
    display: none;
    position: absolute;
    top: 16px;
    left: 80px;
    width: 400px;
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    z-index: 300;
    overflow: hidden;
}

.search-popup.is-open {
    display: block;
}

.search-popup__input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-200);
}

.search-popup__icon {
    font-size: 22px;
    color: var(--slate-400);
}

.search-popup__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--slate-800);
    background: transparent;
}

.search-popup__input::placeholder {
    color: var(--slate-400);
}

.search-popup__results {
    max-height: 360px;
    overflow-y: auto;
}

.search-popup__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--slate-700);
    transition: background 0.1s;
    cursor: pointer;
}

.search-popup__result:hover {
    background: var(--slate-50);
}

.search-popup__result .material-symbols-sharp {
    font-size: 20px;
    color: var(--slate-400);
}

.search-popup__result-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-popup__result-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-800);
}

.search-popup__result-sub {
    font-size: 13px;
    color: var(--slate-500);
}

.search-popup__empty,
.search-popup__no-results {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    font-size: 14px;
    color: var(--slate-400);
}

.search-popup__empty .material-symbols-sharp {
    font-size: 20px;
}

.search-popup__no-results {
    justify-content: center;
}

.search-popup__loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    font-size: 14px;
    color: var(--slate-500);
}

.search-popup__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--slate-200);
    border-top-color: var(--slate-500);
    border-radius: 50%;
    animation: search-spin 0.6s linear infinite;
}

@keyframes search-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Side Panel (global customer/record drawer)
   ============================================================ */

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.side-panel.is-open {
    transform: translateX(0);
}

.side-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--slate-300);
    height: 56px;
}

.side-panel__type {
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-400);
    margin: 0 0 2px 0;
}

.side-panel__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--slate-800);
    margin: 0;
}

.side-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.15s;
}

.side-panel__close:hover {
    background: var(--slate-100);
    color: var(--slate-700);
}

.side-panel__body {
    padding: 24px;
}

.side-panel__section {
    margin-bottom: 24px;
}

.side-panel__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.side-panel__section-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--slate-900);
    line-height: 1.25;
    margin: 0;
}

.side-panel__grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 16px;
}

.side-panel__label {
    font-size: 14px;
    color: var(--slate-500);
}

.side-panel__value {
    font-size: 14px;
    color: var(--slate-700);
}

.side-panel__badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 13px;
    width: fit-content;
    background: var(--success-light, #dcfce7);
    color: var(--success-dark, #166534);
}

/* ============================================================
   Initials Avatar
   ============================================================ */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    overflow: hidden;
    font-family: 'Archivo', sans-serif;
    color: #fff;
    flex-shrink: 0;
}

/* Sizes */
.avatar--24 { width: 24px; height: 24px; font-size: 9px; font-weight: 500; }
.avatar--32 { width: 32px; height: 32px; font-size: 12px; font-weight: 500; }
.avatar--40 { width: 40px; height: 40px; font-size: 15px; font-weight: 600; }
.avatar--48 { width: 48px; height: 48px; font-size: 20px; font-weight: 600; }
.avatar--64 { width: 64px; height: 64px; font-size: 26px; font-weight: 600; }
.avatar--96 { width: 96px; height: 96px; font-size: 38px; font-weight: 600; }

/* Colors */
.avatar--default { background: var(--slate-200); color: var(--slate-500); }
.avatar--lime { background: #BCED0A; color: #333; }
.avatar--red { background: #FF595E; }
.avatar--dark-slate { background: #2E3440; }
.avatar--purple { background: #6B4D94; }
.avatar--aqua { background: #119DA4; }
.avatar--yellow { background: #FFCA3A; color: #333; }
.avatar--pink { background: #EB73B2; }
.avatar--skyblue { background: #00A6FB; }
.avatar--opalblue { background: #1762F0; }
.avatar--lightbrown { background: #B79783; }
.avatar--grey { background: #D7D9DB; color: #333; }
.avatar--orange { background: #F79824; }
.avatar--navy { background: #425577; }
.avatar--forestgreen { background: #32B47D; }
.avatar--auburn { background: #902D41; }

/* Icon avatar (person placeholder) */
.avatar--icon {
    background: var(--slate-200);
    color: var(--slate-400);
}

.avatar--icon .material-symbols-sharp {
    font-size: inherit;
}

.avatar--24.avatar--icon .material-symbols-sharp { font-size: 16px; }
.avatar--32.avatar--icon .material-symbols-sharp { font-size: 20px; }
.avatar--40.avatar--icon .material-symbols-sharp { font-size: 24px; }
.avatar--48.avatar--icon .material-symbols-sharp { font-size: 28px; }
.avatar--64.avatar--icon .material-symbols-sharp { font-size: 36px; }
.avatar--96.avatar--icon .material-symbols-sharp { font-size: 52px; }

/* Image avatar */
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================================
   Menu (dropdown / context menu)
   ============================================================ */

.menu {
    width: 204px;
    background: #fff;
    border: 1px solid var(--slate-300);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(71, 85, 105, 0.35);
    padding: 6px 0;
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.35;
    color: var(--slate-700);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
}

.menu__item .material-symbols-sharp {
    font-size: 20px;
    color: var(--slate-400);
}

.menu__item:hover {
    background: var(--slate-50);
    color: var(--slate-700);
}

.menu__divider {
    height: 1px;
    background: var(--slate-200);
    margin: 6px 12px;
}

.menu__item--danger {
    color: var(--error);
}

.menu__item--danger .material-symbols-sharp {
    color: var(--error);
}

.menu__item--danger:hover {
    background: #FEF2F2;
    color: var(--error);
}

/* ============================================================
   Task Form
   ============================================================ */

.task-form__toggle {
    display: flex;
    border: 1px solid var(--slate-300);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 20px;
}

.task-form__toggle-btn {
    flex: 1;
    padding: 10px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: #fff;
    color: var(--slate-700);
    transition: all 0.15s;
}

.task-form__toggle-btn--active {
    background: var(--slate-800);
    color: #fff;
}

.task-form__field {
    margin-bottom: 20px;
}

.task-form__label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--slate-900);
    margin-bottom: 6px;
}

.task-form__input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--slate-700);
    border: 1px solid var(--slate-300);
    border-radius: 5px;
    background: #fff;
    transition: border-color 0.15s;
}

.task-form__input:focus {
    outline: none;
    border-color: var(--slate-500);
}

.task-form__input--readonly {
    background: var(--slate-100);
}

.task-form__textarea {
    resize: vertical;
    min-height: 80px;
}

.task-form__date-row {
    display: flex;
    gap: 12px;
}

.task-form__photo-upload {
    width: 80px;
    height: 80px;
    border: 1px dashed var(--slate-300);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--slate-400);
    transition: border-color 0.15s;
}

.task-form__photo-upload:hover {
    border-color: var(--slate-400);
    color: var(--slate-500);
}

.task-form__photo-upload .material-symbols-sharp {
    font-size: 28px;
}

/* ============================================================
   Key-Value List
   ============================================================ */

.kv-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
}

.kv-list__key {
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-900);
    line-height: 1.35;
}

.kv-list__value {
    font-size: 15px;
    font-weight: 400;
    color: var(--slate-700);
    line-height: 1.35;
}

.side-panel__divider {
    border: none;
    border-top: 1px solid var(--slate-200);
    margin: 0 0 24px 0;
}

/* Address mapping status icon */
.address-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.address-status svg {
    flex-shrink: 0;
}

/* Side Panel - Address mapping status */
.side-panel__unmapped {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--slate-400);
}

.side-panel__unmapped svg {
    flex-shrink: 0;
}

.side-panel__unmapped a {
    color: var(--brand);
}

.side-panel__section.is-editing .kv-list {
    display: none;
}

/* Side Panel - Inline edit */
.side-panel__form {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.side-panel__section.is-editing .side-panel__grid {
    display: none;
}

.side-panel__section.is-editing .side-panel__form {
    display: flex;
}

.side-panel__section.is-editing .btn-edit-toggle {
    display: none;
}

.side-panel__form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-panel__form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-500);
}

.side-panel__form-input {
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--slate-700);
    border: 1px solid var(--slate-300);
    border-radius: 5px;
    background: #fff;
    transition: border-color 0.15s;
}

.side-panel__form-input:focus {
    outline: none;
    border-color: var(--slate-400);
}

.side-panel__form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Side Panel - Task list */
.side-panel__tasks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

a.side-panel__task {
    text-decoration: none;
    color: inherit;
    display: block;
}

.side-panel__task {
    padding: 12px 4px;
    border: none;
    border-bottom: 1px solid var(--slate-200);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.side-panel__task:last-child {
    border-bottom: none;
}

.side-panel__task:hover {
    background: var(--slate-50);
}

.side-panel__task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.side-panel__task-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-800);
}

.side-panel__task-status {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--slate-100);
    color: var(--slate-600);
}

.side-panel__task-status--done {
    background: #DCFCE7;
    color: #166534;
}

.side-panel__task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: var(--slate-500);
}

.side-panel__task-detail {
    margin-top: 6px;
    font-size: 15px;
    color: var(--slate-700);
}

/* Side Panel - Assets list */
.side-panel__assets {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

a.side-panel__asset {
    text-decoration: none;
    color: inherit;
}

.side-panel__asset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--slate-200);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.side-panel__asset:last-child {
    border-bottom: none;
}

.side-panel__asset:hover {
    background: var(--slate-50);
}

.side-panel__asset-icon {
    font-size: 22px;
    color: var(--slate-400);
}

.side-panel__asset-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.side-panel__asset-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--slate-800);
}

.side-panel__asset-sub {
    font-size: 15px;
    color: var(--slate-500);
}

