/* =========================================================
   SAMBAIAH MUTTON & CHICKEN
   OWNER DASHBOARD
   ========================================================= */


/* =========================================================
   RESET
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =========================================================
   VARIABLES
   ========================================================= */

:root {

    --primary: #FF6F31;
    --primary-dark: #E85A20;
    --primary-light: #FFF0E8;

    --dark: #3A1F0F;
    --text: #241A14;
    --muted: #756B64;

    --background: #FAFAF8;
    --card: #FFFFFF;
    --border: #E8DED5;

    --success: #2E9B5B;
    --success-light: #EAF7EF;

    --warning: #E7A51A;
    --warning-light: #FFF6D9;

    --info: #3D78C9;
    --info-light: #EAF2FC;

    --danger: #D94A4A;
    --danger-light: #FDECEC;

    --shadow:
        0 4px 16px rgba(58, 31, 15, 0.08);

    --shadow-hover:
        0 8px 24px rgba(58, 31, 15, 0.12);
}


/* =========================================================
   BODY
   ========================================================= */

body {

    min-height: 100vh;

    background: var(--background);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
}


/* =========================================================
   TOP HEADER
   ========================================================= */

.topbar {

    min-height: 82px;

    padding: 14px clamp(20px, 4vw, 56px);

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    color: white;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 24px;

    box-shadow:
        0 4px 18px rgba(58, 31, 15, 0.18);
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {

    display: flex;

    align-items: center;

    gap: 14px;

    min-width: 0;
}


.brand-logo {

    width: 62px;

    height: 62px;

    background: transparent;

    border-radius: 14px;

    display: grid;

    place-items: center;

    padding: 0;

    flex: 0 0 auto;

    overflow: hidden;
}


.brand-logo img {

    width: 100%;

    height: 100%;

    object-fit: contain;

    display: block;
}


.brand-text h1 {

    font-size:
        clamp(18px, 2.2vw, 25px);

    line-height: 1.1;

    font-weight: 800;

    letter-spacing: -0.3px;

    color: rgb(0, 0, 0);
}


.brand-text p {

    margin-top: 4px;

    font-size: 13px;

    color: rgba(0, 0, 0, 0.88);
}


/* =========================================================
   TOP RIGHT
   ========================================================= */

.topbar-right {

    display: flex;

    align-items: center;

    gap: 12px;
}


.system-status {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 9px 13px;

    border: 1px solid rgba(255, 255, 255, 0.25);

    background: rgba(255, 255, 255, 0.10);

    border-radius: 999px;

    font-size: 13px;

    font-weight: 600;
}


.status-dot {

    width: 8px;

    height: 8px;

    border-radius: 50%;

    background: #4ade80;

    box-shadow:
        0 0 0 4px rgba(74, 222, 128, 0.14);
}


.refresh-btn {

    border: 1px solid rgba(255, 255, 255, 0.25);

    background: white;

    color: var(--dark);

    padding: 10px 15px;

    border-radius: 10px;

    cursor: pointer;

    font-weight: 700;

    font-size: 14px;

    transition: 0.18s ease;
}


.refresh-btn:hover {

    transform: translateY(-1px);

    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.15);
}


/* =========================================================
   MAIN
   ========================================================= */

main {

    width:
        min(1180px, calc(100% - 36px));

    margin: 0 auto;

    padding: 34px 0 50px;
}


/* =========================================================
   WELCOME
   ========================================================= */

.welcome-row {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 22px;
}


.eyebrow {

    color: var(--primary);

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 1.4px;

    margin-bottom: 6px;
}


.welcome-row h2 {

    font-size:
        clamp(25px, 4vw, 34px);

    letter-spacing: -0.8px;

    color: var(--text);
}


.subtitle {

    color: var(--muted);

    margin-top: 6px;

    font-size: 14px;
}


.last-updated {

    color: var(--muted);

    font-size: 12px;

    white-space: nowrap;
}


/* =========================================================
   STATISTICS
   ========================================================= */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 14px;

    margin-bottom: 32px;
}


.stat-card {

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 16px;

    padding: 18px;

    display: flex;

    align-items: center;

    gap: 13px;

    box-shadow: var(--shadow);

    transition: 0.18s ease;
}


.stat-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow-hover);
}


.stat-icon {

    width: 44px;

    height: 44px;

    border-radius: 12px;

    display: grid;

    place-items: center;

    background: var(--primary-light);

    color: var(--primary);

    font-size: 20px;
}


.stat-label {

    display: block;

    color: var(--muted);

    font-size: 12px;

    font-weight: 600;

    margin-bottom: 3px;
}


.stat-card strong {

    font-size: 25px;

    line-height: 1;

    color: var(--text);
}


/* =========================================================
   ORDERS SECTION
   ========================================================= */

.orders-section {

    background: transparent;

    margin-bottom: 40px;
}


.completed-section {

    margin-top: 10px;
}


.section-heading {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}


.section-heading h3 {

    font-size: 21px;

    color: var(--text);
}


.section-heading p {

    color: var(--muted);

    font-size: 13px;

    margin-top: 4px;
}


/* =========================================================
   LIVE BADGE
   ========================================================= */

.live-badge {

    display: inline-flex;

    align-items: center;

    gap: 7px;

    padding: 6px 10px;

    border-radius: 999px;

    background: var(--success-light);

    color: #15803d;

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.5px;
}


.live-badge span {

    width: 7px;

    height: 7px;

    border-radius: 50%;

    background: var(--success);
}


/* =========================================================
   COMPLETED BADGE
   ========================================================= */

.completed-badge {

    display: inline-flex;

    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    background: #F3EEE9;

    color: var(--dark);

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 0.5px;
}


/* =========================================================
   ORDER GRID
   ========================================================= */

#orders-container,
#completed-orders-container {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;
}


/* =========================================================
   ORDER CARD
   ========================================================= */

.order-card {

    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 18px;

    padding: 20px;

    box-shadow: var(--shadow);

    position: relative;

    overflow: hidden;

    transition: 0.18s ease;
}


.order-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow-hover);
}


.order-card::before {

    content: "";

    position: absolute;

    left: 0;

    top: 0;

    bottom: 0;

    width: 4px;

    background: var(--primary);
}


.order-card h2 {

    color: var(--primary-dark);

    font-size: 18px;

    margin-bottom: 15px;

    padding-right: 10px;
}


.order-card p {

    margin-bottom: 9px;

    color: #404040;

    font-size: 14px;

    line-height: 1.55;
}


.order-card p strong {

    color: var(--dark);
}


/* =========================================================
   STATUS BADGES
   ========================================================= */

.order-card .status-badge {

    display: inline-flex;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 11px;

    font-weight: 800;

    margin: 2px 0 12px;
}


.status-confirmed {

    background: var(--warning-light);

    color: #9A6800;
}


.status-preparing {

    background: var(--info-light);

    color: var(--info);
}


.status-ready {

    background: var(--success-light);

    color: #15803d;
}


.status-delivered {

    background: #F3EEE9;

    color: var(--dark);
}


.status-rejected,
.status-cancelled {

    background: var(--danger-light);

    color: var(--danger);
}


/* =========================================================
   ORDER TOTAL
   ========================================================= */

.order-total {

    margin: 14px 0 16px;

    padding-top: 13px;

    border-top: 1px solid var(--border);

    font-size: 18px !important;

    color: var(--dark);
}


/* =========================================================
   BUTTONS
   ========================================================= */

.order-actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;
}


.order-card button {

    padding: 10px 15px;

    border: none;

    border-radius: 10px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 750;

    transition: 0.18s ease;
}


.order-card button:hover {

    transform: translateY(-1px);

    filter: brightness(0.96);
}


.accept {

    background: var(--success);

    color: white;
}


.reject {

    background: var(--danger);

    color: white;
}


.ready {

    background: var(--primary);

    color: white;
}


.delivered {

    background: var(--dark);

    color: white;
}


/* =========================================================
   COMPLETED ORDER VISUAL
   ========================================================= */

.completed-section .order-card::before {

    background: #A69B91;
}


.completed-section .order-card {

    opacity: 0.94;
}


/* =========================================================
   LOADING / EMPTY
   ========================================================= */

.loading-card,
.empty-card {

    grid-column: 1 / -1;

    background: var(--card);

    border: 1px dashed var(--border);

    border-radius: 18px;

    padding: 48px 20px;

    text-align: center;

    color: var(--muted);
}


.loading-card h2,
.empty-card h2 {

    color: var(--dark);

    margin: 12px 0 5px;

    font-size: 18px;
}


/* =========================================================
   SPINNER
   ========================================================= */

.spinner {

    width: 28px;

    height: 28px;

    margin: 0 auto;

    border: 3px solid #E5E5E5;

    border-top-color: var(--primary);

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {

    width:
        min(1180px, calc(100% - 36px));

    margin: 0 auto;

    padding: 18px 0 28px;

    border-top: 1px solid var(--border);

    display: flex;

    justify-content: space-between;

    gap: 15px;

    color: #A3A3A3;

    font-size: 11px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 850px) {

    .stats-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }

    #orders-container,
    #completed-orders-container {

        grid-template-columns: 1fr;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 620px) {

    .topbar {

        align-items: flex-start;
    }


    .brand-logo {

        width: 52px;

        height: 52px;
    }


    .system-status {

        display: none;
    }


    .refresh-btn span {

        display: none;
    }


    .refresh-btn {

        padding: 10px 12px;

        font-size: 20px;
    }


    main {

        width:
            min(100% - 24px, 1180px);

        padding-top: 24px;
    }


    .welcome-row {

        align-items: flex-start;

        flex-direction: column;
    }


    .stats-grid {

        gap: 9px;
    }


    .stat-card {

        padding: 14px;
    }


    .stat-icon {

        width: 38px;

        height: 38px;

        font-size: 17px;
    }


    .stat-card strong {

        font-size: 21px;
    }


    footer {

        width: calc(100% - 24px);

        flex-direction: column;
    }
}