/* ==========================================================================
   ROHRENDORF NETZVERWALTUNG DESIGN SYSTEM
   ========================================================================== */
:root {
    --brand-dark: #111827;
    --brand-blue: #0d529c;
    --brand-blue-hover: #093b72;
    --bg-dashboard: #f7f6f4;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-border-hover: #d1d5db;
    --text-main: #111827;
    --text-muted: #6b7280;
    --text-desc: #4b5563;
    
    --sheets-green: #0f9d58;
    --sheets-green-dark: #0b8043;
    --border-color: #dadce0;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-title: 'Outfit', 'Inter', sans-serif;
    --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASICS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.dashboard-theme {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: var(--bg-dashboard);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
}

.hide {
    display: none !important;
}

.text-blue-primary {
    color: var(--brand-blue) !important;
}

.text-dark {
    color: var(--brand-dark) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Buttons */
.btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

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

.btn-primary:hover {
    background-color: var(--brand-blue-hover);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
}

.btn-outline:hover {
    background-color: #f3f4f6;
    color: var(--text-main);
}

.btn-danger {
    background-color: #d93025;
    color: white;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn-logout-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
}

.btn-logout-icon:hover {
    color: #d93025;
    background-color: #fee2e2;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--brand-blue);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 0;
}

.btn-link:hover {
    color: var(--brand-blue-hover);
}

/* ==========================================================================
   EXACT ROHRENDORF LOGO COMPONENT
   ========================================================================== */
.rohrendorf-logo-component {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.rohrendorf-logo-component .logo-arch-svg {
    position: absolute;
    top: -14px;
    left: -12px;
    pointer-events: none;
    z-index: 1;
}

.rohrendorf-logo-component .logo-text-block {
    display: flex;
    flex-direction: column;
    font-family: 'Playfair Display', Georgia, serif;
    color: #111827;
    line-height: 0.82;
    position: relative;
    z-index: 2;
    padding: 8px 12px;
}

.rohrendorf-logo-component .logo-line-1 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.5px;
}

.rohrendorf-logo-component .logo-line-2 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.5px;
    margin-left: 26px;
}

/* Size Variants */
.rohrendorf-logo-component.small {
    cursor: pointer;
}
.rohrendorf-logo-component.small .logo-line-1,
.rohrendorf-logo-component.small .logo-line-2 {
    font-size: 17px;
}
.rohrendorf-logo-component.small .logo-line-2 {
    margin-left: 14px;
}
.rohrendorf-logo-component.small .logo-text-block {
    padding: 2px 4px;
}
.rohrendorf-logo-component.small .logo-arch-svg {
    top: -8px;
    left: -8px;
}

.rohrendorf-logo-component.header-main .logo-line-1,
.rohrendorf-logo-component.header-main .logo-line-2 {
    font-size: 36px;
}
.rohrendorf-logo-component.header-main .logo-line-2 {
    margin-left: 30px;
}

/* ==========================================================================
   LOGIN SCREEN OVERLAY
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-dashboard);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.login-overlay.active {
    display: flex;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--card-border);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 1rem;
}

.brand-text-large {
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 700;
    color: var(--brand-dark);
    letter-spacing: -0.5px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, 
.select-field, 
.input-field {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus, 
.select-field:focus,
.input-field:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(13, 82, 156, 0.15);
}

.error-msg {
    background-color: #fce8e6;
    color: #c5221f;
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 1rem;
    font-size: 13px;
    text-align: center;
    border: 1px solid #fad2cf;
}

/* ==========================================================================
   TOP NAVIGATION HEADER
   ========================================================================== */
.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dashboard);
}

.top-nav-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-titles {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-name {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-dark);
    letter-spacing: -0.3px;
}

.brand-tag {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    margin-top: 2px;
}

/* View Tabs Switcher */
.view-tabs-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-view-btn {
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.nav-view-btn:hover {
    background-color: #f3f4f6;
    color: var(--brand-dark);
}

.nav-view-btn.active {
    background-color: #e8f0fe;
    color: var(--brand-blue);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
}

.user-role-badge {
    background-color: #e5e7eb;
    color: var(--brand-dark);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* ==========================================================================
   VIEW SWITCHING SECTIONS
   ========================================================================== */
.main-view-section {
    display: none;
    flex-grow: 1;
    overflow: hidden;
}

.main-view-section.active-view {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   VIEW 1: ROHRENDORF DASHBOARD VIEW
   ========================================================================== */
#view-dashboard {
    overflow-y: auto;
}

.dashboard-wrapper {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 60px 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Header Title Block */
.dash-title-section {
    margin-bottom: 8px;
}

.dash-brand-block {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.dash-title-texts .brand-subtitle {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.dash-title-texts .brand-main-title {
    font-family: var(--font-title);
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-dark);
    margin: 2px 0 4px 0;
    letter-spacing: -0.5px;
}

.dash-title-texts .brand-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* 4 KPI Grid Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kpi-box {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 120px;
}

.kpi-box-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.kpi-box-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
}

.kpi-box-date {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 4px 0;
}

.kpi-box-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Categories & Action Cards */
.dash-category-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-header {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.action-cards-grid {
    display: grid;
    gap: 16px;
}

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

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

.action-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--card-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: var(--card-border-hover);
    box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.06);
}

.card-arch-icon {
    margin-bottom: 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 6px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-desc);
    line-height: 1.4;
}

.dash-footer-link {
    margin-top: 10px;
}

/* ==========================================================================
   VIEW 2: TABELLENANSICHT (Spreadsheet Layout)
   ========================================================================== */
.table-view-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sheet-toolbar {
    background-color: #f1f3f4;
    border-bottom: 1px solid var(--border-color);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    flex-shrink: 0;
}

.tb-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.tb-btn:hover {
    background-color: #e8f0fe;
    color: var(--brand-blue);
}

.tb-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
}

.tb-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tb-search-wrapper input {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 4px 8px 4px 28px;
    font-size: 12px;
    outline: none;
    width: 240px;
    transition: var(--transition-fast);
}

.tb-search-wrapper input:focus {
    border-color: var(--sheets-green);
    width: 300px;
}

.tb-search-wrapper .search-icon {
    position: absolute;
    left: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.tb-info-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

#sync-status.online {
    color: var(--sheets-green);
    font-weight: 500;
}

/* Formula Bar */
.formula-bar {
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    height: 28px;
    background-color: white;
    flex-shrink: 0;
}

.cell-address-box {
    width: 60px;
    text-align: center;
    font-weight: 500;
    font-size: 12px;
    border-right: 1px solid var(--border-color);
    color: var(--text-muted);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fx-icon {
    width: 30px;
    text-align: center;
    font-style: italic;
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
}

.formula-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: 12px;
    color: #202124;
    height: 100%;
}

/* Spreadsheet Grid */
.sheet-grid-container {
    flex-grow: 1;
    overflow: hidden;
    background-color: #f8f9fa;
    position: relative;
}

.grid-scroll-area {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.spreadsheet-table {
    border-collapse: collapse;
    font-size: 13px;
    background-color: white;
    width: max-content;
    table-layout: fixed;
}

.spreadsheet-table th {
    background-color: #f8f9fa;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-align: center;
    padding: 4px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    height: 25px;
    user-select: none;
}

.spreadsheet-table th:first-child {
    left: 0;
    z-index: 12;
}

.row-header {
    background-color: #f8f9fa;
    color: var(--text-muted);
    text-align: center;
    font-size: 11px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    left: 0;
    z-index: 8;
    width: 45px;
    font-weight: 500;
    user-select: none;
}

.spreadsheet-table td.sheet-cell {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 3px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 24px;
    outline: none;
}

.spreadsheet-table td.sheet-cell:focus {
    box-shadow: inset 0 0 0 2px var(--sheets-green);
    position: relative;
    z-index: 2;
    background-color: white !important;
    text-overflow: clip;
    overflow: visible;
}

.row-delete-btn-col {
    width: 35px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
}

.btn-cell-delete {
    background: transparent;
    border: none;
    color: #ea4335;
    cursor: pointer;
    opacity: 0.3;
}

.spreadsheet-table tr:hover .btn-cell-delete {
    opacity: 1;
}

/* Tabs Footer */
.sheet-tabs-footer {
    background-color: #f1f3f4;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    flex-shrink: 0;
}

.tab-list-container {
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.tab-btn {
    border: none;
    background-color: transparent;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 16px;
    height: calc(100% - 2px);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border-right: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.tab-btn:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.tab-btn.active {
    background-color: #ffffff;
    color: var(--sheets-green-dark);
    height: 100%;
    border-bottom: 3px solid var(--sheets-green);
    border-radius: 4px 4px 0 0;
}

.sheet-stats {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   ORIGINAL GOOGLE SHEET COLUMN & CELL COLOR SCHEMES
   ========================================================================== */
/* Green Section (Startpunkt, Zwischenpunkte, Endpunkt, Versorgungspunkt) */
.header-col-green {
    background-color: #b6d7a8 !important;
    color: #1e4620 !important;
    font-weight: 700 !important;
}

.cell-col-green {
    background-color: #d9ead3 !important;
    color: #1f381f;
}

/* Red / Coral Section (POP, Zwischenpunkt, FCP, Strecke_m, Rohrtyp, Mikrorohre) */
.header-col-red {
    background-color: #ea9999 !important;
    color: #5c1818 !important;
    font-weight: 700 !important;
}

.cell-col-red {
    background-color: #f4ccd0 !important;
    color: #4a1818;
}

/* Microduct Tube Badges (Column B & C in Rohrverbände) */
.duct-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.duct-lr-1 { background-color: #ea4335; color: #ffffff; }
.duct-lr-2 { background-color: #34a853; color: #ffffff; }
.duct-lr-3 { background-color: #4285f4; color: #ffffff; }
.duct-lr-4 { background-color: #ffff00; color: #111827; }
.duct-lr-5 { background-color: #ffffff; color: #111827; border: 1px solid #ccc; }
.duct-lr-6 { background-color: #833c0b; color: #ffffff; }
.duct-lr-7 { background-color: #444444; color: #ffffff; }
.duct-lr-orange { background-color: #ff6600; color: #ffffff; }

/* Inline Color Picker Popover for Duct & Fiber Colors */
.color-picker-popover {
    position: absolute;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 260px;
    animation: fadeIn 0.15s ease-out;
}

.color-picker-item {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-picker-item:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Geocoding Progress Banner */
.geocode-progress-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: fadeIn 0.2s ease-out;
}

.geocode-progress-banner .progress-info {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    display: flex;
    align-items: center;
    gap: 8px;
}

.geocode-progress-banner .progress-bar-track {
    width: 100%;
    height: 6px;
    background: #dbeafe;
    border-radius: 3px;
    overflow: hidden;
}

.geocode-progress-banner .progress-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.25s ease-out;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.status-built, .status-ja {
    background-color: #d9f2d0;
    color: #0b8043;
    border: 1px solid #b6d7a8;
}

.status-mounting {
    background-color: #fef7e0;
    color: #b06000;
    border: 1px solid #fbbc04;
}

.status-order {
    background-color: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #aecbfa;
}

.status-storno, .status-nein {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #fad2cf;
}

/* Fiber Tags */
.fiber-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
}

.fiber-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.fiber-rt .fiber-dot { background-color: #ea4335; }
.fiber-gn .fiber-dot { background-color: #34a853; }
.fiber-bl .fiber-dot { background-color: #4285f4; }
.fiber-ge .fiber-dot { background-color: #fbbc04; }
.fiber-ws .fiber-dot { background-color: #ffffff; border-color: #ccc; }
.fiber-sw .fiber-dot { background-color: #000000; }
.fiber-vi .fiber-dot, .fiber-pu .fiber-dot { background-color: #7030a0; }
.fiber-or .fiber-dot { background-color: #ff6600; }
.fiber-br .fiber-dot { background-color: #833c0b; }
.fiber-gr .fiber-dot { background-color: #a5a5a5; }
.fiber-rs .fiber-dot { background-color: #ff99ff; }
.fiber-tk .fiber-dot { background-color: #11c6d9; }

/* ==========================================================================
   VIEW 3: KARTENDARSTELLUNG (Leaflet Map View)
   ========================================================================== */
.map-view-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-toolbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.map-title-block h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-dark);
}

.map-title-block .map-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.map-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.select-field-sm, .input-field-sm {
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
}

.leaflet-map-container {
    flex-grow: 1;
    width: 100%;
    background-color: #e5e7eb;
}

.leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 4px;
}

.map-popup-card {
    font-family: var(--font-sans);
    padding: 6px;
}

.map-popup-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
    margin-bottom: 4px;
}

.map-popup-card p {
    font-size: 12px;
    color: var(--text-desc);
    margin-bottom: 4px;
}

/* ==========================================================================
   MODAL WINDOWS & TOASTS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--card-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-md { max-width: 500px; }
.modal-lg { max-width: 800px; }

.modal-header {
    background-color: #f9fafb;
    border-bottom: 1px solid var(--card-border);
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.form-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

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

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

.users-table th, 
.users-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}

.users-table th {
    background-color: #f9fafb;
    font-weight: 700;
    color: var(--text-muted);
}

.stats-box {
    background-color: #f3f4f6;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background-color: #1f2937;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-left: 4px solid var(--sheets-green); }
.toast.danger { border-left: 4px solid #d93025; }
