/* ═══════════════════════════════════════════════════════════════════════
   FLEET CODIFY — Portal Design System
   Modern, premium UI inspired by Fleetio / Samsara / Linear
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --fcp-bg:          #f1f5f9;
    --fcp-surface:     #ffffff;
    --fcp-border:      #e2e8f0;
    --fcp-border-dark: #cbd5e1;

    --fcp-text:        #0f172a;
    --fcp-text-2:      #334155;
    --fcp-muted:       #64748b;
    --fcp-faint:       #94a3b8;

    --fcp-blue:        #2563eb;
    --fcp-blue-light:  #eff6ff;
    --fcp-blue-mid:    #bfdbfe;
    --fcp-green:       #059669;
    --fcp-green-light: #ecfdf5;
    --fcp-amber:       #d97706;
    --fcp-amber-light: #fffbeb;
    --fcp-red:         #dc2626;
    --fcp-red-light:   #fef2f2;
    --fcp-slate:       #475569;

    --fcp-radius-sm:   8px;
    --fcp-radius:      12px;
    --fcp-radius-lg:   16px;
    --fcp-radius-xl:   20px;

    --fcp-shadow-xs:   0 1px 2px rgba(15,23,42,.04);
    --fcp-shadow-sm:   0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --fcp-shadow:      0 4px 12px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
    --fcp-shadow-lg:   0 10px 28px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.04);

    --fcp-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    --fcp-transition: all 0.18s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════════════════════════════
   GLOBAL PORTAL OVERRIDES
   ═══════════════════════════════════════════════════════════════════════ */

/* Page background */
body.o_portal {
    background: var(--fcp-bg) !important;
    font-family: var(--fcp-font) !important;
    color: var(--fcp-text) !important;
    -webkit-font-smoothing: antialiased;
}

/* Kill Odoo's default card shadow override */
.card { box-shadow: var(--fcp-shadow-sm) !important; }

/* Main container sizing */
.o_portal_wrap .container,
.avr-portal-dashboard.container {
    max-width: 1200px !important;
    padding-top: 24px !important;
    padding-bottom: 40px !important;
}

/* ── Odoo portal nav bar ── */
header#top,
header.o_main_navbar {
    background: var(--fcp-surface) !important;
    border-bottom: 1px solid var(--fcp-border) !important;
    box-shadow: var(--fcp-shadow-xs) !important;
}

/* ── Portal breadcrumb ── */
.o_portal_submenu {
    background: transparent !important;
    border-bottom: 1px solid var(--fcp-border);
    padding: 10px 0 !important;
    font-size: 0.82rem;
    color: var(--fcp-muted);
}
.o_portal_submenu .breadcrumb-item a { color: var(--fcp-blue); text-decoration: none; }
.o_portal_submenu .breadcrumb-item a:hover { text-decoration: underline; }
.o_portal_submenu .breadcrumb-item.active { color: var(--fcp-text); }

/* ── Cards — global modern style ── */
.container .card,
.avr-portal-dashboard .card {
    border: 1px solid var(--fcp-border) !important;
    border-radius: var(--fcp-radius) !important;
    box-shadow: var(--fcp-shadow-sm) !important;
    background: var(--fcp-surface) !important;
    overflow: hidden;
    transition: var(--fcp-transition);
}
.container .card:hover,
.avr-portal-dashboard .card:hover {
    box-shadow: var(--fcp-shadow) !important;
    transform: translateY(-1px);
}
.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid var(--fcp-border) !important;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--fcp-text-2);
    padding: 12px 16px !important;
}
.card-body { padding: 16px !important; }

/* ── Tables ── */
.table {
    font-size: 0.83rem;
    color: var(--fcp-text-2);
    border-color: var(--fcp-border);
}
.table thead th {
    background: #f8fafc;
    color: var(--fcp-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--fcp-border) !important;
    padding: 10px 12px;
}
.table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--fcp-border);
    color: var(--fcp-text-2);
}
.table-hover tbody tr:hover { background: var(--fcp-blue-light) !important; }
.table-sm thead th,
.table-sm tbody td { padding: 7px 10px; }

/* ── Badges ── */
.badge {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em;
    border-radius: 20px !important;
    padding: 3px 9px !important;
}
.badge.text-bg-success { background: var(--fcp-green-light) !important; color: var(--fcp-green) !important; }
.badge.text-bg-danger  { background: var(--fcp-red-light) !important;   color: var(--fcp-red) !important; }
.badge.text-bg-warning { background: var(--fcp-amber-light) !important; color: var(--fcp-amber) !important; }
.badge.text-bg-info    { background: var(--fcp-blue-light) !important;  color: var(--fcp-blue) !important; }
.badge.text-bg-primary { background: var(--fcp-blue-light) !important;  color: var(--fcp-blue) !important; }

/* ── Buttons ── */
.btn {
    font-size: 0.83rem !important;
    font-weight: 600 !important;
    border-radius: var(--fcp-radius-sm) !important;
    transition: var(--fcp-transition) !important;
    letter-spacing: 0.01em;
}
.btn-primary {
    background: var(--fcp-blue) !important;
    border-color: var(--fcp-blue) !important;
}
.btn-primary:hover { background: #1d4ed8 !important; border-color: #1d4ed8 !important; box-shadow: 0 4px 14px rgba(37,99,235,.35) !important; }
.btn-outline-primary { color: var(--fcp-blue) !important; border-color: var(--fcp-blue) !important; }
.btn-outline-primary:hover { background: var(--fcp-blue) !important; color: #fff !important; }
.btn-outline-secondary { border-color: var(--fcp-border-dark) !important; color: var(--fcp-text-2) !important; }
.btn-outline-secondary:hover { background: var(--fcp-bg) !important; color: var(--fcp-text) !important; }
.btn-sm { padding: 5px 14px !important; font-size: 0.78rem !important; }

/* ── Alerts ── */
.alert {
    border-radius: var(--fcp-radius) !important;
    border: 1px solid !important;
    font-size: 0.85rem;
}
.alert-success { background: var(--fcp-green-light) !important; border-color: #a7f3d0 !important; color: #065f46 !important; }
.alert-danger  { background: var(--fcp-red-light) !important;   border-color: #fecaca !important; color: #991b1b !important; }
.alert-warning { background: var(--fcp-amber-light) !important; border-color: #fde68a !important; color: #92400e !important; }
.alert-info    { background: var(--fcp-blue-light) !important;  border-color: var(--fcp-blue-mid) !important; color: #1e3a8a !important; }

/* ── Odoo portal home docs section ── */
.o_portal_docs { gap: 0 !important; }
.o_portal_category { gap: 8px !important; margin-top: 0 !important; }

/* Odoo default portal doc items (Connection & Security etc.) */
.o_portal_index_card a {
    border-radius: var(--fcp-radius) !important;
    border: 1px solid var(--fcp-border) !important;
    background: var(--fcp-surface) !important;
    color: var(--fcp-text) !important;
    transition: var(--fcp-transition) !important;
    font-size: 0.85rem;
}
.o_portal_index_card a:hover {
    border-color: var(--fcp-blue-mid) !important;
    background: var(--fcp-blue-light) !important;
    transform: translateY(-1px);
    box-shadow: var(--fcp-shadow) !important;
}

/* ── Forms ── */
.form-control, .form-select {
    border: 1px solid var(--fcp-border) !important;
    border-radius: var(--fcp-radius-sm) !important;
    font-size: 0.85rem !important;
    color: var(--fcp-text) !important;
    background: var(--fcp-surface) !important;
    transition: var(--fcp-transition) !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--fcp-blue) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
.form-label {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: var(--fcp-text-2) !important;
    margin-bottom: 5px !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   PORTAL HOME PAGE
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Compact Welcome Header ── */
.avr-portal-welcome-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--fcp-surface);
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius-lg);
    box-shadow: var(--fcp-shadow-sm);
    margin-bottom: 0;
}
.avr-welcome-left { display: flex; align-items: center; gap: 14px; }
.avr-welcome-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fcp-blue) 0%, #60a5fa 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.avr-welcome-left h4 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--fcp-text);
    letter-spacing: -0.01em;
}
.avr-welcome-left .text-muted { font-size: 0.78rem; color: var(--fcp-muted) !important; }
.avr-welcome-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Section Labels ── */
.avr-portal-section-label,
.avr-section-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fcp-faint);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    margin-top: 4px;
}
.avr-section-link {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--fcp-blue);
    text-decoration: none;
    transition: opacity .15s;
}
.avr-section-link:hover { opacity: .75; text-decoration: none; }

/* ── Navigation Cards (grid) ── */
.avr-portal-nav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: var(--fcp-radius);
    border: 1px solid var(--fcp-border);
    background: var(--fcp-surface);
    text-decoration: none;
    color: var(--fcp-text);
    transition: var(--fcp-transition);
    cursor: pointer;
    box-shadow: var(--fcp-shadow-xs);
}
.avr-portal-nav-card:hover {
    text-decoration: none;
    color: var(--fcp-text);
    transform: translateY(-2px);
    box-shadow: var(--fcp-shadow);
}
.avr-nav-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #fff; flex-shrink: 0;
}
.avr-nav-body { min-width: 0; }
.avr-nav-title {
    font-size: 0.86rem; font-weight: 700;
    line-height: 1.25; color: var(--fcp-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avr-nav-desc {
    font-size: 0.73rem; color: var(--fcp-muted);
    margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Nav card color variants */
.avr-nav-blue   .avr-nav-icon { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.avr-nav-green  .avr-nav-icon { background: linear-gradient(135deg, #047857, #10b981); }
.avr-nav-amber  .avr-nav-icon { background: linear-gradient(135deg, #b45309, #f59e0b); }
.avr-nav-orange .avr-nav-icon { background: linear-gradient(135deg, #c2410c, #f97316); }
.avr-nav-red    .avr-nav-icon { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.avr-nav-dark   .avr-nav-icon { background: linear-gradient(135deg, #1e293b, #475569); }

.avr-nav-blue:hover   { border-color: var(--fcp-blue-mid);  background: var(--fcp-blue-light); }
.avr-nav-green:hover  { border-color: #a7f3d0; background: var(--fcp-green-light); }
.avr-nav-amber:hover  { border-color: #fde68a; background: var(--fcp-amber-light); }
.avr-nav-orange:hover { border-color: #fed7aa; background: #fff7ed; }
.avr-nav-red:hover    { border-color: #fecaca; background: var(--fcp-red-light); }
.avr-nav-dark:hover   { border-color: #cbd5e1; background: #f8fafc; }

/* ═══════════════════════════════════════════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════════════════════════════════════════ */

.avr-portal-kpi-card {
    position: relative;
    border-radius: var(--fcp-radius);
    padding: 16px 16px 14px;
    border: 1px solid var(--fcp-border);
    background: var(--fcp-surface);
    text-align: left;
    overflow: hidden;
    transition: var(--fcp-transition);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-portal-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--fcp-radius) var(--fcp-radius) 0 0;
    background: var(--fcp-border);
}
.avr-portal-kpi-card:hover {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--fcp-shadow);
    border-color: var(--fcp-border-dark);
}
.avr-portal-kpi-icon {
    font-size: 17px;
    margin-bottom: 8px;
    color: var(--fcp-muted);
}
.avr-portal-kpi-value {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
    color: var(--fcp-text);
    letter-spacing: -0.03em;
}
.avr-portal-kpi-label {
    font-size: 0.69rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fcp-muted);
    margin-top: 5px;
}

/* KPI color variants */
.avr-portal-kpi-card.is-primary::before { background: linear-gradient(90deg, var(--fcp-blue), #60a5fa); }
.avr-portal-kpi-card.is-primary .avr-portal-kpi-icon { color: var(--fcp-blue); }
.avr-portal-kpi-card.is-success::before { background: linear-gradient(90deg, var(--fcp-green), #34d399); }
.avr-portal-kpi-card.is-success .avr-portal-kpi-icon { color: var(--fcp-green); }
.avr-portal-kpi-card.is-warning::before { background: linear-gradient(90deg, var(--fcp-amber), #fbbf24); }
.avr-portal-kpi-card.is-warning .avr-portal-kpi-icon { color: var(--fcp-amber); }
.avr-portal-kpi-card.is-danger::before  { background: linear-gradient(90deg, var(--fcp-red), #f87171); }
.avr-portal-kpi-card.is-danger .avr-portal-kpi-icon  { color: var(--fcp-red); }
.avr-portal-kpi-card.is-danger .avr-portal-kpi-value { color: var(--fcp-red); }

.avr-overdue-kpi {
    border-color: #fecaca !important;
    background: var(--fcp-red-light) !important;
}
.avr-overdue-kpi::before { background: linear-gradient(90deg, var(--fcp-red), #f87171) !important; }
.avr-overdue-kpi .avr-portal-kpi-value { color: var(--fcp-red) !important; }
.avr-overdue-kpi .avr-portal-kpi-label { color: #b91c1c !important; }

/* ═══════════════════════════════════════════════════════════════════════
   RECONCILIATION STRIP
   ═══════════════════════════════════════════════════════════════════════ */

.avr-recon-strip {
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    background: var(--fcp-surface);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-recon-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--fcp-border);
}
.avr-recon-title { font-size: 0.8rem; font-weight: 700; color: var(--fcp-text-2); }
.avr-recon-score { font-size: 0.75rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; }
.avr-recon-score.is-good { background: var(--fcp-green-light); color: var(--fcp-green); }
.avr-recon-score.is-warn { background: var(--fcp-amber-light); color: var(--fcp-amber); }
.avr-recon-cells { display: grid; grid-template-columns: repeat(6, 1fr); }
.avr-recon-cell {
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 8px;
    border-right: 1px solid var(--fcp-border);
    text-align: center;
}
.avr-recon-cell:last-child { border-right: none; }
.avr-recon-num { font-size: 1.5rem; font-weight: 900; line-height: 1; color: var(--fcp-text); }
.avr-recon-lbl { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; color: var(--fcp-muted); }
.avr-recon-cell.is-good   .avr-recon-num { color: var(--fcp-green); }
.avr-recon-cell.is-warn   .avr-recon-num { color: var(--fcp-amber); }
.avr-recon-cell.is-danger .avr-recon-num { color: var(--fcp-red); }
.avr-recon-cell.is-neutral .avr-recon-num { color: var(--fcp-text); }

/* ═══════════════════════════════════════════════════════════════════════
   BOOKING PAGE COMPONENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Page Header ── */
.avr-page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--fcp-border);
}
.avr-page-header h4 {
    font-size: 1.15rem; font-weight: 800;
    color: var(--fcp-text); letter-spacing: -0.02em;
}
.avr-page-header .text-muted { font-size: 0.8rem; color: var(--fcp-muted) !important; }

/* ── Count Chips ── */
.avr-count-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.avr-count-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 11px; border-radius: 20px;
    font-size: 0.76rem; font-weight: 600;
    background: var(--fcp-surface); color: var(--fcp-text-2);
    text-decoration: none;
    border: 1px solid var(--fcp-border);
    transition: var(--fcp-transition);
}
.avr-count-chip:hover { background: var(--fcp-bg); color: var(--fcp-text); text-decoration: none; border-color: var(--fcp-border-dark); }
.avr-count-chip.is-muted { color: var(--fcp-faint); }
.avr-count-chip strong { color: var(--fcp-text); }

/* ── Urgency Strip ── */
.avr-urgency-strip {
    display: flex; align-items: stretch;
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    background: var(--fcp-surface);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-urgency-label {
    display: flex; align-items: center;
    padding: 10px 14px;
    font-size: 0.67rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--fcp-muted);
    background: #f8fafc;
    border-right: 1px solid var(--fcp-border);
    white-space: nowrap;
}
.avr-urgency-cell {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 12px 6px;
    text-decoration: none;
    border-right: 1px solid var(--fcp-border);
    transition: background .15s;
    text-align: center;
}
.avr-urgency-cell:last-child { border-right: none; }
.avr-urgency-cell:hover { text-decoration: none; }
.avr-urgency-stars { font-size: 0.68rem; line-height: 1; margin-bottom: 2px; }
.avr-urgency-num { font-size: 1.6rem; font-weight: 900; line-height: 1; color: var(--fcp-text); letter-spacing: -0.03em; }
.avr-urgency-text { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fcp-muted); margin-top: 2px; }
.avr-urgency-cell.is-low    { background: #fffdf5; }
.avr-urgency-cell.is-low:hover  { background: var(--fcp-amber-light); }
.avr-urgency-cell.is-low .avr-urgency-stars { color: #f59e0b; }
.avr-urgency-cell.is-medium { background: #fffbeb; }
.avr-urgency-cell.is-medium:hover { background: #fef3c7; }
.avr-urgency-cell.is-medium .avr-urgency-stars { color: var(--fcp-amber); }
.avr-urgency-cell.is-high   { background: #fff8f8; }
.avr-urgency-cell.is-high:hover { background: var(--fcp-red-light); }
.avr-urgency-cell.is-high .avr-urgency-stars { color: var(--fcp-red); }
.avr-urgency-cell.is-high .avr-urgency-num   { color: var(--fcp-red); }

/* ── QR Warning ── */
.avr-qr-warning {
    border: 1px solid #fde68a;
    border-radius: var(--fcp-radius);
    background: var(--fcp-amber-light);
    overflow: hidden;
    box-shadow: var(--fcp-shadow-xs);
}
.avr-qr-warning-summary {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 16px; cursor: pointer;
    font-size: 0.83rem; font-weight: 600; color: #92400e;
    list-style: none; user-select: none;
}
.avr-qr-warning-summary::-webkit-details-marker { display: none; }
.avr-qr-chevron { margin-left: auto; font-size: 0.65rem; transition: transform .2s; opacity: .6; }
.avr-qr-warning[open] .avr-qr-chevron { transform: rotate(180deg); }
.avr-qr-warning-list { list-style: none; padding: 0 16px 12px; margin: 0; }
.avr-qr-warning-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0; border-bottom: 1px solid #fde68a;
    font-size: 0.8rem;
}
.avr-qr-warning-row:last-child { border-bottom: none; }
.avr-qr-depot-name { flex: 1; color: #78350f; font-weight: 600; }
.avr-qr-missing-badge { font-size: 0.72rem; background: #fde68a; color: #92400e; border-radius: 20px; padding: 1px 8px; font-weight: 700; }
.avr-qr-print-link { font-size: 0.74rem; font-weight: 700; color: var(--fcp-blue); text-decoration: none; }
.avr-qr-print-link:hover { text-decoration: underline; }

/* ── Overdue Alert Strip ── */
.avr-overdue-alert-strip {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #fff;
    border-radius: var(--fcp-radius);
    box-shadow: 0 4px 16px rgba(220,38,38,.25);
}
.avr-overdue-alert-inner {
    display: flex; align-items: center;
    padding: 12px 16px; gap: 8px; flex-wrap: wrap;
}
.avr-overdue-pulse {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: rgba(255,255,255,.9);
    flex-shrink: 0;
    animation: fcp-pulse 1.4s ease-in-out infinite;
}
@keyframes fcp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .5; transform: scale(1.4); }
}
.avr-overdue-alert-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff; border-radius: var(--fcp-radius-sm);
    padding: 4px 13px; font-size: 0.78rem; font-weight: 700;
    text-decoration: none; white-space: nowrap;
    transition: background .18s;
}
.avr-overdue-alert-btn:hover { background: rgba(255,255,255,.28); color: #fff; text-decoration: none; }

/* ── Mini Strips (Pickup / Depot Moves) ── */
.avr-mini-strip {
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    background: var(--fcp-surface);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-mini-strip-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--fcp-border);
}
.avr-mini-strip-title { font-size: 0.77rem; font-weight: 700; color: var(--fcp-text-2); }
.avr-mini-strip-link { font-size: 0.73rem; font-weight: 700; color: var(--fcp-blue); text-decoration: none; }
.avr-mini-strip-link:hover { text-decoration: underline; }
.avr-mini-strip-cells { display: flex; }
.avr-mini-cell {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; padding: 12px 8px;
    border-right: 1px solid var(--fcp-border);
    text-decoration: none;
    transition: background .15s; text-align: center;
}
.avr-mini-cell:last-child { border-right: none; }
.avr-mini-cell:hover { background: var(--fcp-bg); text-decoration: none; }
.avr-mini-num { font-size: 1.4rem; font-weight: 900; color: var(--fcp-text); line-height: 1; letter-spacing: -0.02em; }
.avr-mini-lbl { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fcp-muted); margin-top: 3px; }
.avr-mini-cell.is-warn .avr-mini-num { color: var(--fcp-amber); }
.avr-mini-cell.is-good .avr-mini-num { color: var(--fcp-green); }
.avr-mini-cell.is-info .avr-mini-num { color: var(--fcp-blue); }

/* ── Collapsible Tables ── */
.avr-collapsible-table {
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    overflow: hidden;
    background: var(--fcp-surface);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-collapsible-table.avr-overdue-table { border-color: #fecaca; background: var(--fcp-red-light); }
.avr-collapsible-summary {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; cursor: pointer;
    font-size: 0.81rem; font-weight: 700; color: var(--fcp-text-2);
    background: #f8fafc; border-bottom: 1px solid var(--fcp-border);
    list-style: none; user-select: none;
    transition: background .15s;
}
.avr-collapsible-summary::-webkit-details-marker { display: none; }
.avr-collapsible-summary:hover { background: var(--fcp-bg); }
.avr-collapsible-summary.is-danger { background: #fff0f0; color: var(--fcp-red); border-bottom-color: #fecaca; }
.avr-collapsible-summary.is-danger:hover { background: #ffe4e4; }
.avr-collapse-chevron { margin-left: auto; font-size: 0.65rem; opacity: .5; transition: transform .2s; }
.avr-collapsible-table[open] .avr-collapse-chevron { transform: rotate(180deg); }
.avr-overdue-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--fcp-red); flex-shrink: 0;
    display: inline-block;
    animation: fcp-pulse 1.4s ease-in-out infinite;
}
.avr-overdue-row { background: rgba(220,38,38,.02); }

/* ── Fleet action buttons (existing Odoo portal nav buttons) ── */
.avr-portal-nav-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: var(--fcp-radius-sm);
    font-size: 0.77rem; font-weight: 700;
    background: var(--fcp-bg); color: var(--fcp-text-2);
    border: 1px solid var(--fcp-border);
    text-decoration: none;
    transition: var(--fcp-transition);
}
.avr-portal-nav-btn:hover {
    background: var(--fcp-blue-light); color: var(--fcp-blue);
    border-color: var(--fcp-blue-mid); text-decoration: none;
}

/* ── Overdue flash animation ── */
.tk-overdue-flash-card { animation: fcp-card-flash 2s ease-in-out infinite; }
@keyframes fcp-card-flash {
    0%, 100% { box-shadow: var(--fcp-shadow-xs); }
    50%       { box-shadow: 0 0 0 3px rgba(220,38,38,.2); }
}

/* ═══════════════════════════════════════════════════════════════════════
   PORTAL TABLE PAGE (portal.portal_table)
   ═══════════════════════════════════════════════════════════════════════ */

.o_portal_my_details .table thead th,
.portal.portal_table thead th,
table.o_portal_table thead th {
    background: #f8fafc;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fcp-muted);
    border-bottom: 1px solid var(--fcp-border) !important;
    padding: 10px 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   REGIONAL MANAGER DASHBOARD (avr-portal-shell)
   ═══════════════════════════════════════════════════════════════════════ */

.avr-portal-shell { font-family: var(--fcp-font); }
.avr-portal-header, .avr-page-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fcp-border);
    margin-bottom: 16px;
}
.avr-portal-header h1, .avr-page-header h4 {
    font-size: 1.15rem !important; font-weight: 800 !important;
    color: var(--fcp-text) !important; letter-spacing: -0.02em;
    margin-bottom: 0 !important;
}
.avr-portal-actions, .avr-page-header .d-flex.gap-2 {
    display: flex; gap: 8px !important; flex-wrap: wrap;
    align-items: center;
}

/* ── Unified Back Button ── */
.avr-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--fcp-radius-sm);
    font-size: 0.78rem; font-weight: 700;
    color: var(--fcp-text-2); background: var(--fcp-surface);
    border: 1px solid var(--fcp-border);
    text-decoration: none; transition: var(--fcp-transition);
    margin-right: 8px;
}
.avr-back-btn:hover {
    background: var(--fcp-bg); color: var(--fcp-text);
    border-color: var(--fcp-border-dark); text-decoration: none;
}

/* ── Unified KPI Styles ── */
.avr-kpi-card, .avr-portal-kpi-card {
    min-height: 110px;
    display: flex; flex-direction: column; justify-content: center;
}
.avr-kpi-row { margin-bottom: 4px; }
.avr-kpi-card {
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    padding: 16px;
    background: var(--fcp-surface);
    box-shadow: var(--fcp-shadow-xs);
}
.avr-kpi-label { font-size: 0.69rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fcp-muted); margin-bottom: 4px; }
.avr-kpi-value { font-size: 1.9rem; font-weight: 900; color: var(--fcp-text); letter-spacing: -0.03em; line-height: 1; }
.avr-card { border: 1px solid var(--fcp-border) !important; border-radius: var(--fcp-radius) !important; box-shadow: var(--fcp-shadow-xs) !important; }
.avr-card-header { background: #f8fafc !important; border-bottom: 1px solid var(--fcp-border) !important; font-size: 0.83rem !important; font-weight: 700 !important; color: var(--fcp-text-2) !important; }

/* ── Filter group (used in some pages) ── */
.avr-filter-group { display: flex; flex-wrap: wrap; gap: 6px; }
.avr-filter-btn {
    display: inline-flex; align-items: center;
    padding: 5px 14px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600;
    background: var(--fcp-surface); color: var(--fcp-text-2);
    border: 1px solid var(--fcp-border);
    text-decoration: none; transition: var(--fcp-transition);
}
.avr-filter-btn:hover, .avr-filter-btn.active {
    background: var(--fcp-blue); color: #fff !important;
    border-color: var(--fcp-blue); text-decoration: none;
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

/* ── Misc buttons ── */
.avr-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border-radius: var(--fcp-radius-sm); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: var(--fcp-transition); text-decoration: none; border: 1px solid transparent; }
.avr-btn-outline-primary { color: var(--fcp-blue); border-color: var(--fcp-blue-mid); background: var(--fcp-blue-light); }
.avr-btn-outline-primary:hover { background: var(--fcp-blue); color: #fff; }
.avr-btn-sm { padding: 4px 10px; font-size: 0.74rem; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .avr-portal-welcome-compact { flex-direction: column; align-items: flex-start; gap: 12px; }
    .avr-welcome-right { width: 100%; }
    .avr-urgency-strip { flex-direction: column; }
    .avr-urgency-label { border-right: none; border-bottom: 1px solid var(--fcp-border); }
    .avr-urgency-cell { flex-direction: row; gap: 12px; border-right: none; border-bottom: 1px solid var(--fcp-border); padding: 10px 14px; }
    .avr-urgency-cell:last-child { border-bottom: none; }
    .avr-page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 576px) {
    .avr-portal-nav-card { gap: 10px; padding: 12px; }
    .avr-nav-icon { width: 34px; height: 34px; font-size: 13px; }
    .avr-nav-desc { display: none; }
    .avr-recon-cells { grid-template-columns: repeat(3, 1fr); }
    .avr-recon-cell:nth-child(3n) { border-right: none; }
    .avr-mini-strip-cells { flex-wrap: wrap; }
    .avr-mini-cell { min-width: 50%; border-right: none !important; border-bottom: 1px solid var(--fcp-border); }
    .avr-mini-cell:last-child { border-bottom: none; }
    .o_portal_wrap .container { padding-top: 16px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   STANDARD ODOO PORTAL CARDS — match dark theme
   Targets: portal.portal_docs_entry cards (Orders, Invoices, Projects,
   Tasks, Connection & Security) injected into .o_portal_category blocks.
   ═══════════════════════════════════════════════════════════════════════ */

.o_portal_wrap .o_portal_category {
    --bs-gutter-y: 0.5rem;
}

.o_portal_wrap .o_portal_category .o_portal_index_card > a {
    background: var(--fcp-surface) !important;
    color: var(--fcp-text) !important;
    border: 1px solid var(--fcp-border);
    border-radius: var(--fcp-radius);
    box-shadow: var(--fcp-shadow-xs);
    transition: var(--fcp-transition);
    padding: 14px !important;
    min-height: 78px;
}

.o_portal_wrap .o_portal_category .o_portal_index_card > a:hover {
    transform: translateY(-2px);
    box-shadow: var(--fcp-shadow);
    border-color: var(--fcp-border-dark);
    text-decoration: none;
}

.o_portal_wrap .o_portal_category .o_portal_index_card h5 {
    color: var(--fcp-text) !important;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 2px !important;
}

.o_portal_wrap .o_portal_category .o_portal_index_card p,
.o_portal_wrap .o_portal_category .o_portal_index_card .text-600 {
    color: var(--fcp-muted) !important;
    font-size: 0.78rem;
}

.o_portal_wrap .o_portal_category .o_portal_index_card .o_portal_icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    box-shadow: 0 2px 8px rgba(37, 99, 235, .25);
    flex-shrink: 0;
}

.o_portal_wrap .o_portal_category .o_portal_index_card .o_portal_icon img {
    width: 22px; height: 22px;
    filter: brightness(0) invert(1);
}

/* Per-card icon color tints — keyed off destination URL */
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/orders"] .o_portal_icon,
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/quotes"] .o_portal_icon {
    background: linear-gradient(135deg, #047857, #10b981);
    box-shadow: 0 2px 8px rgba(16, 185, 129, .25);
}
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/invoices"] .o_portal_icon {
    background: linear-gradient(135deg, #b45309, #f59e0b);
    box-shadow: 0 2px 8px rgba(245, 158, 11, .25);
}
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/projects"] .o_portal_icon {
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    box-shadow: 0 2px 8px rgba(139, 92, 246, .25);
}
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/tasks"] .o_portal_icon {
    background: linear-gradient(135deg, #be185d, #ec4899);
    box-shadow: 0 2px 8px rgba(236, 72, 153, .25);
}
.o_portal_wrap .o_portal_category .o_portal_index_card > a[href*="/my/security"] .o_portal_icon {
    background: linear-gradient(135deg, #1e293b, #475569);
    box-shadow: 0 2px 8px rgba(71, 85, 105, .25);
}

/* Force 3-column grid on desktop to match Reports & Alerts */
@media (min-width: 768px) {
    .o_portal_wrap .o_portal_category .o_portal_index_card {
        flex: 0 0 auto;
        width: 33.3333%;
    }
}

