/* ═══════════════════════════════════════════
   Automate Loan Docs — Brand Overrides
   ═══════════════════════════════════════════ */

:root {
    --ald-midnight: #0F1720;
    --ald-steel: #2C3F52;
    --ald-gunmetal: #8E949A;
    --ald-chrome: #C7CCD1;
    --ald-charcoal: #1C1F23;
    --ald-graphite: #3A3F45;
    --ald-paper: #F5F7FA;
    --ald-cta: #223447;
    --ald-cta-hover: #3E566E;
}

* { scrollbar-width: thin; scrollbar-color: var(--ald-chrome) transparent; }
::selection { background: var(--ald-steel); color: white; }
body { font-family: 'DM Sans', 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

/* Google Places address autocomplete dropdown */
.gp-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 9999;
    background: white;
    border: 1px solid #C7CCD1;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 280px;
    overflow-y: auto;
}
.gp-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #1C1F23;
    border-bottom: 1px solid #f0f0f0;
}
.gp-item:last-child { border-bottom: none; }
.gp-item:hover { background: #F5F7FA; }

/* Sidebar drawer override */
.ald-drawer { background: var(--ald-midnight) !important; }
.ald-drawer .mud-nav-link { color: rgba(255,255,255,0.5); font-size: 13px; font-weight: 500; border-radius: 6px; margin-bottom: 2px; }
.ald-drawer .mud-nav-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
.ald-drawer .mud-nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.ald-drawer .mud-nav-link.active::before {
    content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 4px 4px 0; background: var(--ald-steel);
}
.ald-drawer .mud-nav-link .mud-icon-root { opacity: 0.6; }
.ald-drawer .mud-nav-link.active .mud-icon-root { opacity: 1; }

/* Card style */
.ald-card { background: white; border-radius: 12px; border: 1px solid rgba(199,204,209,0.6); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }

/* Status badges */
.ald-status-pending { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.ald-status-active { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.ald-status-review { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.ald-status-draft { background: #F5F7FA; color: #3A3F45; border: 1px solid #C7CCD1; }
.ald-status-closed { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* Feature toggle expansion */
.ald-feature-sub { margin-left: 24px; padding-left: 24px; border-left: 2px solid rgba(44,63,82,0.2); padding-top: 12px; padding-bottom: 12px; }

/* Section card (accordion) */
.ald-section { transition: all 0.3s ease; scroll-margin-top: 100px; }
.ald-section-complete { box-shadow: 0 0 0 1px rgba(16,185,129,0.2); }
.ald-section-error { box-shadow: 0 0 0 1px rgba(239,68,68,0.3); }

/* Wizard step indicator */
.ald-step-active { background: var(--ald-cta); color: white; }
.ald-step-done { background: #10b981; color: white; }
.ald-step-pending { background: transparent; border: 2px solid var(--ald-chrome); color: var(--ald-gunmetal); }

/* Generate bar */
.ald-generate-bar {
    position: fixed; bottom: 0; right: 0; left: 240px; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(16px);
    border-top: 1px solid rgba(199,204,209,0.4); padding: 12px 28px;
}

/* Loan type card */
.ald-loan-type-card { transition: all 0.2s; cursor: pointer; }
.ald-loan-type-card:hover { border-color: var(--ald-gunmetal); }
.ald-loan-type-card.selected { border-color: var(--ald-cta); background: rgba(34,52,71,0.04); box-shadow: 0 0 0 1px var(--ald-cta); }

/* ═══════════════════════════════════════════
   Authentication Pages
   ═══════════════════════════════════════════ */

.login-layout {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--ald-midnight) 0%, var(--ald-charcoal) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: var(--ald-paper);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 48px 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--ald-charcoal);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.login-tagline {
    font-size: 14px;
    color: var(--ald-gunmetal);
    margin: 0;
    font-weight: 500;
}

.login-body {
    margin-top: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(199, 204, 209, 0.3);
}

.login-footer p {
    font-size: 13px;
    color: var(--ald-gunmetal);
    margin: 0;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ald-charcoal);
    margin: 0 0 8px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--ald-graphite);
    margin: 0 0 28px 0;
}

.auth-button {
    margin-top: 8px;
    background: var(--ald-cta) !important;
    height: 48px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: none;
    font-size: 15px;
}

.auth-button:hover {
    background: var(--ald-cta-hover) !important;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
}

.auth-footer p {
    font-size: 14px;
    color: var(--ald-graphite);
    margin: 0;
}

.auth-link {
    color: var(--ald-cta);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--ald-cta-hover);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════
   New Loan Wizard — React UI Parity
   ═══════════════════════════════════════════ */

/* Card Component */
.ald-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ald-chrome);
    padding: 16px;
    transition: all 0.2s ease;
}

.ald-card-active {
    border-color: var(--ald-steel);
    box-shadow: 0 0 0 2px rgba(44, 63, 82, 0.12);
}

.ald-card:has(> *:hover):not(.ald-card-active) {
    border-color: var(--ald-gunmetal);
}

/* Section error glow — required fields missing */
.ald-section-error {
    border: 2px solid #d32f2f !important;
    box-shadow: 0 0 12px rgba(211, 47, 47, 0.25) !important;
}

/* Badge Component */
.ald-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.ald-badge-default {
    background: rgba(199, 204, 209, 0.25);
    color: var(--ald-graphite);
}

.ald-badge-info {
    background: rgba(44, 63, 82, 0.15);
    color: var(--ald-steel);
}

.ald-badge-warning {
    background: #FFF3CD;
    color: #B45309;
}

.ald-badge-success {
    background: #D4EDDA;
    color: #2D6A4F;
}

/* Section Divider */
.ald-section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}

.ald-divider-line {
    flex: 1;
    height: 1px;
    background: var(--ald-chrome);
}

.ald-divider-line-full {
    width: 100%;
    height: 1px;
    background: var(--ald-chrome);
}

.ald-divider-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ald-gunmetal);
}

/* Document Package Preview Panel */
.ald-doc-preview-panel {
    background: var(--ald-midnight);
    border-radius: 12px;
    border: 1px solid var(--ald-steel);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.ald-doc-preview-header {
    padding: 16px;
    border-bottom: 1px solid var(--ald-steel);
}

.ald-doc-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.ald-doc-count {
    font-size: 11px;
    color: var(--ald-gunmetal);
    margin-left: auto;
}

.ald-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Preview Stats */
.ald-doc-preview-stats {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-bottom: 1px solid rgba(44, 63, 82, 0.4);
}

.ald-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ald-stat-label {
    font-size: 11px;
    color: var(--ald-gunmetal);
}

.ald-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.ald-stat-value-small {
    font-size: 11px;
    color: white;
}

.ald-stat-detail {
    font-size: 11px;
    color: var(--ald-chrome);
}

/* Document List */
.ald-doc-list {
    padding: 12px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ald-steel) transparent;
}

.ald-doc-empty {
    padding: 48px 16px;
    text-align: center;
    font-size: 11px;
    color: var(--ald-gunmetal);
}

.ald-doc-item {
    margin-bottom: 4px;
}

.ald-doc-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.ald-doc-button:hover {
    background: rgba(44, 63, 82, 0.3);
}

.ald-doc-button.expanded {
    background: rgba(44, 63, 82, 0.25);
}

.ald-doc-icon {
    font-size: 16px;
}

.ald-doc-name {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.ald-conditional-count {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(180, 83, 9, 0.2);
    color: #FCD34D;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.ald-expand-icon {
    font-size: 11px;
    color: var(--ald-gunmetal);
}

/* Document Details */
.ald-doc-details {
    padding: 8px 12px 12px 40px;
}

.ald-section-label,
.ald-conditional-label {
    font-size: 11px;
    color: var(--ald-gunmetal);
    margin-bottom: 6px;
}

.ald-conditional-label {
    color: #B45309;
    margin-top: 12px;
}

.ald-section-item,
.ald-conditional-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}

.ald-section-item span:last-child,
.ald-conditional-item span:last-child {
    font-size: 11px;
    color: #d1d5db;
}

.ald-check-icon {
    color: #4ade80;
    font-size: 12px;
}

.ald-lightning-icon {
    color: #fbbf24;
    font-size: 12px;
}

/* Preview Footer */
.ald-doc-preview-footer {
    padding: 16px;
    border-top: 1px solid rgba(44, 63, 82, 0.4);
}

/* Merge Field Preview */
.ald-merge-preview {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--ald-chrome);
    padding: 16px;
    margin-top: 16px;
}

.ald-merge-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ald-graphite);
    margin: 0 0 12px 0;
}

.ald-merge-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ald-merge-item {
    font-size: 11px;
    color: var(--ald-gunmetal);
}

.ald-merge-key {
    color: var(--ald-steel);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Hamburger toggle — hidden on desktop, shown on mobile/tablet */
.ald-drawer-toggle { display: none !important; }

/* Loan Type Cards */
.ald-loan-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.ald-loan-type-card {
    background: white;
    border: 2px solid var(--ald-chrome);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ald-loan-type-card:hover {
    border-color: var(--ald-steel);
    transform: translateY(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ald-loan-type-card.selected {
    border-color: var(--ald-steel);
    background: rgba(44, 63, 82, 0.04);
    box-shadow: 0 0 0 2px rgba(44, 63, 82, 0.12);
}

.ald-loan-type-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.ald-loan-type-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ald-charcoal);
    margin-bottom: 4px;
}

.ald-loan-type-desc {
    font-size: 12px;
    color: var(--ald-gunmetal);
}

.ald-loan-type-selected {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #2D6A4F;
}

/* Step Navigation with Completion */
.ald-step-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--ald-chrome);
}

.ald-step-button {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--ald-gunmetal);
    font-weight: 400;
}

.ald-step-button:hover {
    color: var(--ald-charcoal);
    background: rgba(44, 63, 82, 0.03);
}

.ald-step-button.active {
    color: var(--ald-charcoal);
    font-weight: 600;
    border-bottom-color: var(--ald-steel);
}

.ald-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: rgba(199, 204, 209, 0.4);
    color: var(--ald-gunmetal);
    transition: all 0.2s;
}

.ald-step-button.active .ald-step-num {
    background: var(--ald-chrome);
    color: white;
}

.ald-step-button.completed .ald-step-num {
    background: var(--ald-steel);
    color: white;
}

/* Property State Badges */
.ald-property-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ald-property-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ald-steel);
}

/* Fee Calculator */
.ald-fee-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
}

.ald-fee-computed {
    width: 120px;
    padding-bottom: 12px;
    text-align: right;
}

.ald-fee-computed-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ald-charcoal);
}

.ald-fee-total {
    background: var(--ald-paper);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ald-fee-total-label,
.ald-fee-total-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ald-charcoal);
}

/* ═══════════════════════════════════════════
   Responsive Breakpoints
   ═══════════════════════════════════════════
   Tier 1: ≤1279px — Small laptops (hide wizard left rail, 2-col grid)
   Tier 2: ≤959px  — Tablet portrait (overlay drawer, hamburger visible)
   Tier 3: ≤840px  — iPad portrait (tighter padding)
   Tier 4: ≤599px  — Phone (single-col, iOS fixes, touch targets)
   ═══════════════════════════════════════════ */

/* Tier 1: Small laptops — hide left rail for more form space */
@media (max-width: 1279px) {
    .ald-wizard-aside { display: none !important; }
    .ald-wizard-main { max-width: 100% !important; }
    .ald-loan-type-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Tier 2: Tablet portrait — drawer becomes overlay */
@media (max-width: 959.98px) {
    .ald-drawer-toggle { display: inline-flex !important; }
    .ald-generate-bar { left: 0; }

    .ald-settings-layout { flex-direction: column !important; }
    .ald-settings-sidebar {
        width: 100% !important; border-right: none !important;
        border-bottom: 1px solid rgba(199,204,209,0.4); padding: 24px !important;
    }
    .ald-settings-main { padding: 24px !important; max-width: 100% !important; }
}

/* Tier 3: iPad portrait — tighter padding */
@media (max-width: 840px) {
    .mud-main-content { padding: 60px 16px 16px 16px !important; }
    .ald-dashboard-toolbar { flex-wrap: wrap !important; gap: 8px !important; }
}

/* Tier 4: Phone — single column, iOS fixes, touch targets */
@media (max-width: 599px) {
    .mud-main-content { padding: 60px 10px 10px 10px !important; }

    .ald-generate-bar {
        left: 0 !important; padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .ald-loan-type-grid { grid-template-columns: 1fr !important; }

    /* Prevent iOS Safari auto-zoom on input focus (font-size must be ≥16px) */
    .mud-input input, .mud-input textarea, .mud-select-input {
        font-size: 16px !important;
    }

    /* Touch-friendly nav links (44px min per Apple HIG) */
    .ald-drawer .mud-nav-link { padding: 12px 16px; min-height: 44px; }

    /* Tighter grid gutters */
    .mud-grid-item { padding: 6px !important; }

    /* Constrain popover menus to viewport */
    .mud-popover { max-width: calc(100vw - 24px) !important; }

    .ald-settings-sidebar { padding: 16px !important; }
    .ald-settings-main { padding: 16px !important; }
}

/* ═══════════════════════════════════════════
   Template Drag & Drop
   ═══════════════════════════════════════════ */

.ald-file-dropzone {
    position: relative;
}

.ald-drop-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(34, 52, 71, 0.06);
    border: 2px dashed var(--ald-steel);
    border-radius: 12px;
    z-index: 20;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ald-file-dragover .ald-drop-overlay {
    display: flex;
}

.ald-drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 48px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ald-drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    color: var(--ald-chrome);
    transition: color 0.15s, background 0.15s;
}

.ald-drag-handle:hover {
    color: var(--ald-steel);
    background: rgba(44, 63, 82, 0.06);
}

.ald-drag-handle:active {
    cursor: grabbing;
}

.ald-row-dragging {
    opacity: 0.4 !important;
    background: rgba(44, 63, 82, 0.03);
}

.ald-row-drop-above {
    box-shadow: inset 0 2px 0 0 var(--ald-steel);
}

.ald-row-drop-below {
    box-shadow: inset 0 -2px 0 0 var(--ald-steel);
}

/* ═══════════════════════════════════════════
   Wizard Configurator Dialog
   ═══════════════════════════════════════════ */

/* Swatch color picker */
.ald-swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ald-swatch {
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
    border: 3px solid transparent; transition: all 0.15s; position: relative;
}
.ald-swatch:hover { transform: scale(1.1); }
.ald-swatch.selected {
    border-color: var(--ald-paper); box-shadow: 0 0 0 2px #4A90D9;
}
.ald-swatch.selected::after {
    content: '\2713'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); color: white; font-size: 16px;
    font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Icon picker grid */
.ald-icon-grid {
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
}
.ald-icon-option {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 20px; cursor: pointer;
    background: var(--ald-paper); border: 2px solid transparent; transition: all 0.15s;
}
.ald-icon-option:hover { background: #e8ecf0; }
.ald-icon-option.selected {
    border-color: #4A90D9; background: rgba(74, 144, 217, 0.1);
}

/* Tag pill input */
.ald-tag-area {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px;
    background: var(--ald-paper); border: 1px solid var(--ald-chrome);
    border-radius: 6px; min-height: 42px; align-items: center;
}
.ald-tag-pill {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
    background: rgba(74, 144, 217, 0.12); border: 1px solid rgba(74, 144, 217, 0.3);
    border-radius: 12px; font-size: 12px; color: #4A90D9;
}
.ald-tag-pill .ald-tag-remove {
    cursor: pointer; opacity: 0.6; font-size: 14px; margin-left: 2px;
}
.ald-tag-pill .ald-tag-remove:hover { opacity: 1; }

/* Live card preview */
.ald-card-preview {
    background: white; border: 2px solid var(--ald-chrome); border-radius: 12px;
    padding: 24px; position: relative; overflow: hidden; max-width: 360px;
    transition: all 0.2s;
}
.ald-card-preview:hover {
    border-color: #4A90D9; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.ald-card-preview .ald-accent-bar {
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.ald-card-preview .ald-card-icon { font-size: 32px; margin-bottom: 12px; }
.ald-card-preview .ald-card-title {
    font-size: 17px; font-weight: 700; color: var(--ald-charcoal); margin-bottom: 4px;
}
.ald-card-preview .ald-card-category {
    font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
    padding: 2px 8px; border-radius: 4px; display: inline-block;
    margin-bottom: 10px; font-weight: 600;
}
.ald-card-preview .ald-card-desc {
    font-size: 13px; color: var(--ald-gunmetal); line-height: 1.5; margin-bottom: 14px;
}
.ald-card-preview .ald-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ald-card-preview .ald-card-tag {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    background: var(--ald-paper); color: var(--ald-gunmetal);
    border: 1px solid var(--ald-chrome);
}
.ald-card-preview .ald-card-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ald-chrome);
    font-size: 12px; color: var(--ald-gunmetal);
}

/* Info note box */
.ald-note-box {
    background: rgba(74, 144, 217, 0.06); border: 1px solid rgba(74, 144, 217, 0.2);
    border-radius: 8px; padding: 14px 18px; font-size: 13px;
    color: var(--ald-graphite); line-height: 1.6;
}

/* Layouts */
.ald-split-designer {
    display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.ald-split-3 {
    display: grid; grid-template-columns: 320px 1fr 360px; gap: 24px;
}

/* Field pool (left column Tab 2) */
.ald-field-pool {
    background: var(--ald-paper); border: 1px solid var(--ald-chrome);
    border-radius: 10px; padding: 16px; max-height: 600px; overflow-y: auto;
}
.ald-field-group-header {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
    color: #4A90D9; margin: 14px 0 8px; font-weight: 600;
    padding-bottom: 4px; border-bottom: 1px solid rgba(74, 144, 217, 0.2);
}
.ald-field-group-header:first-child { margin-top: 0; }

.ald-field-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; margin: 3px; border-radius: 6px; font-size: 12px;
    cursor: pointer; user-select: none; transition: all 0.15s;
    border: 1px solid var(--ald-chrome); background: white; color: var(--ald-charcoal);
}
.ald-field-chip:hover {
    border-color: #4A90D9; background: rgba(74, 144, 217, 0.06);
}
.ald-field-chip .ald-chip-icon { font-size: 14px; opacity: 0.6; }
.ald-field-chip.in-use {
    opacity: 0.35; cursor: default; border-style: dashed;
}
.ald-field-chip.in-use::after {
    content: ' \2713'; font-size: 10px; color: #2D8659; margin-left: 2px;
}

/* Wizard sections (center column Tab 2) */
.ald-wizard-section {
    background: white; border: 1px solid var(--ald-chrome);
    border-radius: 10px; margin-bottom: 16px; overflow: hidden;
}
.ald-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--ald-paper);
    border-bottom: 1px solid var(--ald-chrome);
}
.ald-section-header .ald-step-num {
    background: #223447; color: white; width: 26px; height: 26px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ald-section-header .ald-section-title {
    font-size: 14px; font-weight: 600; color: var(--ald-charcoal);
    display: flex; align-items: center; gap: 10px;
}
.ald-section-body { padding: 16px 18px; min-height: 50px; }
.ald-wizard-section.dragging { opacity: 0.35; }
.ald-wizard-section.drag-over { border-top: 3px solid #223447; }
.ald-section-header .ald-section-grip {
    color: var(--ald-chrome); font-size: 14px; cursor: grab; user-select: none;
}
.ald-section-header .ald-section-grip:active { cursor: grabbing; }

/* Field row inside section */
.ald-field-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; margin: 6px 0; background: var(--ald-paper);
    border: 1px solid var(--ald-chrome); border-radius: 6px;
    font-size: 13px; transition: all 0.15s; cursor: pointer;
}
.ald-field-row:hover { border-color: var(--ald-steel); }
.ald-field-row.selected { border-color: #4A90D9; background: rgba(74,144,217,0.04); }
.ald-field-row .ald-field-info { display: flex; align-items: center; gap: 10px; }
.ald-field-row .ald-grip { color: var(--ald-chrome); font-size: 16px; cursor: grab; user-select: none; }
.ald-field-row .ald-grip:active { cursor: grabbing; }
.ald-field-row .ald-field-name { color: var(--ald-charcoal); font-weight: 500; }
.ald-field-row .ald-field-key {
    font-size: 11px; color: var(--ald-gunmetal); font-family: Consolas, monospace;
    background: rgba(74,144,217,0.06); padding: 2px 6px; border-radius: 3px;
}
.ald-field-row .ald-field-controls { display: flex; align-items: center; gap: 8px; }
.ald-field-row.dragging { opacity: 0.35; }
.ald-field-row.drag-over { border-top: 2px solid #223447; margin-top: 4px; }

/* Required / Optional badge */
.ald-req-badge {
    font-size: 10px; padding: 2px 6px; border-radius: 3px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.ald-req-badge.required { background: rgba(160,65,58,0.12); color: #A0413A; }
.ald-req-badge.optional { background: rgba(142,148,154,0.12); color: var(--ald-gunmetal); }

/* Field properties panel (right column Tab 2) */
.ald-field-props {
    background: white; border: 1px solid var(--ald-chrome);
    border-radius: 10px; padding: 20px; position: sticky; top: 20px;
}

/* Add section button */
.ald-add-section-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px; border: 2px dashed var(--ald-chrome);
    border-radius: 10px; background: transparent; color: var(--ald-gunmetal);
    font-size: 14px; cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.ald-add-section-btn:hover {
    border-color: #4A90D9; color: #4A90D9; background: rgba(74, 144, 217, 0.04);
}

/* Drop zone */
.ald-drop-zone {
    border: 2px dashed var(--ald-chrome); border-radius: 8px;
    padding: 12px; text-align: center; color: var(--ald-gunmetal);
    font-size: 12px; transition: all 0.2s; margin-top: 10px;
}

/* Preview step (Tab 3) */
.ald-preview-step {
    background: white; border: 1px solid var(--ald-chrome);
    border-radius: 10px; padding: 24px; margin-bottom: 16px;
}
.ald-preview-step h3 {
    font-size: 15px; font-weight: 600; color: var(--ald-charcoal);
    margin-bottom: 6px; display: flex; align-items: center; gap: 10px;
}
.ald-preview-step .ald-step-badge {
    font-size: 11px; padding: 3px 10px; border-radius: 12px;
    background: rgba(74, 144, 217, 0.12); color: #4A90D9; font-weight: 600;
}
.ald-preview-step .ald-step-desc {
    font-size: 12px; color: var(--ald-gunmetal); margin-bottom: 16px;
}
.ald-preview-field-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px;
}
.ald-mock-input {
    width: 100%; padding: 10px 14px; background: var(--ald-paper);
    border: 1px solid var(--ald-chrome); border-radius: 6px;
    color: var(--ald-gunmetal); font-size: 13px; font-style: italic;
}
.ald-mock-label {
    display: block; font-size: 11px; font-weight: 500; color: var(--ald-gunmetal);
    margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px;
}
.ald-mock-label .ald-req-star { color: #A0413A; }

/* ═══════════════════════════════════════════
   Loan Summary Card (sidebar)
   ═══════════════════════════════════════════ */

.ald-loan-summary {
    background: var(--ald-midnight);
    border-radius: 12px;
    border: 1px solid var(--ald-steel);
    padding: 16px;
    margin-top: 16px;
}

.ald-loan-summary-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ald-gunmetal);
    margin-bottom: 14px;
}

.ald-loan-summary-row {
    margin-bottom: 14px;
}

.ald-loan-summary-row:last-child {
    margin-bottom: 0;
}

.ald-loan-summary-label {
    font-size: 11px;
    color: var(--ald-gunmetal);
    margin-bottom: 2px;
}

.ald-loan-summary-value {
    font-size: 15px;
    font-weight: 600;
    color: white;
}

.ald-loan-summary-detail {
    font-size: 11px;
    color: var(--ald-chrome);
}

.ald-loan-summary-divider {
    height: 1px;
    background: var(--ald-steel);
    margin: 12px 0;
}

/* Fee running totals */
.ald-fee-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(44, 63, 82, 0.04);
    border-radius: 6px;
}

.ald-fee-total-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ald-graphite);
}

.ald-fee-total-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ald-charcoal);
}

.ald-fee-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--ald-paper);
    border: 1px solid var(--ald-chrome);
    border-radius: 8px;
}

.ald-fee-grand-total-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ald-charcoal);
}

.ald-fee-grand-total-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--ald-charcoal);
}
