﻿/* neo-fleet-dashboard.css */

:root {
    --nav-height: 20px;
    --container-padding: 1.5rem;
    --total-offset: calc(var(--nav-height) + (var(--container-padding) * 2));
    --gap: 1.5rem;
}

body {
    background: linear-gradient(225deg, #f6fbff, #d3dff2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   DASHBOARD CONTAINER
   ============================================ */
.dashboard-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: var(--container-padding);
    background: linear-gradient(225deg, #f6fbff, #d3dff2);
    font-family: 'Inter', system-ui, sans-serif;
}

/* ============================================
   LAYOUT - DESKTOP (3 columns)
   ============================================ */
.columns-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    min-height: calc(90vh - (var(--container-padding) * 2));
}

.col {
    display: grid;
    grid-template-rows: auto 1fr 1fr;
    gap: var(--gap);
    min-height: 0;
}

    .col:last-child {
        grid-template-rows: 1fr;
    }

/* ============================================
   BASE CARD
   ============================================ */
.card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px) saturate(200%);
    -webkit-backdrop-filter: blur(12px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 2rem;
    padding: 1.5rem 1.2rem;
    box-shadow: 0 20px 40px -15px rgba(18, 40, 80, 0.2), 0 2px 6px rgba(0,0,0,0.02), inset 0 1px 3px rgba(255,255,255,0.7);
    transition: all 0.25s cubic-bezier(0.15,0.75,0.3,1.1);
    animation: cardGlide 0.6s backwards;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

    .card:hover {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(255,255,255,0.9);
        box-shadow: 0 30px 55px -18px #1e3a8a50;
        transform: translateY(-4px) scale(1.01);
    }

@keyframes cardGlide {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #334e8e;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;

}

/* ============================================
   MINI CARDS ROW (6 KPI cards)
   ============================================ */
.mini-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.mini-card {
    min-height: 80px;
    align-items: center;
    justify-content: center; /* vertical */
    text-align: center; /* center text inside */
    max-height: 120px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 1.8rem;
    padding: 0.9rem;
    transition: 0.2s;
    animation: cardGlide 0.5s backwards;
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-shadow: 0 8px 24px -8px rgba(18, 40, 80, 0.15);
}

    .mini-card:hover {
        background: rgba(255, 255, 255, 0.8);
        transform: translateY(-3px);
    }

    .mini-card:nth-child(1) {
        animation-delay: 0.02s;
    }

    .mini-card:nth-child(2) {
        animation-delay: 0.07s;
    }

    .mini-card:nth-child(3) {
        animation-delay: 0.12s;
    }

.kpi-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(145deg, #122858, #1f4093);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0.1rem;
}

.kpi-footer {
    font-size: 0.7rem;
    color: #54709e;
    margin-top: auto;
    padding-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    background: rgba(45, 95, 215, 0.5);
    padding: 0.2rem 0.7rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.7rem;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(2px);
    color: white;
}

    .badge.positive {
        background: rgba(16, 185, 129, 0.15);
        color: #0b7e5b;
    }

    .badge.negative {
        background: rgba(239, 68, 68, 0.15);
        color: #b91c1c;
    }

    .badge.urgent {
        background: rgba(239, 68, 68, 0.25);
        color: #b91c1c;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ============================================
   BAR CHARTS
   ============================================ */
.month-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0.8rem 0 0.2rem;
    gap: 5px;
    flex: 1;
    min-height: 80px;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
}

    .bar-wrapper:hover {
        transform: scale(1.06);
        z-index: 5;
    }

.bar-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #4260a0;
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.bar {
    width: 60%;
    background: linear-gradient(0deg, #3b63cf, #6080e5);
    border-radius: 10px 10px 5px 5px;
    min-height: 4px;
    transition: height 0.3s cubic-bezier(0.23,1,0.32,1.2);
    box-shadow: 0 -2px 8px #3860cf66;
    animation: barGrow 1s ease-out backwards;
}

    .bar.secondary {
        background: linear-gradient(0deg, #e06711, #f88c3a);
        box-shadow: 0 -2px 8px #f97316b3;
    }

@keyframes barGrow {
    0% {
        height: 0%;
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* ============================================
   DONUT / RATIO CARD
   ============================================ */
.ratio-container {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex: 1;
    min-height: 0;
    flex-wrap: nowrap;
}

.donut-wrapper {
    width: 150px !important;
    height: 150px !important;
    flex-shrink: 0;
    align-self: center;
}

.donut-svg {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 6px 12px rgba(70,130,200,0.2));
    animation: donutPop 1s ease-out;
    transform: none;
}

@keyframes donutPop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    80% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* ── Ratio stats list ── */
.ratio-stats {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 0;
}

    .ratio-stats li {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        padding: 0;
        background: none;
        border-radius: 0;
        backdrop-filter: none;
        box-shadow: none;
        transition: 0.15s;
    }

        .ratio-stats li.ratio-data-row {
            background: rgba(255, 255, 255, 0.25);
            border-radius: 50px;
            padding: 0.22rem 0.7rem;
            margin-bottom: 0.22rem;
        }

            .ratio-stats li.ratio-data-row:hover {
                background: rgba(255, 255, 255, 0.6);
                transform: translateX(4px);
            }

        .ratio-stats li.ratio-group-header {
            padding: 0.1rem 0.2rem;
            margin-top: 0.2rem;
            margin-bottom: 0.2rem;
            background: none !important;
            cursor: default;
        }

            .ratio-stats li.ratio-group-header:hover {
                transform: none !important;
                background: none !important;
            }

.group-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #5570a0;
}

.group-ring-indicator {
    display: inline-block;
    border-radius: 50%;
    flex-shrink: 0;
}

    .group-ring-indicator.outer {
        width: 12px;
        height: 12px;
        border: 2.5px solid #3b82f6;
        background: transparent;
    }

    .group-ring-indicator.inner {
        width: 9px;
        height: 9px;
        border: 2px solid #1d4ed8;
        background: transparent;
    }

.ratio-stats li.ratio-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    margin: 0.3rem 0;
    padding: 0;
    min-height: 0;
}

    .ratio-stats li.ratio-divider:hover {
        transform: none !important;
        background: none !important;
    }

.color-dot {
    width: 11px;
    height: 11px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ratio-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: #10244e;
    white-space: nowrap;
}

.ratio-percent {
    font-size: 0.73rem;
    color: #5872a5;
    margin-left: auto;
    white-space: nowrap;
}

/* ============================================
   ASSET CATEGORY BARS
   ============================================ */
.category-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.75rem;
}

.category-name {
    width: 115px;
    font-size: 0.82rem;
    font-weight: 550;
    color: #1e2f50;
    flex-shrink: 0;
}

.bar-bg {
    flex: 1;
    height: 10px;
    background: rgba(30, 50, 90, 0.08);
    border-radius: 30px;
    overflow: hidden;
    min-width: 0;
}

.bar-fill {
    height: 10px;
    background: linear-gradient(90deg, #2e5fd7, #6292f0);
    border-radius: 30px;
    width: 0%;
    animation: fillSlide 1.4s forwards ease-out;
    box-shadow: 0 0 6px #3f78e0;
}

@keyframes fillSlide {
    0% {
        width: 0%;
    }
}

/* ============================================
   CALENDAR CARD
   ============================================ */
.calendar-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#upcomingRegsCalendar {
    flex: 1;
    min-height: 0;
}

/* ============================================
   FULLCALENDAR STYLES
   ============================================ */
.fc-event {
    font-size: 0.7rem !important;
    padding: 3px 5px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    overflow: visible !important;
    white-space: normal !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    line-height: 1.3 !important;
    min-height: 22px !important;
}

.fc-event-title {
    font-weight: 600 !important;
    font-size: 0.7rem !important;
    white-space: normal !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4) !important;
    word-wrap: break-word !important;
}

.fc-event-time {
    display: none !important;
}

.fc-daygrid-day {
    min-height: 80px !important;
}

.fc-daygrid-day-frame {
    min-height: 80px !important;
    padding: 2px !important;
}

.fc-daygrid-day-events {
    margin-bottom: 2px !important;
}

.fc-daygrid-day-top {
    padding: 4px !important;
}

.fc-daygrid-day-number {
    padding: 4px 6px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

.fc-daygrid-event-harness {
    margin-bottom: 3px !important;
}

.fc-daygrid-more-link {
    font-size: 0.68rem !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
    padding: 2px 5px !important;
    background: rgba(59,130,246,0.15) !important;
    border-radius: 4px !important;
}

    .fc-daygrid-more-link:hover {
        background: rgba(59,130,246,0.25) !important;
        text-decoration: none !important;
    }

.fc-event:hover {
    opacity: 0.95 !important;
    transform: translateY(-1px) !important;
    z-index: 10 !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25) !important;
}

.fc-day-today {
    background: rgba(255,220,120,0.12) !important;
}

    .fc-day-today .fc-daygrid-day-number {
        background: #f59e0b !important;
        color: white !important;
        font-weight: 700 !important;
        border-radius: 50% !important;
        width: 30px !important;
        height: 30px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

.fc-custom-tooltip {
    position: fixed !important;
    background: rgba(0,0,0,0.92) !important;
    color: white !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    white-space: normal !important;
    max-width: 300px !important;
    z-index: 10000 !important;
    pointer-events: none !important;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5) !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
}

.fc-custom-legend {
    display: flex !important;
    gap: 1.5rem !important;
    padding: 0.8rem 0 !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    margin-bottom: 0.5rem !important;
}

    .fc-custom-legend .legend-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        color: #334e8e !important;
    }

    .fc-custom-legend .legend-color {
        display: inline-block !important;
        width: 20px !important;
        height: 14px !important;
        border-radius: 3px !important;
        border: 1px solid rgba(255,255,255,0.5) !important;
    }

.fc-header-toolbar {
    padding: 0.5rem 0 !important;
    margin-bottom: 0.8rem !important;
}

.fc-toolbar-title {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    color: #334e8e !important;
}

.fc-button {
    background: rgba(59,99,207,0.15) !important;
    border: 1px solid rgba(59,99,207,0.3) !important;
    color: #334e8e !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    font-size: 0.8rem !important;
    border-radius: 8px !important;
    transition: all 0.2s !important;
}

    .fc-button:hover {
        background: rgba(59,99,207,0.25) !important;
        border-color: rgba(59,99,207,0.5) !important;
    }

    .fc-button:disabled {
        opacity: 0.4 !important;
    }

.fc-button-active {
    background: rgba(59,99,207,0.35) !important;
}

.fc-button:focus,
.fc-button:focus-visible,
.fc-button-primary:focus,
.fc-button-primary:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.fc-prev-button {
    margin-right: 6px !important;
}

.fc-col-header-cell {
    background: rgba(51,78,142,0.05) !important;
    font-weight: 600 !important;
    color: #334e8e !important;
    font-size: 0.75rem !important;
    padding: 8px 4px !important;
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: rgba(0,0,0,0.06) !important;
}

.fc-popover {
    background: rgba(255,255,255,0.98) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
}

.fc-popover-header {
    background: rgba(51,78,142,0.08) !important;
    color: #334e8e !important;
    font-weight: 600 !important;
    padding: 10px !important;
}

.fc-popover-body {
    padding: 8px !important;
}

/* ============================================
   TOOLTIP (bar charts)
   ============================================ */
.tooltip-text {
    display: none !important;
}

/* ============================================
   FLEX UTILITY
   ============================================ */
.flex {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   RESPONSIVE — TABLET (≤ 1100px)
   Two columns: col1+col2 stack, calendar full width
   ============================================ */
@media (max-width: 1100px) {
    .columns-3 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    /* Calendar takes full bottom row */
    .col:last-child {
        grid-column: 1 / -1;
        grid-template-rows: auto;
        height: auto;
    }

    .col {
        height: auto;
        grid-template-rows: auto 1fr 1fr;
    }

    .calendar-card {
        height: auto;
        min-height: 500px;
    }

    #upcomingRegsCalendar {
        min-height: 450px;
    }

    .fc-daygrid-day {
        min-height: 70px !important;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 768px)
   Single column, 6 mini-cards at top in 2×3 grid
   ============================================ */
@media (max-width: 768px) {
    :root {
        --container-padding: 1rem;
        --gap: 1rem;
    }

    .dashboard-container {
        padding: 1rem;
    }

    /* Stack all columns vertically */
    .columns-3 {
        grid-template-columns: 1fr;
    }

    /* All cols auto height */
    .col,
    .col:last-child {
        height: auto;
        grid-template-rows: auto;
        display: flex;
        flex-direction: column;
        gap: var(--gap);
    }

        /* ── 6 mini-cards: show ALL at top ── */
        /* Col 1 mini-row comes first naturally.        */
        /* Col 2 mini-row is reordered to top via flex. */
        .col:nth-child(2) .mini-row {
            order: -1; /* hoists col-2 mini-row up visually within its col */
        }

    /* Mini row: 2 columns on mobile (3 cards per row = wraps to 2 rows) */
    .mini-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .mini-card {
        min-height: 70px;
        padding: 0.7rem 0.5rem;
        border-radius: 1.2rem;
    }

    .kpi-number {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 0.6rem;
    }

    /* Cards */
    .card {
        border-radius: 1.5rem;
        padding: 1.2rem 1rem;
    }

    /* Bar chart — keep labels readable */
    .bar-label {
        font-size: 0.55rem;
    }

    .month-bars {
        gap: 3px;
        min-height: 100px;
    }

    /* Donut — stack vertically on small screens */
    .ratio-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .donut-wrapper,
    .donut-svg {
        width: 130px !important;
        height: 130px !important;
    }

    .ratio-stats {
        width: 100%;
    }

    /* Asset category */
    .category-name {
        width: 90px;
        font-size: 0.75rem;
    }

    /* Calendar */
    .calendar-card {
        min-height: 420px;
    }

    #upcomingRegsCalendar {
        min-height: 380px;
    }

    .fc-daygrid-day {
        min-height: 55px !important;
    }

    .fc-daygrid-day-frame {
        min-height: 55px !important;
    }

    .fc-event {
        font-size: 0.6rem !important;
    }

    .fc-event-title {
        font-size: 0.6rem !important;
    }

    .fc-toolbar-title {
        font-size: 1rem !important;
    }

    .fc-button {
        padding: 3px 7px !important;
        font-size: 0.72rem !important;
    }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ============================================ */
@media (max-width: 480px) {
    .mini-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .mini-card {
        min-height: 65px;
        padding: 0.6rem 0.4rem;
        border-radius: 1rem;
    }

    .kpi-number {
        font-size: 1.3rem;
    }

    .card-title,
    .mini-card .card-title {
        font-size: 0.55rem;
        letter-spacing: 0.2px;
    }

    .ratio-container {
        gap: 0.8rem;
    }

    .donut-wrapper,
    .donut-svg {
        width: 110px !important;
        height: 110px !important;
    }

    .category-name {
        width: 80px;
        font-size: 0.7rem;
    }

    .bar-fill,
    .bar-bg {
        height: 8px;
    }
}


.text-red {
    color: #b91c1c !important;
}

#upcomingRegsCalendar .fc-scroller {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

    #upcomingRegsCalendar .fc-scroller::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }