
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --bg: #f1f5f9;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-focus: #93c5fd;
    --text: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================== HEADER ===================== */
.app-header {
    background: linear-gradient(135deg, #0C2340 0%, #1e3a5f 100%);
    color: white;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 44px;
    width: auto;
    border-radius: 4px;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.pro-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--accent);
    color: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: super;
    letter-spacing: 0.05em;
}

.tagline {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* ===================== BUTTONS ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.2);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
}

/* ===================== MAIN LAYOUT ===================== */
.app-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ===================== PANELS ===================== */
.input-panel,
.chart-panel,
.table-panel,
.notes-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary);
}

.panel-header h2 i {
    color: var(--primary);
    font-size: 0.95rem;
}

.panel-body {
    padding: 24px;
}

.collapse-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition);
}
.collapse-btn:hover {
    background: var(--border);
    color: var(--text);
}

.input-panel.collapsed .panel-body {
    display: none;
}
.input-panel.collapsed .collapse-btn i {
    transform: rotate(180deg);
}

/* ===================== PARAMETER GROUPS ===================== */
.param-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.param-group:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.param-group h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.param-group h3 i {
    color: var(--primary);
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

.param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}
.param-grid:last-child {
    margin-bottom: 0;
}

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

.param-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
}

.param-field .unit {
    color: var(--text-muted);
    font-weight: 400;
}

.param-field input,
.param-field select {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text);
    background: white;
    transition: all var(--transition);
    width: 100%;
}

.param-field input:focus,
.param-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.param-field input:hover,
.param-field select:hover {
    border-color: #cbd5e1;
}

.param-field small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.param-field select {
    font-family: 'Inter', sans-serif;
}

/* ===================== TOGGLE / CHECKBOX ===================== */
.checkbox-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 11px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-switch {
    background: var(--primary);
}

.toggle-label input:checked + .toggle-switch::after {
    transform: translateX(18px);
}

/* ===================== ACTION BAR ===================== */
.action-bar {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

.action-bar .btn {
    min-width: 260px;
    justify-content: center;
}

/* ===================== SUMMARY CARDS ===================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.card-icon.blue { background: #dbeafe; color: #2563eb; }
.card-icon.green { background: #d1fae5; color: #059669; }
.card-icon.orange { background: #ffedd5; color: #ea580c; }
.card-icon.purple { background: #ede9fe; color: #7c3aed; }
.card-icon.red { background: #fee2e2; color: #dc2626; }
.card-icon.teal { background: #ccfbf1; color: #0d9488; }

.card-info {
    display: flex;
    flex-direction: column;
}

.card-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
}

.card-label {
    font-size: 0.72rem;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 2px;
}

/* ===================== CHART ===================== */
.chart-controls {
    display: flex;
    gap: 4px;
    background: var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.chart-controls .btn {
    border-radius: 4px;
    color: var(--text-light);
    background: transparent;
    border: none;
    padding: 4px 14px;
}

.chart-controls .btn.active {
    background: white;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 12px;
    overflow: hidden;
}

.chart-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.profile-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-light);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.dot.bore-path { background: #2563eb; }
.dot.ground-line { background: #65a30d; }
.dot.obstacle-fill { background: rgba(239, 68, 68, 0.3); border: 1px solid #ef4444; }
.dot.depth-line { background: #f59e0b; }

/* ===================== TABLE ===================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 900px;
}

.data-table thead {
    background: #f1f5f9;
    position: sticky;
    top: 0;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr.zone-entry { border-left: 3px solid #2563eb; }
.data-table tbody tr.zone-descend { border-left: 3px solid #f59e0b; }
.data-table tbody tr.zone-level { border-left: 3px solid #10b981; }
.data-table tbody tr.zone-ascend { border-left: 3px solid #8b5cf6; }
.data-table tbody tr.zone-exit { border-left: 3px solid #ec4899; }

.zone-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

.zone-badge.entry { background: #dbeafe; color: #1d4ed8; }
.zone-badge.descend { background: #fef3c7; color: #b45309; }
.zone-badge.level { background: #d1fae5; color: #047857; }
.zone-badge.ascend { background: #ede9fe; color: #6d28d9; }
.zone-badge.exit { background: #fce7f3; color: #be185d; }

/* ===================== PROJECT INFO ===================== */
.param-field input[type="text"] {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: white;
    transition: all var(--transition);
    width: 100%;
}

.param-field input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.param-field input[type="text"]:hover {
    border-color: #cbd5e1;
}

/* Print report header */
.print-report-header {
    display: none;
    margin-bottom: 1.5rem;
    padding: 0;
    background: white;
}

.print-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
}

.print-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.print-logo-icon {
    flex-shrink: 0;
}

.print-logo-img {
    height: 48px;
    width: auto;
    border-radius: 4px;
    object-fit: contain;
}

.print-logo-text .print-company-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.print-logo-text .print-company-sub {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 400;
    margin-top: 2px;
}

.print-report-meta {
    text-align: right;
    font-size: 0.78rem;
    color: #64748b;
}

.print-report-meta .print-meta-item {
    margin-bottom: 2px;
}

.print-report-meta .print-meta-label {
    font-weight: 600;
    color: #475569;
}

.print-header-divider {
    height: 3px;
    background: linear-gradient(90deg, #0C2340 0%, #1e3a5f 40%, #3B2F8C 70%, #f59e0b 100%);
    border-radius: 2px;
    margin-bottom: 14px;
}

.project-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 32px;
    font-size: 0.82rem;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.project-details-grid .detail-item {
    display: flex;
    gap: 6px;
}

.project-details-grid .detail-label {
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    min-width: 70px;
}

.project-details-grid .detail-value {
    color: #1e293b;
    font-weight: 500;
}

/* Print Footer */
.print-report-footer {
    display: none;
    padding: 10px 0;
    border-top: 1px solid #cbd5e1;
    margin-top: 1.5rem;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ===================== NOTES ===================== */
.note-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.note-item.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.note-item.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.note-item.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.note-item.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.note-item i {
    margin-top: 2px;
    flex-shrink: 0;
}

/* ===================== FOOTER ===================== */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }

    .header-inner {
        height: 56px;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .tagline {
        display: none;
    }

    .app-main {
        padding: 1rem;
    }

    .panel-body {
        padding: 16px;
    }

    .param-grid {
        grid-template-columns: 1fr;
    }

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

    .chart-container {
        height: 280px;
    }

    .header-actions .btn span {
        display: none;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* ===================== PRINT ===================== */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    @page {
        margin: 12mm 10mm;
        size: A4;
    }

    body {
        background: white !important;
        font-size: 11pt;
        color: #1e293b;
    }

    .app-header, .action-bar, .header-actions,
    .collapse-btn, .chart-controls, .table-actions,
    .app-footer {
        display: none !important;
    }

    .app-main {
        padding: 0;
        max-width: 100%;
    }

    .input-panel { display: none !important; }
    .notes-panel { display: none !important; }

    .print-report-header {
        display: block !important;
        border: none;
        padding: 0;
        margin-bottom: 16px;
    }

    .print-header-divider {
        background: #0f172a !important;
        height: 2px;
    }

    .project-details-grid {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
    }

    .print-report-footer {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px 10mm;
        border-top: 1px solid #e2e8f0;
        background: white;
    }

    /* Summary Cards - professional grid */
    .summary-cards {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 14px;
    }

    .summary-card {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        padding: 10px 14px !important;
        break-inside: avoid;
        background: white !important;
    }

    .card-icon {
        display: none !important;
    }

    .card-value {
        font-size: 1.2rem !important;
    }

    .card-label {
        font-size: 0.68rem !important;
    }

    /* Chart Panel */
    .chart-panel {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: avoid;
        margin-bottom: 12px !important;
    }

    .chart-panel .panel-header {
        padding: 8px 14px !important;
        background: #f1f5f9 !important;
    }

    .chart-panel .panel-header h2 {
        font-size: 0.85rem !important;
    }

    .chart-panel .panel-header h2 i {
        display: none;
    }

    .chart-panel .panel-body {
        padding: 12px !important;
    }

    .chart-container {
        height: 260px !important;
    }

    .profile-legend {
        gap: 12px !important;
    }

    .legend-item {
        font-size: 0.7rem !important;
    }

    /* Table Panel */
    .table-panel {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        break-inside: auto;
        overflow: visible !important;
    }

    .table-panel .panel-header {
        padding: 8px 14px !important;
        background: #f1f5f9 !important;
    }

    .table-panel .panel-header h2 {
        font-size: 0.85rem !important;
    }

    .table-panel .panel-header h2 i {
        display: none;
    }

    .table-panel .panel-body {
        padding: 0 !important;
        overflow: visible !important;
    }

    .table-wrapper {
        overflow: visible !important;
    }

    .data-table {
        font-size: 0.65rem !important;
        min-width: unset !important;
        width: 100% !important;
        table-layout: auto !important;
    }

    .data-table thead {
        position: static !important;
    }

    .data-table th {
        padding: 4px 6px !important;
        font-size: 0.6rem !important;
        background: #f1f5f9 !important;
        white-space: nowrap !important;
    }

    .data-table td {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }

    .data-table tbody tr {
        break-inside: avoid;
    }

    .data-table tbody tr.zone-entry,
    .data-table tbody tr.zone-descend,
    .data-table tbody tr.zone-level,
    .data-table tbody tr.zone-ascend,
    .data-table tbody tr.zone-exit {
        border-left: 3px solid !important;
    }
    .data-table tbody tr.zone-entry { border-left-color: #2563eb !important; }
    .data-table tbody tr.zone-descend { border-left-color: #f59e0b !important; }
    .data-table tbody tr.zone-level { border-left-color: #10b981 !important; }
    .data-table tbody tr.zone-ascend { border-left-color: #8b5cf6 !important; }
    .data-table tbody tr.zone-exit { border-left-color: #ec4899 !important; }

    .zone-badge {
        font-size: 0.55rem !important;
        padding: 1px 5px !important;
    }

    .results-section {
        animation: none !important;
    }

    @page annexure-landscape {
        size: landscape;
        margin: 10mm;
    }

    .annexure-page {
        page: annexure-landscape;
        break-before: page;
        page-break-before: always;
        display: flex !important;
        flex-direction: column;
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }
    .annexure-watermark {
        opacity: 0.04;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    .annexure-watermark-img {
        width: 400px;
        height: 400px;
    }
    .annexure-chart-wrap {
        flex: 1;
    }
    .annexure-chart-img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color-adjust: exact;
    }
    .annexure-header {
        border-bottom-color: #1a6fc4;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .annexure-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ═══════════════════════════════════════
   ANNEXURE PAGE — Bore Profile Landscape
   ═══════════════════════════════════════ */
.annexure-page {
    position: relative;
    page: annexure-landscape;
    break-before: page;
    page-break-before: always;
    overflow: hidden;
}

/* Watermark — centered behind content */
.annexure-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.045;
}
.annexure-watermark-img {
    width: 340px;
    height: 340px;
    object-fit: contain;
}

/* Header row */
.annexure-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 10px;
    border-bottom: 2px solid #1a6fc4;
    margin-bottom: 12px;
}
.annexure-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.annexure-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
}
.annexure-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}
.annexure-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}
.annexure-header-right {
    text-align: right;
}
.annexure-meta {
    font-size: 10px;
    color: #64748b;
}

/* Chart area — fills remaining space */
.annexure-chart-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
}
.annexure-chart-img {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* Footer row */
.annexure-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 0;
    border-top: 1px solid #cbd5e1;
    margin-top: 12px;
    font-size: 9px;
    color: #94a3b8;
}

/* Screen preview styling */
@media screen {
    .annexure-page {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 24px 28px;
        margin-top: 28px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        display: flex;
        flex-direction: column;
        min-height: 500px;
    }
    .annexure-watermark-img {
        width: 240px;
        height: 240px;
    }
}

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

.results-section {
    animation: fadeIn 0.4s ease;
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════════
   BORE PLAN — Project Modal & Toast
   ═══════════════════════════════════════════ */

.bp-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 999; opacity: 0; pointer-events: none;
    transition: opacity 0.2s; backdrop-filter: blur(4px);
}
.bp-modal-overlay.show { opacity: 1; pointer-events: auto; }

.bp-project-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: min(600px, 92vw); max-height: 80vh;
    background: #1e293b; color: #e2e8f0;
    border-radius: 14px; border: 1px solid rgba(148,163,184,0.15);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    z-index: 1000; opacity: 0; pointer-events: none;
    transition: all 0.25s ease;
    display: flex; flex-direction: column;
}
.bp-project-modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.bp-project-modal .modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid rgba(148,163,184,0.1);
}
.bp-project-modal .modal-header h3 {
    font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.bp-project-modal .modal-close {
    background: none; border: none; color: #94a3b8;
    cursor: pointer; font-size: 1.1rem; padding: 4px 8px;
    border-radius: 6px; transition: all 0.15s;
}
.bp-project-modal .modal-close:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; }

.bp-project-modal .modal-toolbar {
    display: flex; gap: 8px; padding: 12px 20px;
    border-bottom: 1px solid rgba(148,163,184,0.08);
}

.bp-project-modal .modal-body {
    flex: 1; overflow-y: auto; padding: 12px 20px;
    min-height: 200px; max-height: 400px;
}

.bp-project-modal .modal-footer {
    padding: 10px 20px; border-top: 1px solid rgba(148,163,184,0.08);
    color: #64748b; font-size: 0.75rem; text-align: center;
}

.bp-project-modal .project-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.08);
    margin-bottom: 8px; transition: all 0.15s;
    cursor: pointer;
}
.bp-project-modal .project-item:hover { background: rgba(255,255,255,0.05); border-color: rgba(148,163,184,0.2); }
.bp-project-modal .project-item.active { background: rgba(37,99,235,0.1); border-color: rgba(37,99,235,0.3); }
.bp-project-modal .project-item-main { flex: 1; min-width: 0; }
.bp-project-modal .project-item-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-project-modal .project-item-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 0.75rem; color: #94a3b8; }
.bp-project-modal .project-item-meta span { display: flex; align-items: center; gap: 4px; }
.bp-project-modal .project-item-actions { display: flex; gap: 6px; margin-left: 10px; flex-shrink: 0; }
.bp-project-modal .empty-projects { text-align: center; padding: 2rem 1rem; color: #64748b; }
.bp-project-modal .empty-projects p { margin-top: 0.5rem; font-weight: 500; }
.bp-project-modal .empty-projects small { display: block; margin-top: 0.25rem; }

/* Toast */
.bp-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: #1e293b; color: #f1f5f9;
    padding: 12px 24px; border-radius: 10px;
    font-size: 0.85rem; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border: 1px solid rgba(148,163,184,0.15);
    z-index: 10000; opacity: 0;
    transition: all 0.3s ease; pointer-events: none;
}
.bp-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.bp-toast.success { border-left: 4px solid #10b981; }
.bp-toast.error { border-left: 4px solid #ef4444; }
