﻿/* ===== Dashboard Layout ===== */
.dashboard {
    height: 90vh;
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    box-sizing: border-box;
    background-color: #1E293B;
    color: #E2E8F0;
    font-family: "Segoe UI", sans-serif;
}

/* ===== Panels ===== */
.panel {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #273449, #1E293B);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

    .panel:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
        border-color: rgba(100, 150, 255, 0.2);
    }

    /* ===== Panel Header ===== */
    .panel > header {
        padding: 12px 16px;
        font-weight: 600;
        background: linear-gradient(180deg, #334155, #1E293B);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        color: #F1F5F9;
    }

/* ===== Panel Body ===== */
.panel-body {
    flex: 1;
    padding: 16px;
    color: #CBD5E1;
    overflow: auto;
}

/* ===== Orders Panel ===== */
.orders-panel .panel-body {
    display: block;
    padding: 16px;
}

.orders-summary {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    box-sizing: border-box;
}

/* ===== Orders Lines ===== */
.orders-line {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out forwards;
}

    /* Cascading animation delays */
    .orders-line:nth-child(1) {
        animation-delay: 0.1s;
    }

    .orders-line:nth-child(2) {
        animation-delay: 0.25s;
    }

    .orders-line:nth-child(3) {
        animation-delay: 0.4s;
    }

    .orders-line:nth-child(4) {
        animation-delay: 0.55s;
    }
    .orders-line:nth-child(5) {
        animation-delay: 0.55s;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.orders-line:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(148, 163, 184, 0.35);
}

.orders-label {
    font-weight: 600;
    color: #A5B4FC; /* soft indigo label */
    letter-spacing: 0.2px;
}

.orders-values {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-variant-numeric: tabular-nums;
}

    .orders-values .qty {
        font-weight: 700;
        color: #FACC15; /* amber for quantities */
        font-size: 1.05rem;
    }

    .orders-values .sep {
        opacity: 0.65;
    }

    .orders-values .val {
        font-weight: 700;
        color: #F8FAFC; /* bright value */
        font-size: 1.05rem;
    }

/* ===== Scrollbar (dark style) ===== */
.panel-body::-webkit-scrollbar {
    width: 8px;
}

.panel-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ===== Responsive Layout ===== */
@media (max-width: 900px) {
    .dashboard {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }
}

/* ===== Pending Orders Panel ===== */
.pending-panel .panel-body {
    display: block;
    padding: 16px;
}

.pending-summary {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    box-sizing: border-box;
}

/* Each pending order line */
.pending-line {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.2s ease, border-color 0.2s ease;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out forwards;
}

    /* Staggered animation delays */
    .pending-line:nth-child(1) {
        animation-delay: 0.7s;
    }

    .pending-line:nth-child(2) {
        animation-delay: 0.85s;
    }

    .pending-line:nth-child(3) {
        animation-delay: 1.0s;
    }

    .pending-line:nth-child(4) {
        animation-delay: 1.15s;
    }

    .pending-line:hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(148, 163, 184, 0.35);
    }

/* Text styles */
.pending-label {
    font-weight: 600;
    color: #93C5FD; /* soft blue label */
    letter-spacing: 0.2px;
}

.pending-values {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-variant-numeric: tabular-nums;
}

    .pending-values .qty {
        font-weight: 700;
        color: #FBBF24; /* warm yellow for quantities */
        font-size: 1.05rem;
    }

    .pending-values .sep {
        opacity: 0.65;
    }

    .pending-values .val {
        font-weight: 700;
        color: #F8FAFC;
        font-size: 1.05rem;
    }




/* ===== Donut (Panel 4) ===== */
.donut-panel .panel-body {
    position: relative;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-panel canvas {
    width: 80% !important;
    height: 80% !important; /* fill the cell */
    display: block;
    border-radius: 10px;
/*    background: rgba(255, 255, 255, 0.04);*/
/*    border: 1px solid rgba(255, 255, 255, 0.06);*/
}

/* subtle entrance animation to match other tiles */
.donut-panel .panel-body {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
}


/* ===== Processing Time Donut (Panel 6) ===== */
.processing-panel .panel-body {
    position: relative;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.processing-panel canvas {
    width: 80% !important;
    height: 80% !important;
    display: block;
    border-radius: 10px;
/*    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);*/
}

/* entrance animation */
.processing-panel .panel-body {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out 0.4s forwards;
}





/* ===== Australia Map (Panel 5) ===== */
.au-map-panel .panel-body {
    position: relative;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.au-map-panel canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Entrance animation to match others */
.au-map-panel .panel-body {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out 0.35s forwards;
}

/* Panel 5 donut fills tile and matches dark theme */
#panel5 .panel-body {
    position: relative;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease-out 0.35s forwards; /* matches your other panels */
}

#panel5 canvas {
    width: 80% !important;
    height: 80% !important;
    display: block;
    border-radius: 10px;
/*    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);*/
}


/* Make panel body a proper container for a full-height grid */
.orders-panel .panel-body {
    /* was: overflow:auto; */
    overflow: hidden; /* avoid internal scrollbar */
    padding: 16px; /* keep your inner gutter */
    display: block; /* don't center; let grid size itself */
    height: 100%; /* ensure child grid can fill */
}

/* 2×2 cards that fill the panel */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 16px;
    height: 100%; /* fill the body */
    width: 100%;
    box-sizing: border-box;
}

/* Each card stretches to its grid track */
.order-card {
    min-height: 0; /* allow content to fit without forcing overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    background: linear-gradient(145deg, #1E293B 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: transform .25s ease, box-shadow .3s ease;
}

    .order-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    }

    .order-card h3 {
        color: #94A3B8;
        font-size: 1rem;
        margin-bottom: 8px;
        font-weight: 500;
    }

    .order-card .qty {
        color: #FACC15;
        font-size: 5.2rem;
        font-weight: 700;
        line-height: 1;
    }

    .order-card .value {
        color: #38BDF8;
        font-size: 4rem;
        font-weight: 500;
    }

/* Entrance animation (kept) */
.orders-grid .order-card {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp .6s ease-out forwards;
}

    .orders-grid .order-card:nth-child(1) {
        animation-delay: .1s;
    }

    .orders-grid .order-card:nth-child(2) {
        animation-delay: .25s;
    }

    .orders-grid .order-card:nth-child(3) {
        animation-delay: .4s;
    }

    .orders-grid .order-card:nth-child(4) {
        animation-delay: .55s;
    }

/* IMPORTANT: keep 2×2 even on smaller screens (remove the old stacking rule) */
/* If you previously had: 
   @media (max-width: 768px) { .orders-grid { grid-template-columns:1fr; ... } }
   delete it or comment it out. */


/* ===== Orders Panel: single card with 2 rows (75/25) ===== */
.orders-panel .panel-body {
    overflow: hidden;
    padding: 16px;
    height: 100%;
    display: block;
}

.orders-2row-card {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: 3fr 1fr; /* 75% / 25% */
    gap: 14px;
/*    background: linear-gradient(145deg, #1E293B 0%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);*/
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp .6s ease-out .1s forwards;
}

/* Top area (big number) */
.orders-2row-top {
    display: grid;
    grid-template-rows: auto 1fr;
    align-items: start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px;
}

.orders-2row-label {
    color: #94A3B8;
    font-weight: 600;
    letter-spacing: .2px;
}

.orders-2row-number-error {
    align-self: end;
    color: #F23350; /* amber */
    font-size: clamp(5rem, 10vw, 10rem);
    font-weight: 800;
    line-height: .95;
    text-align: center; /* ✅ centers text horizontally */
    width: 100%; /* make sure it spans the container width */
}
.orders-2row-number {
    align-self: end;
    color: #FACC15; /* amber */
    font-size: clamp(5rem, 10vw, 10rem);
    font-weight: 800;
    line-height: .95;
    text-align: center; /* ✅ centers text horizontally */
    width: 100%; /* make sure it spans the container width */
}


/* Bottom area (month summary) */
.orders-2row-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 16px;
}

.orders-2row-bottom-left,
.orders-2row-bottom-right {
    display: grid;
    grid-template-rows: auto 1fr;
}

.orders-2row-sub-label {
    color: #A5B4FC; /* soft indigo */
    font-weight: 600;
    letter-spacing: .2px;
}

.orders-2row-sub-number {
    color: #F8FAFC;
    font-weight: 700;
    font-size: clamp(1.4rem, 3.2vw, 2.2rem);
    line-height: 1.1;
}

/* Mobile: stack the bottom items if narrow */
@media (max-width: 560px) {
    .orders-2row-bottom {
        grid-template-columns: 1fr;
    }
}
