/* =========================================================
   Portals UI Styles (Customs, Traffic, Insurance, Bodyshop, Bank, Executive)
   ========================================================= */

/* Grid Layouts */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .grid-2col, .grid-3col, .grid-4col {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   PORTAL 1: EXECUTIVE COMMAND CENTER & ANALYTICS
   ========================================================= */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 0 0 0 4px;
}

.kpi-card.emerald::before { background: var(--accent-emerald); }
.kpi-card.gold::before { background: var(--accent-gold); }
.kpi-card.purple::before { background: var(--accent-purple); }

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: #FFF;
    font-family: var(--font-en);
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.kpi-currency {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-ar);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.5rem;
    color: var(--accent-emerald);
}

/* Financial Clearinghouse Division Widget */
.clearinghouse-box {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.clearing-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.clearing-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.clearing-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.clearing-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-traffic { background: linear-gradient(90deg, #3B82F6, #00F0FF); }
.fill-customs { background: linear-gradient(90deg, #8B5CF6, #C084FC); }
.fill-finance { background: linear-gradient(90deg, #10B981, #34D399); }
.fill-insurance { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.fill-road { background: linear-gradient(90deg, #EC4899, #F472B6); }

/* Activity Feed */
.activity-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    padding-left: 0.5rem;
}

.activity-feed-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: var(--transition-fast);
}

.activity-feed-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.feed-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.feed-content {
    flex-grow: 1;
}

.feed-text {
    font-size: 0.88rem;
    color: #FFF;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Simulated Map */
.gis-map-container {
    height: 320px;
    border-radius: 14px;
    background: #09101D;
    border: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-svg-canvas {
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

.map-ping {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.map-ping::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pingRipple 2s infinite;
}

@keyframes pingRipple {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* =========================================================
   PORTAL 2: CUSTOMS CLEARANCE TERMINAL
   ========================================================= */
.customs-scanner-box {
    background: #080E1A;
    border: 2px dashed rgba(0, 240, 255, 0.35);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.scanner-laser {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 15px var(--primary);
    animation: laserScan 2.5s ease-in-out infinite alternate;
}

@keyframes laserScan {
    0% { top: 5%; }
    100% { top: 95%; }
}

.vin-display-box {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    display: inline-block;
    letter-spacing: 3px;
    margin: 1rem 0;
}

.interpol-check-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.interpol-badge {
    background: var(--accent-emerald);
    color: #070B14;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.82rem;
}

/* =========================================================
   PORTAL 3: TRAFFIC BACK-OFFICE & PLATE ISSUANCE
   ========================================================= */
/* Realistic Arabic / Libyan License Plate Display */
.license-plate-preview {
    background: #FFFFFF;
    color: #000000;
    border: 4px solid #1E293B;
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    min-width: 290px;
    position: relative;
    user-select: none;
}

.plate-side-emblem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 2px solid #CBD5E1;
    padding-left: 1rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #1E293B;
    line-height: 1.2;
}

.plate-side-emblem .country {
    font-size: 0.95rem;
    color: #0284C7;
    font-weight: 900;
}

.plate-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    font-family: var(--font-en);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #0F172A;
}

.plate-city-label {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: var(--font-ar);
    color: #334155;
}

/* Verification Checklist */
.verify-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: #E2E8F0;
}

.check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid var(--accent-emerald);
}

/* =========================================================
   PORTAL 4: INSURANCE & VEHICLE DAMAGE LOCATOR
   ========================================================= */
.damage-locator-wrapper {
    background: #080D1A;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
}

.car-blueprint-svg {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    display: block;
}

.damage-zone {
    cursor: pointer;
    transition: var(--transition-fast);
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 1.5;
}

.damage-zone:hover {
    fill: rgba(239, 68, 68, 0.35);
    stroke: var(--accent-rose);
}

.damage-zone.selected {
    fill: rgba(239, 68, 68, 0.75);
    stroke: #FF3B30;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
}

.damage-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =========================================================
   PORTAL 5: BODYSHOP & ODOMETER TAMPER LOCK
   ========================================================= */
.odometer-roller-display {
    background: #020617;
    border: 3px solid #334155;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.9);
}

.odometer-digit {
    background: #0F172A;
    color: #FFFFFF;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.odometer-digit.tenth {
    background: #DC2626;
    color: #FFF;
}

.tamper-badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-emerald);
    color: #34D399;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    margin-top: 0.8rem;
}

/* =========================================================
   PORTAL 6: BANK AUTO-FINANCE & LIEN TOGGLE
   ========================================================= */
.kyv-score-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lien-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.92rem;
}

.lien-status-pill.free {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid var(--accent-emerald);
}

.lien-status-pill.locked {
    background: rgba(239, 68, 68, 0.2);
    color: #F87171;
    border: 1px solid var(--accent-rose);
    animation: lockAlertPulse 2s infinite;
}

@keyframes lockAlertPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.6); }
}

/* Mobile Portal Optimization */
@media (max-width: 768px) {
    .kpi-card {
        padding: 1rem;
    }
    .kyv-score-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    .odometer-roller-display {
        padding: 0.5rem 1rem;
        gap: 0.25rem;
    }
    .odometer-digit {
        font-size: 1.4rem;
        padding: 0.15rem 0.4rem;
    }
}

