:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    direction: rtl;
}

/* Header Styles */
.main-header {
    background-color: var(--primary-color);
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 500;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: white;
    box-shadow: -2px 0 4px rgba(0,0,0,0.1);
    transition: width 0.3s ease;
    z-index: 999;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-toggle {
    position: absolute;
    left: -40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 4px 0 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: #34495e;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link:hover {
    background-color: #f8f9fa;
    color: var(--secondary-color);
}

.sidebar-link.active {
    background-color: #e3f2fd;
    color: var(--secondary-color);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--secondary-color);
}

.sidebar-link i {
    font-size: 1.2rem;
    margin-left: 15px;
    min-width: 24px;
}

.sidebar.collapsed .sidebar-link span {
    display: none;
}

.sidebar.collapsed .sidebar-link {
    justify-content: center;
}

.sidebar.collapsed .sidebar-link i {
    margin-left: 0;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    transition: margin-right 0.3s ease;
    min-height: calc(100vh - var(--header-height));
}

.main-content.expanded {
    margin-right: var(--sidebar-collapsed-width);
}

/* Card Styles */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #666;
    font-size: 0.9rem;
}

.stat-card.success {
    border-right: 4px solid var(--success-color);
    background: linear-gradient(to left, rgba(39, 174, 96, 0.05), white);
}

.stat-card.warning {
    border-right: 4px solid var(--warning-color);
    background: linear-gradient(to left, rgba(243, 156, 18, 0.05), white);
}

.stat-card.danger {
    border-right: 4px solid var(--danger-color);
    background: linear-gradient(to left, rgba(231, 76, 60, 0.05), white);
}

/* Project Cards */
.project-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    text-decoration: none;
    color: inherit;
}

.project-rating {
    font-size: 2rem;
    font-weight: bold;
}

.project-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-approved {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-rejected {
    background-color: #f8d7da;
    color: #721c24;
}

/* Form Styles */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.form-select-lg {
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    font-size: 1.1rem;
}

.form-switch {
    padding-right: 2.5em;
}

.form-switch .form-check-input {
    margin-right: -2.5em;
    margin-left: 0;
}

.form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

/* New Lead Page Styles */
.new-lead-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
    padding: 0;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 25px;
    right: 12.5%;
    left: 12.5%;
    height: 4px;
    background-color: #ddd;
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    padding: 10px;
    position: relative;
    z-index: 2;
}

.step::before,
.step::after {
    display: none;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
    position: relative;
    z-index: 3;
}

.step.active .step-number {
    background-color: var(--secondary-color);
}

.step.completed .step-number {
    background-color: var(--success-color);
}

.progress-line {
    position: absolute;
    top: 25px;
    right: 12.5%;
    height: 4px;
    background-color: var(--success-color);
    z-index: 1;
    transition: width 0.5s ease;
    width: 0;
}

/* ── Has Units Data toggle fix ── */
#hasUnitsData {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

#hasUnitsData + label {
    cursor: pointer;
    line-height: 1.5rem;
}

/* Alert Styles */
.fade-alert {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow: hidden;
    max-height: 100px;
}

.delta-alert {
    transition: all 0.3s ease;
}

.delta-alert.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.delta-alert.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

/* Score Display Styles */
.score-display-container {
    position: relative;
}

.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
}

.score-svg {
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 10;
}

.score-progress {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 1s ease-in-out, stroke 0.3s ease;
}

.score-progress.score-success {
    stroke: var(--success-color);
}

.score-progress.score-warning {
    stroke: var(--warning-color);
}

.score-progress.score-danger {
    stroke: var(--danger-color);
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-label {
    font-size: 1rem;
    color: #666;
}

/* Score Breakdown */
.score-item {
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.score-bar {
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    width: 0;
    transition: width 0.8s ease-in-out;
    border-radius: 2px;
}

.score-item .score-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.score-item .score-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* Summary Styles */
.summary-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.summary-item label {
    font-weight: 500;
    color: #666;
    margin-bottom: 5px;
    display: block;
}

.summary-value {
    font-size: 1.1rem;
    color: #333;
}

/* Button Styles */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Utility Classes */
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.bg-success-light { background-color: rgba(39, 174, 96, 0.1); }
.bg-warning-light { background-color: rgba(243, 156, 18, 0.1); }
.bg-danger-light { background-color: rgba(231, 76, 60, 0.1); }

/* Charts Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Settings Tabs */
.settings-tabs {
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 30px;
}

.settings-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.settings-tab:hover {
    color: var(--secondary-color);
}

.settings-tab.active {
    color: var(--secondary-color);
    font-weight: 500;
}

.settings-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--secondary-color);
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Mobile-friendly action buttons */
.action-buttons-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Mobile Sidebar Overlay */
@media (max-width: 768px) {
    /* Overlay background */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Sidebar takes full width on mobile */
    .sidebar {
        width: 80%;
        max-width: 300px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Hide the sidebar toggle on mobile - use hamburger in header instead */
    .sidebar-toggle {
        display: none;
    }

    /* Main content doesn't need margin on mobile */
    .main-content {
        margin-right: 0;
    }

    .main-content.expanded {
        margin-right: 0;
    }
}

/* Hamburger menu for mobile */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* Dark mode support */
[data-theme="dark"] .action-buttons-container {
    background: var(--bg-secondary);
}

/* Important Toggle Section */
.important-toggle {
    background-color: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
    margin: 20px 0;
    transition: all 0.3s ease;
}

.important-toggle:hover {
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.important-toggle .form-check-input {
    width: 3em;
    height: 1.5em;
    margin-top: 0;
}

.important-toggle .form-check-label {
    font-size: 1.2rem;
    font-weight: 500;
    margin-right: 15px;
    color: var(--primary-color);
}

.important-toggle::before {
    content: "⚠️";
    font-size: 1.5rem;
    margin-left: 10px;
    vertical-align: middle;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.info-item label {
    font-weight: 500;
    color: #666;
}

/* Desktop: make the general info card data more pronounced
   so it visually fills the card next to the tall calc card  */
@media (min-width: 768px) {
    /* Only target the מידע כללי card specifically */
    .col-md-6:first-child .info-item {
        padding: 18px 0;
    }

    .col-md-6:first-child .info-item label {
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color);
        letter-spacing: 0.01em;
    }

    .col-md-6:first-child .info-item span {
        font-size: 1.15rem;
        font-weight: 500;
        color: #222;
    }

    .col-md-6:first-child .card-title {
        font-size: 1.2rem;
        margin-bottom: 0.75rem !important;
    }
}

/* Mobile: keep layout as-is, just make text bolder for
   consistency with the new desktop look                   */
@media (max-width: 767.98px) {
    .col-12.col-md-6:first-child .info-item label {
        font-weight: 600;
    }

    .col-12.col-md-6:first-child .info-item span {
        font-weight: 500;
    }
}

/* =====================================================
   General Info Card — Tile Grid (מידע כללי)
   ===================================================== */

.general-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr; /* 3 rows: row1 has 2 tiles,
                                        row2 has 2 tiles,
                                        row3 has the full-width hero */
    gap: 0.85rem;
    height: 100%;
}

.info-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1.25rem 1.25rem;
    border: 1px solid #eef0f2;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    min-height: 0;
}

.info-tile:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

/* Spans both columns — used for the hero stat (planned units) */
.info-tile--full {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(
        to left,
        rgba(52, 152, 219, 0.07),
        rgba(52, 152, 219, 0.03)
    );
    border-color: rgba(52, 152, 219, 0.2);
}

.info-tile-label {
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
}

.info-tile-label i {
    color: var(--secondary-color);
}

.info-tile-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

/* Hero value — planned units gets extra size */
.info-tile-value--hero {
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.info-tile-unit {
    font-size: 1rem;
    font-weight: 500;
    color: #888;
    margin-right: 4px;
}

/* ── Mobile: revert to single-column stacked list ── */
@media (max-width: 767.98px) {
    .general-info-grid {
        grid-template-columns: 1fr;
        grid-template-rows: unset;   /* let rows size naturally on mobile */
        gap: 0;
        height: auto;
    }

    .info-tile {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        border: none;
        border-bottom: 1px solid #eee;
        border-radius: 0;
        padding: 10px 0;
        box-shadow: none;
        transform: none;
        min-height: unset;
    }

    .info-tile:hover {
        box-shadow: none;
        transform: none;
    }

    .info-tile:last-child {
        border-bottom: none;
    }

    .info-tile--full {
        grid-column: unset;
        background: transparent;
        border-color: #eee;
    }

    .info-tile-label {
        font-size: 0.875rem;
        text-transform: none;
        letter-spacing: 0;
        font-weight: 600;
        color: #666;
    }

    .info-tile-value {
        font-size: 1rem;
        font-weight: 600;
    }

    .info-tile-value--hero {
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color);
    }
}

.score-breakdown-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.score-item-detail .score-value {
    font-weight: bold;
    color: #333;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    right: 0;
    top: 5px;
    width: 16px;
    height: 16px;
    background-color: #3498db;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-content {
    margin-right: 30px;
}

.timeline-header {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .display-3 {
        font-size: 2.5rem;
    }
}

/* Land Registry Toggle */
.land-registry-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-direction: row-reverse;
}

.land-registry-toggle .form-check-input {
    margin: 0;
    flex-shrink: 0;
    position: relative;
    width: 3em;
    height: 1.5em;
}

.land-registry-toggle .form-check-label {
    margin: 0;
    white-space: nowrap;
    font-size: 1.2rem;
    font-weight: 500;
}

.project-rating-large {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
}

.project-card-full {
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card-full:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.project-details p {
    font-size: 0.9rem;
}

.project-details i {
    width: 20px;
    margin-left: 5px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.weight-item {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.cities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.city-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-radius: 20px;
}

.city-item button {
    padding: 2px 8px;
}

/* Theme Toggle Animations */
#themeIcon {
    transition: transform 0.3s ease;
}

.theme-toggle:active #themeIcon {
    transform: scale(0.8);
}

/* proper contrast in both themes */
[data-theme="dark"] .badge {
    filter: brightness(0.9) contrast(1.1);
}

/* Header Brand Styling */
.header-brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    transition: opacity 0.3s ease;
}

.header-brand:hover {
    opacity: 0.8;
    color: white;
}

.brand-icon {
    font-size: 2rem;
    color: #f39c12;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Remove old header-title if it exists */
.header-title {
    display: none;
}

/* Comparison Page Styles */
.comparison-table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comparison-table {
    margin-bottom: 0;
}

.comparison-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

.comparison-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.project-header {
    text-align: center;
}

.project-selector select {
    height: 200px;
}

/*alert on mobile */
@media (max-width: 768px) {
    .fade-alert {
        max-height: none !important;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    #unitsWarning {
        overflow: visible;
        line-height: 1.5;
    }
}

.alert {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* File Upload Styles */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-area.drag-over {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.02);
}

.uploaded-files {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.file-item:hover {
    background-color: #e9ecef;
}

.file-icon {
    font-size: 1.5rem;
    margin-left: 10px;
}

.file-icon.pdf { color: #dc3545; }
.file-icon.image { color: #28a745; }
.file-icon.cad { color: #6610f2; }

.file-info {
    flex: 1;
    text-align: right;
}

.file-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Comments Styles */
.comment-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    border-right: 3px solid var(--secondary-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-role {
    font-size: 0.85rem;
    color: #6c757d;
    margin-right: 5px;
}

.comment-time {
    font-size: 0.85rem;
    color: #6c757d;
}

.comment-body {
    line-height: 1.6;
    white-space: pre-wrap;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.comment-actions button {
    font-size: 0.85rem;
    padding: 4px 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Mobile responsiveness for file upload and comments */
@media (max-width: 768px) {
    .upload-area {
        padding: 20px;
        font-size: 0.9rem;
    }

    .upload-area .display-4 {
        font-size: 2rem;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .file-icon {
        font-size: 1.2rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .comment-actions {
        flex-wrap: wrap;
    }

    .comment-actions button {
        flex: 1;
        min-width: 80px;
    }
}

/* User Account Styles */
.user-account {
    display: flex;
    align-items: center;
}

.user-menu .dropdown-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.user-menu .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Role-based badges */
.badge.bg-warning { /* Project Manager */
    background-color: #f39c12 !important;
}

.badge.bg-info { /* Architect */
    background-color: #3498db !important;
}

.badge.bg-success { /* Appraiser */
    background-color: #27ae60 !important;
}

.badge.bg-danger { /* CEO */
    background-color: #e74c3c !important;
}

/* Auth Modal Styles */
.modal-header {
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
}

.modal-header .modal-title {
    direction: rtl;
    text-align: right;
    flex: 1;
}

.modal-header .btn-close {
    filter: invert(1);
    margin-right: auto;
    margin-left: 0;
}

/* Toast Container */
.toast-container {
    z-index: 9999;
}

/* Permission-based hiding */
[data-permission] {
    transition: opacity 0.3s ease;
}

[data-permission].hiding {
    opacity: 0;
}

/* Login prompt overlay */
.login-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.login-prompt {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .user-menu .dropdown-toggle {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }

    .user-menu .badge {
        display: none;
    }

    .modal-dialog {
        margin: 1rem;
    }
}

/* Go/No-Go Decision Styles */
.decision-buttons .btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.decision-history {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
}

.decision-item {
    padding: 5px 0;
}

/* CEO Dashboard Styles */
.ceo-only .card {
    border-width: 2px;
}

.ceo-only .stat-card {
    position: relative;
    overflow: hidden;
}

.ceo-only .stat-card .display-4 {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Unauthorized Message */
.unauthorized-message {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unauthorized-message .alert {
    max-width: 500px;
    padding: 3rem;
}

/* Team Activity Table */
#teamActivityTable td {
    vertical-align: middle;
}

/* Dark mode support */
[data-theme="dark"] .ceo-only .card-header.bg-warning {
    background-color: #d39e00 !important;
    color: white !important;
}

[data-theme="dark"] .decision-buttons .btn {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Loading re-direction overlay */
.redirect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.redirect-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.unauthorized-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.unauthorized-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Audit Logs Page
   ============================================ */
.audit-logs-container {
    max-width: 1400px;
    margin: 0 auto;
}

.audit-logs-table {
    font-size: 0.9rem;
}

.audit-logs-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    padding: 12px 10px;
}

.audit-logs-table tbody tr {
    transition: background-color 0.15s ease;
}

.audit-logs-table tbody tr:hover {
    background-color: #f1f7fd;
}

.audit-logs-table code {
    background-color: #f1f3f5;
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.audit-log-row {
    cursor: pointer;
}

.entity-link {
    color: var(--secondary-color);
    font-weight: 500;
}

.entity-link:hover {
    color: #2980b9;
    text-decoration: underline !important;
}

.entity-link i {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Log detail modal pre blocks */
#logDetailModal pre {
    font-size: 0.8rem;
    line-height: 1.5;
    border: 1px solid #e9ecef;
}

#logDetailModal h6 {
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Dark mode support for audit logs */
[data-theme="dark"] .audit-logs-table thead th {
    background-color: var(--bg-secondary, #2c3e50);
    color: #e0e0e0;
    border-bottom-color: #444;
}

[data-theme="dark"] .audit-logs-table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

[data-theme="dark"] .audit-logs-table code {
    background-color: #2c3e50;
    color: #e0e0e0;
}

[data-theme="dark"] #logDetailModal pre {
    background-color: #1a1a1a !important;
    color: #e0e0e0;
    border-color: #444;
}

/* Mobile responsiveness for audit logs */
@media (max-width: 768px) {
    .audit-logs-table {
        font-size: 0.8rem;
    }

    .audit-logs-table thead th,
    .audit-logs-table tbody td {
        padding: 8px 6px;
    }

    .audit-logs-container .card-body .row.g-3 {
        row-gap: 0.5rem !important;
    }
}

/* ===================== Map Picker Modal ===================== */

.map-search-bar {
    position: relative;
    background-color: #f8f9fa;
}

.map-autocomplete-list {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.map-autocomplete-list.visible {
    display: block;
}

.map-autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.map-autocomplete-item:hover,
.map-autocomplete-item.highlighted {
    background-color: #e3f2fd;
    color: var(--secondary-color);
}

.map-autocomplete-item i {
    color: #aaa;
    flex-shrink: 0;
}

.map-instruction-banner {
    background-color: #fff8e1;
    border-bottom: 1px solid #ffe082;
    color: #795548;
    padding: 8px 16px;
    font-size: 0.875rem;
    text-align: center;
}

.map-selected-preview {
    padding: 14px 20px;
    background-color: #f0f7ff;
    border-top: 1px solid #cce5ff;
    min-height: 60px;
}

/* Confirm button pulse when address is ready */
#mapConfirmBtn:not(:disabled) {
    animation: pulse 1.5s ease-in-out 3;
}

/* Dark mode support */
[data-theme="dark"] .map-search-bar {
    background-color: #2d2d2d;
}

[data-theme="dark"] .map-autocomplete-list {
    background-color: #2d2d2d;
    border-color: #444;
}

[data-theme="dark"] .map-autocomplete-item:hover {
    background-color: #3a3a3a;
}

[data-theme="dark"] .map-instruction-banner {
    background-color: #3a3000;
    border-color: #665500;
    color: #ffd54f;
}

[data-theme="dark"] .map-selected-preview {
    background-color: #1a2a3a;
    border-color: #2a4a6a;
}

/* ── Map Picker Modal — Mobile ── */
@media (max-width: 768px) {

    /* Full-screen modal on mobile */
    #mapPickerModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        width: 100%;
        height: 100%;
        min-height: 100%;
    }

    #mapPickerModal .modal-content {
        height: 100%;
        border-radius: 0;
        border: none;
    }

    #mapPickerModal .modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
        padding: 0;
    }

    /* Shrink the map so the confirm button stays visible */
    #googleMapPicker {
        height: 300px !important;
    }

    /* Instruction banner — smaller text */
    .map-instruction-banner {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Make the confirm button full-width and thumb-friendly */
    #mapPickerModal .modal-footer {
        flex-direction: column-reverse;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    #mapPickerModal .modal-footer .btn {
        width: 100%;
    }
}

/* ===================== Map Picker Modal Header ===================== */

#mapPickerModal .modal-header {
    direction: rtl;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

#mapPickerModal .modal-title {
    display: flex;
    align-items: center;
    direction: rtl;
    gap: 0.5rem;
    flex: 1;
}

#mapPickerModal .modal-title i {
    margin: 0;
    flex-shrink: 0;
}

#mapPickerModal .modal-header .btn-close {
    filter: invert(1);
    margin: 0;
    flex-shrink: 0;
    order: -1;
}

/* ================================================================== */

/* ── Station Map Card Body — smooth collapse ── */
#mapCardBody {
    overflow: hidden;
    max-height: 400px;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}

#mapCardBody.collapsed {
    max-height: 0;
    opacity: 0;
}

/* ===================== Land Registry Upload (New Lead Step 3) ===================== */

.land-registry-upload-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    position: relative;
    overflow: hidden;
}

.land-registry-upload-zone:hover {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.1);
}

.land-registry-upload-zone.drag-over {
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.12);
    transform: scale(1.01);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.2);
}

.land-registry-upload-zone.drag-over::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(52, 152, 219, 0.15) 50%,
        transparent 70%
    );
    animation: shimmer 1.2s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.land-registry-upload-zone.has-file {
    border-style: solid;
    border-color: var(--success-color);
    background-color: rgba(39, 174, 96, 0.05);
    cursor: default;
    padding: 20px;
}

.land-registry-upload-zone.has-file:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.15);
}

.upload-zone-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.land-registry-upload-zone:hover .upload-zone-icon {
    transform: translateY(-4px);
}

.upload-zone-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.upload-zone-subtitle {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-zone-hint {
    display: inline-block;
    padding: 6px 14px;
    background-color: #e3f2fd;
    color: var(--secondary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* File Preview Card (after selection) */
.land-registry-file-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: fadeIn 0.4s ease-out;
}

.land-registry-file-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

.land-registry-file-info {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.land-registry-file-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.land-registry-file-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #6c757d;
}

.land-registry-file-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.land-registry-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.land-registry-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.land-registry-status-badge.ready {
    background-color: #d4edda;
    color: #155724;
}

.land-registry-status-badge.uploading {
    background-color: #fff3cd;
    color: #856404;
}

.land-registry-status-badge.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Upload progress bar (shown during final save) */
.land-registry-progress {
    margin-top: 12px;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    display: none;
}

.land-registry-progress.active {
    display: block;
}

.land-registry-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Info banner explaining what the file is used for */
.land-registry-info-banner {
    background-color: #fff8e1;
    border-right: 4px solid var(--warning-color);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #795548;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.land-registry-info-banner i {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Error message */
.land-registry-error {
    margin-top: 12px;
    padding: 10px 14px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

/* Skip button styling */
.land-registry-skip-hint {
    text-align: center;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .land-registry-upload-zone {
        padding: 30px 15px;
    }

    .upload-zone-icon {
        font-size: 3rem;
    }

    .upload-zone-title {
        font-size: 1.1rem;
    }

    .land-registry-file-preview {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .land-registry-file-info {
        text-align: center;
        width: 100%;
    }

    .land-registry-file-meta {
        justify-content: center;
    }

    .land-registry-file-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Dark mode support */
[data-theme="dark"] .land-registry-upload-zone {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .land-registry-upload-zone:hover {
    background-color: rgba(41, 128, 185, 0.1);
    border-color: var(--secondary-color);
}

[data-theme="dark"] .land-registry-upload-zone.drag-over {
    background-color: rgba(41, 128, 185, 0.2);
}

[data-theme="dark"] .land-registry-upload-zone.has-file {
    background-color: rgba(39, 174, 96, 0.1);
    border-color: var(--success-color);
}

[data-theme="dark"] .upload-zone-title {
    color: var(--text-primary);
}

[data-theme="dark"] .upload-zone-subtitle {
    color: var(--text-secondary);
}

[data-theme="dark"] .upload-zone-hint {
    background-color: rgba(52, 152, 219, 0.2);
    color: #5dade2;
}

[data-theme="dark"] .land-registry-file-preview {
    background-color: var(--bg-card);
    box-shadow: 0 2px 8px var(--shadow-color);
}

[data-theme="dark"] .land-registry-file-name {
    color: var(--text-primary);
}

[data-theme="dark"] .land-registry-file-meta {
    color: var(--text-secondary);
}

[data-theme="dark"] .land-registry-info-banner {
    background-color: #3a3000;
    color: #ffd54f;
    border-right-color: var(--warning-color);
}

[data-theme="dark"] .land-registry-progress {
    background-color: var(--border-color);
}

[data-theme="dark"] .land-registry-error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #ec7063;
}

[data-theme="dark"] .land-registry-skip-hint {
    color: var(--text-muted);
}

/* ===================== (Land Registry) — Mobile Button Layout ===================== */

@media (max-width: 768px) {

    /* Stack all three buttons vertically, full-width */
    #formStep3 .d-flex.justify-content-between {
        flex-direction: column-reverse;
        gap: 0.5rem;
    }

    /* The right-side group (skip + continue) also stacks vertically */
    #formStep3 .d-flex.justify-content-between .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
        width: 100%;
    }

    /* All three buttons become full-width */
    #formStep3 .d-flex.justify-content-between .btn {
        width: 100%;
    }
}


/* ===================== END Land Registry Upload ===================== */

/* ── Team Activity Table — fixed column layout ── */
.team-activity-table {
    table-layout: fixed;
    width: 100%;
}

.team-activity-table th:nth-child(1),
.team-activity-table td:nth-child(1) { width: 18%; }  /* שם */

.team-activity-table th:nth-child(2),
.team-activity-table td:nth-child(2) { width: 15%; }  /* תפקיד */

.team-activity-table th:nth-child(3),
.team-activity-table td:nth-child(3) { width: 11%; }  /* לידים */

.team-activity-table th:nth-child(4),
.team-activity-table td:nth-child(4) { width: 10%; }  /* הערות */

.team-activity-table th:nth-child(5),
.team-activity-table td:nth-child(5) { width: 10%; }  /* קבצים */

.team-activity-table th:nth-child(6),
.team-activity-table td:nth-child(6) { width: 14%; }  /* שיעור הצלחה */

.team-activity-table th:nth-child(7),
.team-activity-table td:nth-child(7) { width: 22%; }  /* פעיל לאחרונה */

/* Prevent long text from breaking layout */
.team-activity-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Allow last-active column to wrap if needed */
.team-activity-table td:nth-child(7) {
    white-space: normal;
}

/* ── Team Activity Table — center numeric column headers ── */
.team-activity-table th:nth-child(3),
.team-activity-table th:nth-child(4),
.team-activity-table th:nth-child(5),
.team-activity-table th:nth-child(6) {
    text-align: center;
}
/* =====================================================
   Login Page  (/login)
   ===================================================== */

/*
   When .login-page is on <body>, neutralize the
   .main-content margins so the wrapper can go full bleed.
   We do NOT touch .main-content globally — only on this page.
*/
body.login-page .main-content {
    margin-right: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    min-height: unset !important;
    overflow: hidden;
}

/* Also hide the sidebar on the login page — user isn't authenticated */
body.login-page .sidebar,
body.login-page .sidebar-overlay {
    display: none !important;
}

/* ── Wrapper: fixed, covers the full viewport below the header ── */
.login-page-wrapper {
    position: fixed;
    top: var(--header-height);   /* start right below the fixed header */
    left: 0;
    right: 0;
    bottom: 0;

    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;

    overflow-y: auto;            /* allow scroll on very short viewports */
    overflow-x: hidden;

    background: linear-gradient(135deg, #f5f6fa 0%, #e8f4fd 100%);
    z-index: 10;                 /* above sidebar (z-index 999 is sidebar,
                                    but sidebar is hidden anyway) */
}

/* ── Animated background shapes ── */
.login-bg-shape {
    position: fixed;             /* fixed so they don't scroll with content */
    border-radius: 50%;
    opacity: 0.07;
    background: var(--secondary-color);
    animation: floatShape 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.shape-1 {
    width: 420px;
    height: 420px;
    top: 60px;                   /* below header */
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 260px;
    height: 260px;
    bottom: 0;
    left: -60px;
    animation-delay: 3s;
    background: var(--primary-color);
}

.shape-3 {
    width: 160px;
    height: 160px;
    top: 45%;
    left: 8%;
    animation-delay: 5s;
    background: var(--warning-color);
}

@keyframes floatShape {
    0%, 100% { transform: translateY(0) scale(1); }
    50%       { transform: translateY(-20px) scale(1.05); }
}

/* ── Card container ── */
.login-card-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;

    /*
       On short viewports (laptop with browser chrome),
       allow the container to shrink gracefully.
    */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Brand hero ── */
.login-brand-hero {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.login-brand-icon-wrap {
    width: 72px;
    height: 72px;
    background: var(--primary-color);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.3);
    transition: transform 0.3s ease;
}

.login-brand-icon-wrap:hover {
    transform: rotate(-5deg) scale(1.05);
}

.login-brand-icon-wrap i {
    font-size: 2.2rem;
    color: #f39c12;
}

.login-brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 2px;
    letter-spacing: 0.5px;
}

.login-brand-subtitle {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--secondary-color);
    text-transform: uppercase;
    margin: 0 0 5px;
}

.login-brand-tagline {
    font-size: 0.88rem;
    color: #6c757d;
    margin: 0;
}

/* ── Main card ── */
.login-main-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 40px rgba(44, 62, 80, 0.12);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.login-main-card:hover {
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 16px 48px rgba(44, 62, 80, 0.16);
}

/* ── Card header ── */
.login-card-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.login-card-header i {
    font-size: 1.1rem;
    color: #f39c12;
}

/* ── Card body ── */
.login-card-body {
    padding: 28px 28px 22px;
}

/* ── Field groups ── */
.login-field-group {
    position: relative;
}

.login-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-label i {
    color: var(--secondary-color);
}

.login-input-wrap {
    position: relative;
}

.login-input {
    padding-left: 2.5rem;
    padding-right: 1rem;
    height: 46px;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #f8f9fa;
    direction: ltr;
    text-align: right;
    width: 100%;
}

.login-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    background-color: white;
    outline: none;
}

.login-input.is-invalid {
    border-color: var(--danger-color);
    background-color: #fff8f8;
}

.login-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* Icon inside input */
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input:focus ~ .input-icon {
    color: var(--secondary-color);
}

.login-field-group .invalid-feedback {
    font-size: 0.82rem;
    margin-top: 5px;
    padding-right: 4px;
}

/* ── RTL Remember Me toggle ── */
.login-remember-row {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
}

.login-remember-row .form-check-input {
    float: none;
    flex-shrink: 0;
    margin: 0;
    width: 2.5em;
    height: 1.3em;
    cursor: pointer;
}

.login-remember-row .form-check-label {
    margin: 0;
    cursor: pointer;
    font-size: 0.88rem;
    color: #6c757d;
    user-select: none;
}

/* ── Submit button ── */
.login-submit-btn {
    height: 48px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.3px;
}

.login-submit-btn:hover:not(:disabled) {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.35);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.login-submit-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

/* ── Divider ── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #adb5bd;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e9ecef;
}

/* ── Card footer ── */
.login-card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 11px 28px;
    text-align: center;
    font-size: 0.76rem;
    color: #adb5bd;
    letter-spacing: 0.3px;
}

/* ── Role badges strip ── */
.login-roles-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    width: 100%;
}

.login-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.85);
    color: var(--primary-color);
    border: 1px solid rgba(44, 62, 80, 0.12);
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-role-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.login-role-badge--ceo {
    background-color: rgba(243, 156, 18, 0.12);
    border-color: rgba(243, 156, 18, 0.3);
    color: #b7770d;
}

/* ── Shake animation for error ── */
@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-6px); }
    30%       { transform: translateX(6px); }
    45%       { transform: translateX(-4px); }
    60%       { transform: translateX(4px); }
    75%       { transform: translateX(-2px); }
    90%       { transform: translateX(2px); }
}

.login-shake {
    animation: loginShake 0.5s ease-in-out;
}

/* ── Compact layout for short viewports (e.g. 768px tall laptops) ── */
@media (max-height: 750px) {
    .login-brand-icon-wrap {
        width: 56px;
        height: 56px;
    }

    .login-brand-icon-wrap i {
        font-size: 1.7rem;
    }

    .login-brand-title {
        font-size: 1.5rem;
    }

    .login-brand-hero {
        margin-bottom: 12px;
    }

    .login-card-body {
        padding: 20px 24px 16px;
    }

    .login-field-group.mb-4 {
        margin-bottom: 12px !important;
    }

    .login-remember-row.mb-4 {
        margin-bottom: 12px !important;
    }

    .login-divider {
        margin: 14px 0;
    }

    .login-roles-strip {
        margin-top: 10px;
    }
}

/* ── Mobile (narrow screens) ── */
@media (max-width: 480px) {
    .login-page-wrapper {
        padding: 16px 12px;
        align-items: flex-start;  /* allow scrolling on very small phones */
    }

    .login-brand-icon-wrap {
        width: 60px;
        height: 60px;
    }

    .login-brand-icon-wrap i {
        font-size: 1.8rem;
    }

    .login-brand-title {
        font-size: 1.5rem;
    }

    .login-brand-tagline {
        font-size: 0.82rem;
    }

    .login-card-body {
        padding: 22px 18px 18px;
    }

    .login-card-header {
        padding: 14px 18px;
        font-size: 0.98rem;
    }

    .login-card-footer {
        padding: 10px 18px;
    }

    .login-roles-strip {
        gap: 6px;
    }

    .login-role-badge {
        font-size: 0.7rem;
        padding: 4px 9px;
    }

    /* Hide decorative shapes on small screens — reduce noise */
    .shape-1,
    .shape-2,
    .shape-3 {
        display: none;
    }
}

/* ── Dark mode ── */
[data-theme="dark"] .login-page-wrapper {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .login-main-card {
    background: var(--bg-card, #1e2a3a);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.2),
        0 10px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .login-card-header {
    background: #1a252f;
}

[data-theme="dark"] .login-card-footer {
    background-color: #1a252f;
    border-top-color: #2c3e50;
    color: #6c757d;
}

[data-theme="dark"] .login-brand-title {
    color: #e0e0e0;
}

[data-theme="dark"] .login-brand-subtitle {
    color: #5dade2;
}

[data-theme="dark"] .login-brand-tagline {
    color: #9e9e9e;
}

[data-theme="dark"] .login-label {
    color: #e0e0e0;
}

[data-theme="dark"] .login-input {
    background-color: #2c3e50;
    border-color: #3d5166;
    color: #e0e0e0;
}

[data-theme="dark"] .login-input:focus {
    background-color: #34495e;
    border-color: var(--secondary-color);
}

[data-theme="dark"] .login-input::placeholder {
    color: #6c757d;
}

[data-theme="dark"] .login-remember-row .form-check-label {
    color: #9e9e9e;
}

[data-theme="dark"] .login-divider {
    color: #4a5568;
}

[data-theme="dark"] .login-divider::before,
[data-theme="dark"] .login-divider::after {
    background-color: #2c3e50;
}

[data-theme="dark"] .login-role-badge {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b0bec5;
}

[data-theme="dark"] .login-role-badge--ceo {
    background-color: rgba(243, 156, 18, 0.1);
    border-color: rgba(243, 156, 18, 0.25);
    color: #f39c12;
}

[data-theme="dark"] .login-bg-shape {
    opacity: 0.04;
}

/* =====================================================
   END Login Page
   ===================================================== */

/* Hide tester on small-sized screens */
@media (max-width: 768px) {
    #testUserSwitcher {
        display: none !important;
    }
}

/* =====================================================
   Calculations Card (נתונים וחישובים)
   ===================================================== */

/* ── Section containers ── */
.calc-section {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid #eef0f2;
    background-color: #f8f9fa;
}

/* Output sections: subtle blue-tinted background */
.calc-section--output {
    background-color: #f4f8fd;
    border-color: rgba(52, 152, 219, 0.15);
}

/* Input sections: neutral warm background */
.calc-section--input {
    background-color: #fdfaf4;
    border-color: rgba(243, 156, 18, 0.2);
}

/* Missing data section: sits at the bottom, warning tint */
.calc-section--missing {
    background-color: #fffdf4;
    border-color: rgba(243, 156, 18, 0.25);
}

/* ── Section headers ── */
.calc-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #555;
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
}

.calc-section--output .calc-section-header {
    color: var(--secondary-color);
    border-bottom-color: rgba(52, 152, 219, 0.2);
}

.calc-section--output .calc-section-header i {
    color: var(--secondary-color);
}

.calc-section--input .calc-section-header {
    color: #b07d10;
    border-bottom-color: rgba(243, 156, 18, 0.25);
}

.calc-section--input .calc-section-header i {
    color: var(--warning-color);
}

.calc-section--missing .calc-section-header {
    color: #856404;
    border-bottom-color: rgba(243, 156, 18, 0.25);
}

/* ── Calc grid rows ── */
.calc-grid {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    border-bottom: 1px dashed var(--border-color, #dee2e6);
}

.calc-row:last-child {
    border-bottom: none;
}

/* Highlighted rows — calculated future outputs */
.calc-row--highlight {
    background-color: rgba(39, 174, 96, 0.06);
    border-bottom-color: rgba(39, 174, 96, 0.15);
    border-radius: 5px;
    padding: 0.35rem 0.5rem;
}

.calc-row--highlight:last-child {
    border-bottom: none;
}

.calc-label {
    color: var(--text-secondary, #555);
    font-size: 0.875rem;
}

.calc-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── Missing items ── */
.missing-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    color: #856404;
}

.missing-item i {
    font-size: 0.75rem;
}

.all-complete {
    font-size: 0.85rem;
    color: #198754;
}


/* =====================================================
   Tabu Cards & Tables (נסח טאבו)
   ===================================================== */

/* ── Tabu card wrapper ── */
.tabu-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.tabu-card:last-child {
    margin-bottom: 0;
}

.tabu-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.09);
}

/* ── Tabu card header ── */
.tabu-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tabu-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tabu-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.tabu-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Small pill badges in the card header */
.tabu-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 20px;
    background-color: #e3f2fd;
    color: var(--secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

/* ── Status dot ── */
.tabu-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #ccc;
}

.tabu-status-dot--success {
    background-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

.tabu-status-dot--processing {
    background-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    animation: pulse 1.5s infinite;
}

.tabu-status-dot--failed {
    background-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

/* ── Tabu card body ── */
.tabu-card-body {
    padding: 1rem 1.1rem;
}

/* ── Status banners ── */
.tabu-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.9rem;
    border-radius: 7px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    border: 1px solid transparent;
}

.tabu-status-banner--processing {
    background-color: #e8f4fd;
    border-color: rgba(52, 152, 219, 0.25);
    color: #1a5f8a;
}

.tabu-status-banner--success {
    background-color: #eafaf1;
    border-color: rgba(39, 174, 96, 0.25);
    color: #1a6b3c;
}

.tabu-status-banner--failed {
    background-color: #fdf3e3;
    border-color: rgba(243, 156, 18, 0.3);
    color: #7d4e00;
}

/* ── Tables wrapper ── */
.tabu-tables-wrap {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* ── Individual table section ── */
.tabu-table-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.tabu-table-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
}

.tabu-table-label i {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

/* ── Tabu table base styles ── */
.tabu-table {
    font-size: 0.85rem;
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
}

.tabu-table thead tr {
    background-color: #f8fafc;
}

.tabu-table thead th {
    font-weight: 700;
    font-size: 0.78rem;
    color: #475569;
    text-align: center;
    padding: 0.55rem 0.6rem;
    border-bottom: 2px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.tabu-table thead th:last-child {
    border-right: none;
}

.tabu-table tbody td {
    padding: 0.45rem 0.6rem;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    color: #334155;
}

.tabu-table tbody td:last-child {
    border-right: none;
}

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

.tabu-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Summary table — key numbers get emphasis */
.tabu-table--summary tbody td:nth-child(3),
.tabu-table--summary tbody td:nth-child(4),
.tabu-table--summary tbody td:nth-child(5) {
    font-weight: 600;
    color: var(--primary-color);
}

/* Detail table — sub-parcel number column */
.tabu-table--detail tbody td:first-child {
    font-weight: 700;
    color: var(--secondary-color);
}

/* Notes table — note type badge */
.tabu-note-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* ── Unified tabu view (one table, grouped by plot) ── */
.tabu-unified-statuses {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

/* Plot separator row — labels the גוש/חלקה whose rows follow it */
.tabu-table--unified tbody tr.tabu-plot-group-row td,
.tabu-table--unified tbody tr.tabu-plot-group-row:hover td {
    background-color: #eef2f7;
    border-top: 2px solid #cbd5e1;
    padding: 0.4rem 0.7rem;
    text-align: right;
}

.tabu-plot-group-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tabu-plot-group-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.tabu-plot-group-head .tabu-meta-pill {
    font-size: 0.72rem;
}

/* Grand-total row beneath all plots */
.tabu-table--unified tbody tr.tabu-grand-total-row td,
.tabu-table--unified tbody tr.tabu-grand-total-row:hover td {
    background-color: #f1f5f9;
    border-top: 2px solid #cbd5e1;
    font-weight: 700;
    color: var(--primary-color);
}

/* Active state on the cards/unified view toggle */
.tabu-view-toggle .btn.active {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

/* Mobile responsiveness */
@media (max-width: 767.98px) {
    .tabu-card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tabu-card-meta {
        flex-wrap: wrap;
    }

    .tabu-table {
        font-size: 0.8rem;
    }

    .tabu-table thead th,
    .tabu-table tbody td {
        padding: 0.35rem 0.4rem;
    }

    .calc-section {
        padding: 0.6rem 0.75rem;
    }
}

/* =====================================================
   Address Candidates List (גוש/חלקה → כתובת)
   ===================================================== */

.address-candidates-list {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-top: 0.5rem;
    animation: fadeIn 0.25s ease-out;
}

.address-candidates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.9rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.address-candidates-header .candidates-count {
    background-color: var(--secondary-color);
    color: white;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.address-candidate-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease, transform 0.15s ease;
    background: white;
}

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

.address-candidate-item:hover,
.address-candidate-item:focus-visible {
    background-color: #f0f7ff;
    transform: translateX(-2px);
    outline: none;
}

.address-candidate-item:active {
    background-color: #e3f2fd;
}

.address-candidate-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg,
        rgba(52, 152, 219, 0.12),
        rgba(52, 152, 219, 0.05));
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.address-candidate-body {
    flex: 1;
    min-width: 0;
}

.address-candidate-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-candidate-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.address-candidate-subtitle .meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 12px;
    background-color: #eef2f7;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
}

.address-candidate-action {
    flex-shrink: 0;
    color: #adb5bd;
    transition: color 0.15s ease, transform 0.2s ease;
}

.address-candidate-item:hover .address-candidate-action {
    color: var(--secondary-color);
    transform: translateX(-3px);
}

/* Empty state inside candidates list */
.address-candidates-empty {
    padding: 1.25rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.address-candidates-empty i {
    display: block;
    font-size: 1.75rem;
    margin-bottom: 0.4rem;
    color: #cbd5e0;
}

/* =====================================================
   Inline Status Messages (parcel ↔ address lookups)
   ===================================================== */

.lookup-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.4rem;
    animation: fadeIn 0.25s ease-out;
}

.lookup-status--loading {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.lookup-status--success {
    background-color: #eafaf1;
    color: #1a6b3c;
    border: 1px solid rgba(39, 174, 96, 0.25);
}

.lookup-status--error {
    background-color: #fdecea;
    color: #b03a2e;
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.lookup-status--info {
    background-color: #fff8e1;
    color: #7d4e00;
    border: 1px solid rgba(243, 156, 18, 0.25);
}

.lookup-status .spinner-border-sm {
    width: 0.9rem;
    height: 0.9rem;
    border-width: 0.15em;
}

/* =====================================================
   Toast Notifications (replacement for alert())
   ===================================================== */

.app-toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: white;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 25px rgba(44, 62, 80, 0.15);
    border-right: 4px solid var(--secondary-color);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: rtl;
}

.app-toast.app-toast--leaving {
    animation: toastSlideOut 0.25s ease-in forwards;
}

.app-toast--success { border-right-color: var(--success-color); }
.app-toast--warning { border-right-color: var(--warning-color); }
.app-toast--error   { border-right-color: var(--danger-color); }
.app-toast--info    { border-right-color: var(--secondary-color); }

.app-toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.app-toast--success .app-toast-icon { background-color: var(--success-color); }
.app-toast--warning .app-toast-icon { background-color: var(--warning-color); }
.app-toast--error   .app-toast-icon { background-color: var(--danger-color); }
.app-toast--info    .app-toast-icon { background-color: var(--secondary-color); }

.app-toast-body {
    flex: 1;
    min-width: 0;
}

.app-toast-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 2px;
    line-height: 1.3;
}

.app-toast-message {
    font-size: 0.875rem;
    color: #495057;
    line-height: 1.4;
    word-wrap: break-word;
}

.app-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.app-toast-close:hover {
    color: #495057;
}

.app-toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 0 0 10px 10px;
    animation: toastProgress linear forwards;
}

.app-toast--success .app-toast-progress { background-color: rgba(39, 174, 96, 0.4); }
.app-toast--warning .app-toast-progress { background-color: rgba(243, 156, 18, 0.4); }
.app-toast--error   .app-toast-progress { background-color: rgba(231, 76, 60, 0.4); }
.app-toast--info    .app-toast-progress { background-color: rgba(52, 152, 219, 0.4); }

.app-toast {
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
}

@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0%; }
}

/* =====================================================
   Confirmation Modal (replacement for confirm())
   ===================================================== */

.app-confirm-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 10040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.app-confirm-dialog {
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 440px;
    width: 100%;
    overflow: hidden;
    animation: confirmSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    direction: rtl;
}

.app-confirm-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 0.75rem;
}

.app-confirm-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.app-confirm-dialog--danger  .app-confirm-icon { background-color: var(--danger-color); }
.app-confirm-dialog--warning .app-confirm-icon { background-color: var(--warning-color); }
.app-confirm-dialog--info    .app-confirm-icon { background-color: var(--secondary-color); }
.app-confirm-dialog--success .app-confirm-icon { background-color: var(--success-color); }

.app-confirm-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1.3;
}

.app-confirm-body {
    padding: 0.5rem 1.5rem 1.25rem;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.55;
}

.app-confirm-body p {
    margin: 0 0 0.5rem;
}

.app-confirm-body p:last-child {
    margin-bottom: 0;
}

.app-confirm-detail {
    margin-top: 0.75rem;
    padding: 0.6rem 0.85rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #6c757d;
    border-right: 3px solid #dee2e6;
}

.app-confirm-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.app-confirm-footer .btn {
    min-width: 100px;
    font-weight: 500;
}

@keyframes confirmSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-confirm-backdrop.app-confirm-leaving {
    animation: fadeOut 0.2s ease-in forwards;
}

.app-confirm-backdrop.app-confirm-leaving .app-confirm-dialog {
    animation: confirmSlideOut 0.2s ease-in forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

@keyframes confirmSlideOut {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Mobile tweaks */
@media (max-width: 576px) {
    .app-toast-container {
        top: calc(var(--header-height) + 8px);
        max-width: 100%;
    }

    .app-confirm-dialog {
        border-radius: 12px;
    }

    .app-confirm-footer {
        flex-direction: column-reverse;
    }

    .app-confirm-footer .btn {
        width: 100%;
    }
}

/* Dark mode */
[data-theme="dark"] .address-candidates-list {
    background-color: var(--bg-card, #1e2a3a);
    border-color: #2c3e50;
}

[data-theme="dark"] .address-candidates-header {
    background-color: #1a252f;
    border-bottom-color: #2c3e50;
    color: #b0bec5;
}

[data-theme="dark"] .address-candidate-item {
    background-color: var(--bg-card, #1e2a3a);
    border-bottom-color: #2c3e50;
}

[data-theme="dark"] .address-candidate-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

[data-theme="dark"] .address-candidate-title {
    color: #e0e0e0;
}

[data-theme="dark"] .app-toast {
    background-color: var(--bg-card, #1e2a3a);
}

[data-theme="dark"] .app-toast-title {
    color: #e0e0e0;
}

[data-theme="dark"] .app-toast-message {
    color: #b0bec5;
}

[data-theme="dark"] .app-confirm-dialog {
    background-color: var(--bg-card, #1e2a3a);
}

[data-theme="dark"] .app-confirm-title {
    color: #e0e0e0;
}

[data-theme="dark"] .app-confirm-body {
    color: #b0bec5;
}

[data-theme="dark"] .app-confirm-footer {
    background-color: #1a252f;
    border-top-color: #2c3e50;
}

[data-theme="dark"] .app-confirm-detail {
    background-color: #1a252f;
    color: #9e9e9e;
    border-right-color: #2c3e50;
}

/* =====================================================
   Parcel/Address Lookup Inputs (Step 1 — New Lead)
   ===================================================== */

/* The container holding label + input + lookup button */
.lookup-field {
    position: relative;
}

.lookup-field .form-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lookup-field .form-label i {
    color: var(--secondary-color);
    font-size: 0.95rem;
}

/* Refined input-group for lookup fields */
.lookup-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.lookup-input-group:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
}

.lookup-input-group .form-control {
    border: none;
    background: transparent;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
}

.lookup-input-group .form-control:focus {
    outline: none;
    box-shadow: none;
}

/* The lookup button — sits flush inside the group */
.lookup-btn {
    flex-shrink: 0;
    border: none;
    background: linear-gradient(135deg,
        rgba(52, 152, 219, 0.08),
        rgba(52, 152, 219, 0.03));
    color: var(--secondary-color);
    padding: 0 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.lookup-btn:hover:not(:disabled) {
    background: linear-gradient(135deg,
        var(--secondary-color),
        #2980b9);
    color: white;
}

.lookup-btn:active:not(:disabled) {
    transform: scale(0.97);
}

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

.lookup-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.lookup-btn:hover:not(:disabled) i.bi-search {
    transform: scale(1.15);
}

/* Loading state — replaces the icon with a spinner */
.lookup-btn.is-loading {
    pointer-events: none;
    color: var(--secondary-color);
}

.lookup-btn.is-loading i {
    display: none;
}

.lookup-btn.is-loading::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: lookupSpin 0.7s linear infinite;
}

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

/* Compact gush + helka row */
.parcel-fields-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 0.75rem;
}

@media (max-width: 576px) {
    .parcel-fields-row {
        grid-template-columns: 1fr;
    }
}

/* Dark mode */
[data-theme="dark"] .lookup-input-group {
    background-color: #2c3e50;
    border-color: #3d5166;
}

[data-theme="dark"] .lookup-input-group:focus-within {
    border-color: var(--secondary-color);
}

[data-theme="dark"] .lookup-input-group .form-control {
    color: #e0e0e0;
}

[data-theme="dark"] .lookup-btn {
    background: linear-gradient(135deg,
        rgba(52, 152, 219, 0.15),
        rgba(52, 152, 219, 0.05));
    border-right-color: #3d5166;
}

/* =====================================================
   Additional Address Rows (JS-injected)
   ===================================================== */

#additionalAddressList {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.additional-address-card {
    background: linear-gradient(to left,
        rgba(52, 152, 219, 0.03),
        rgba(52, 152, 219, 0.01));
    border: 1px solid rgba(52, 152, 219, 0.18);
    border-radius: 12px;
    padding: 1rem 1.1rem 1.1rem;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.additional-address-card:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.3);
}

/* Header with number badge + remove button */
.additional-address-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px dashed rgba(52, 152, 219, 0.2);
}

.additional-address-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.additional-address-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.additional-address-remove {
    background: none;
    border: 1px solid transparent;
    color: #adb5bd;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

.additional-address-remove:hover {
    color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.08);
    border-color: rgba(231, 76, 60, 0.2);
}

.additional-address-remove i {
    font-size: 0.95rem;
}

/* Body — input grid inside the card */
.additional-address-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.additional-address-body .parcel-fields-row {
    margin-top: 0;
}

/* Status message inside the card */
.additional-address-status {
    margin-top: 0.5rem;
    min-height: 1px;
}

/* Mobile */
@media (max-width: 576px) {
    .additional-address-card {
        padding: 0.85rem 0.9rem 1rem;
    }

    .additional-address-title {
        font-size: 0.9rem;
    }
}

/* Dark mode */
[data-theme="dark"] .additional-address-card {
    background: linear-gradient(to left,
        rgba(52, 152, 219, 0.08),
        rgba(52, 152, 219, 0.03));
    border-color: rgba(52, 152, 219, 0.25);
}

[data-theme="dark"] .additional-address-title {
    color: #e0e0e0;
}

[data-theme="dark"] .additional-address-remove {
    color: #6c757d;
}

/* =====================================================
   "Add Another Address" button refresh
   ===================================================== */

#addAddressBtn {
    border: 2px dashed rgba(52, 152, 219, 0.4);
    background: transparent;
    color: var(--secondary-color);
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    transition: all 0.25s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#addAddressBtn:hover {
    border-style: solid;
    border-color: var(--secondary-color);
    background-color: rgba(52, 152, 219, 0.06);
    color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.12);
}

#addAddressBtn:active {
    transform: translateY(0);
}

#addAddressBtn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

#addAddressBtn:hover i {
    transform: rotate(90deg) scale(1.1);
}