* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: #f5f6f8;
    color: #252537;
    font-family: 'Montserrat', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: #252537;
    color: #fff;
    padding: 25px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.25);
    border-radius: 10px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-logo {
    font-size: 20px;
    font-weight: 700;
    padding: 0 12px 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.admin-logo span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 400;
    opacity: .65;
}

.admin-nav .nav-heading {
    padding: 20px 14px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: .45;
}

.admin-nav a {
    display: block;
    padding: 13px 14px;
    margin-bottom: 5px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .75);
    font-size: 13px;
    transition: .2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.admin-main {
    width: calc(100% - 240px);
    margin-left: 240px;
}

.admin-topbar {
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    background: #fff;
    border-bottom: 1px solid #e8e8ec;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.admin-topbar-right {
    color: #777;
    font-size: 12px;
}

.admin-content {
    padding: 35px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.page-heading h2 {
    margin: 0 0 7px;
    font-size: 24px;
}

.page-heading p {
    margin: 0;
    color: #888;
    font-size: 13px;
}

.card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8ec;
    border-radius: 12px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.admin-table th {
    padding: 15px 20px;
    background: #fafafa;
    color: #888;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
}

.admin-table td {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    vertical-align: middle;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 13px;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 7px;
    background: #f5f5f5;
}

.product-name {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
}

.product-id {
    color: #999;
    font-size: 11px;
}

.text-muted {
    color: #666;
}

.text-right {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 17px;
    border: 0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.btn-primary {
    background: #252537;
    color: #fff;
}

.btn-primary:hover {
    background: #3b3b55;
}

.btn-light {
    background: #f0f1f4;
    color: #252537;
}

.btn-danger {
    background: #fff0f0;
    color: #c0392b;
}

.status-badge {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.status-active {
    background: #eaf8ef;
    color: #218739;
}

.status-inactive {
    background: #f3f3f3;
    color: #888;
}

.empty-state {
    padding: 50px;
    color: #999;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-main {
        width: calc(100% - 200px);
        margin-left: 200px;
    }

    .admin-content {
        padding: 20px;
    }

    .admin-topbar {
        padding: 0 20px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* =========================
   ADMIN LOGIN
========================= */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background:
        radial-gradient(circle at 12% 15%, rgba(190, 156, 91, .12), transparent 30%),
        radial-gradient(circle at 90% 85%, rgba(37, 37, 55, .08), transparent 32%),
        #f7f5f0;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border: 1px solid rgba(37, 37, 55, .06);
    border-radius: 50%;
    top: -220px;
    right: -150px;
}

.login-page::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border: 1px solid rgba(190, 156, 91, .12);
    border-radius: 50%;
    bottom: -170px;
    left: -120px;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 1;
}

.login-card {
    padding: 48px 45px 38px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(37, 37, 55, .08);
    border-radius: 18px;
    box-shadow:
        0 25px 70px rgba(37, 37, 55, .08),
        0 4px 12px rgba(37, 37, 55, .03);
    backdrop-filter: blur(12px);
}

.login-brand {
    text-align: center;
    margin-bottom: 42px;
}

.login-brand::before {
    content: "✦";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 18px;
    border: 1px solid rgba(190, 156, 91, .45);
    border-radius: 50%;
    color: #be9c5b;
    font-size: 19px;
}

.login-brand h1 {
    margin: 0;
    color: #252537;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.6px;
}

.login-brand p {
    margin: 9px 0 0;
    color: #a09d98;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.login-heading {
    margin-bottom: 28px;
}

.login-heading h2 {
    margin: 0 0 9px;
    color: #252537;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.5px;
}

.login-heading p {
    margin: 0;
    color: #929099;
    font-size: 12px;
    line-height: 1.7;
}

.login-error {
    padding: 13px 15px;
    margin-bottom: 22px;
    border: 1px solid #ead1d1;
    border-radius: 8px;
    background: #fff7f7;
    color: #a94a4a;
    font-size: 11px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 21px;
}

.form-group label {
    display: block;
    margin-bottom: 9px;
    color: #4d4c58;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
}

.form-group input {
    width: 100%;
    height: 49px;
    padding: 0 15px;
    border: 1px solid #e3e1dc;
    border-radius: 8px;
    outline: none;
    background: #fcfcfb;
    color: #252537;
    font-family: inherit;
    font-size: 12px;
    transition:
        border-color .25s ease,
        background .25s ease,
        box-shadow .25s ease;
}

.form-group input::placeholder {
    color: #b8b5b0;
}

.form-group input:hover {
    border-color: #ccc8c0;
}

.form-group input:focus {
    border-color: #252537;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 37, 55, .05);
}

.login-button {
    width: 100%;
    height: 50px;
    margin-top: 8px;
    border-radius: 8px;
    background: #252537;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    box-shadow: 0 8px 18px rgba(37, 37, 55, .14);
    transition:
        background .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

.login-button:hover {
    background: #34344b;
    box-shadow: 0 11px 24px rgba(37, 37, 55, .18);
    transform: translateY(-1px);
}

.login-button:active {
    transform: translateY(0);
}

.back-to-site {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 27px;
    color: #99958e;
    font-size: 11px;
    transition: color .2s ease;
}

.back-to-site:hover {
    color: #252537;
}

@media (max-width: 520px) {
    .login-page {
        padding: 20px;
    }

    .login-card {
        padding: 38px 25px 30px;
        border-radius: 14px;
    }

    .login-brand {
        margin-bottom: 35px;
    }
}
/* =========================
   MOBILE ADMIN LAYOUT
========================= */
.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #252537;
    font-size: 25px;
    line-height: 1;
    padding: 8px;
    cursor: pointer;
}
.mobile-overlay { display: none; }

@media (max-width: 768px) {
    .admin-sidebar {
        width: 260px;
        max-width: 82vw;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 12px 0 35px rgba(0,0,0,.15);
    }
    .admin-sidebar.is-open { transform: translateX(0); }
    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.38);
        opacity: 0;
        visibility: hidden;
        transition: .25s ease;
        z-index: 999;
    }
    .mobile-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }
    .admin-main {
        width: 100%;
        margin-left: 0;
    }
    .admin-topbar {
        height: 64px;
        padding: 0 14px;
        gap: 10px;
    }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .admin-topbar h1 {
        font-size: 16px;
        flex: 1;
    }
    .admin-topbar-right {
        font-size: 10px;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .admin-content { padding: 16px 12px 28px; }
    .page-heading {
        gap: 14px;
        margin-bottom: 16px;
    }
    .page-heading h2 { font-size: 21px; }
    .page-heading p { font-size: 11px; line-height: 1.5; }
    .page-heading .btn { width: 100%; }
    .card { border-radius: 10px; }
    .card-header { padding: 16px; }
    .table-wrapper {
        overflow: visible;
    }
    .admin-table {
        min-width: 0;
        width: 100%;
        display: block;
    }
    .admin-table thead { display: none; }
    .admin-table tbody,
    .admin-table tr,
    .admin-table td { display: block; width: 100%; }
    .admin-table tr {
        padding: 15px;
        border-top: 1px solid #f0f0f0;
    }
    .admin-table tr:first-child { border-top: 0; }
    .admin-table td {
        padding: 6px 0;
        border: 0;
        font-size: 12px;
    }
    .admin-table td::before {
        display: inline-block;
        width: 72px;
        margin-right: 8px;
        color: #999;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }
    .admin-table td:nth-child(2)::before { content: "Code"; }
    .admin-table td:nth-child(3)::before { content: "Price"; }
    .admin-table td:nth-child(4)::before { content: "Stock"; }
    .admin-table td:nth-child(5)::before { content: "Unit"; }
    .admin-table td:nth-child(6)::before { content: "Status"; }
    .admin-table td:nth-child(7)::before { content: "Action"; }
    .admin-table td:first-child::before { display: none; }
    .product-info { gap: 11px; }
    .product-thumb { width: 54px; height: 54px; }
    .admin-table .text-right { text-align: left; }
    .admin-table .btn-light { width: 100%; margin-top: 5px; }
    .empty-state { padding: 35px 15px; }
}
@media (max-width: 380px) {
    .admin-topbar-right { display: none; }
    .login-card { padding: 30px 20px 26px; }
}


/* =========================================================
   PRODUCT FORM BUTTON FIX
   These pages use .admin-button, not only .btn.
   Keep this block at the end so it overrides older rules.
   ========================================================= */

.admin-button,
button.admin-button,
a.admin-button,
input[type="submit"].admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 20px;
    border: 1px solid #252537;
    border-radius: 9px;
    background: #252537;
    color: #ffffff !important;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(37, 37, 55, .18);
    transition: background .2s ease, border-color .2s ease,
                box-shadow .2s ease, transform .2s ease;
}

.admin-button:hover,
button.admin-button:hover,
a.admin-button:hover,
input[type="submit"].admin-button:hover {
    border-color: #151522;
    background: #151522;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(37, 37, 55, .25);
    transform: translateY(-1px);
}

.admin-button:active,
button.admin-button:active,
a.admin-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 7px rgba(37, 37, 55, .15);
}

/* Gold primary action */
.form-actions .admin-button:not(.secondary),
.admin-page-head > .admin-button:not(.secondary),
.admin-page-head .admin-button:not(.secondary) {
    border-color: #be9c5b;
    background: #be9c5b;
    color: #ffffff !important;
    box-shadow: 0 5px 12px rgba(190, 156, 91, .25);
}

.form-actions .admin-button:not(.secondary):hover,
.admin-page-head > .admin-button:not(.secondary):hover,
.admin-page-head .admin-button:not(.secondary):hover {
    border-color: #a98243;
    background: #a98243;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(190, 156, 91, .32);
}

/* Secondary actions remain clearly visible */
.admin-button.secondary,
button.admin-button.secondary,
a.admin-button.secondary {
    border-color: #252537;
    background: #252537;
    color: #ffffff !important;
}

.admin-button.secondary:hover,
button.admin-button.secondary:hover,
a.admin-button.secondary:hover {
    border-color: #151522;
    background: #151522;
    color: #ffffff !important;
}

/* Variation action buttons */
.table-actions .admin-button.small {
    display: inline-flex;
    min-height: 34px;
    padding: 8px 13px;
    border-radius: 7px;
    font-size: 11px;
}

.table-actions .admin-button.small.secondary {
    border-color: #c94b4b;
    background: #c94b4b;
    color: #ffffff !important;
}

.table-actions .admin-button.small.secondary:hover {
    border-color: #a93636;
    background: #a93636;
}

/* Make forms' action row visually separated */
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 30px;
    padding-top: 5px;
}

/* Add Variation area */
.variation-management .admin-page-head {
    align-items: center;
}

.variation-management .admin-page-head > .admin-button {
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .admin-button,
    .admin-page-head > .admin-button,
    .variation-management .admin-page-head > .admin-button {
        width: 100%;
        min-height: 46px;
    }

    .table-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-actions .admin-button.small {
        flex: 1 1 auto;
        min-width: 90px;
        width: auto;
    }
}

/* Product image upload controls */
.form-group input[type="file"] {
    min-height: 46px;
    padding: 10px;
    border: 1px dashed #be9c5b;
    border-radius: 9px;
    background: #fffaf2;
    color: #252537;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    margin-right: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: #252537;
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.form-help {
    display: block;
    margin-top: 6px;
    color: #888;
    font-size: 10px;
}

.current-product-image {
    display: block;
    width: 82px;
    height: 82px;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #e8e8ec;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}
/* =========================================================
   PRODUCT LIST CLEANUP
   ========================================================= */

.product-list-card {
    overflow: hidden;
}

.product-list-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.product-list-card .admin-table th,
.product-list-card .admin-table td {
    white-space: nowrap;
}

.product-list-card .admin-table td:first-child {
    white-space: normal;
    min-width: 240px;
}

.product-list-card .admin-table td:nth-child(3) {
    white-space: normal;
    min-width: 260px;
}

.variation-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.variation-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.variation-size {
    min-width: 55px;
    font-weight: 600;
    color: #252537;
}

.variation-price {
    color: #252537;
    font-weight: 600;
}

.variation-stock {
    color: #999;
    font-size: 10px;
}

.product-list-card .btn-light {
    padding: 9px 13px;
    font-size: 11px;
}

@media (max-width: 768px) {

    .product-list-card .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .product-list-card .admin-table td:nth-child(2)::before {
        content: "Code";
    }

    .product-list-card .admin-table td:nth-child(3)::before {
        content: "Sizes";
    }

    .product-list-card .admin-table td:nth-child(4)::before {
        content: "Stock";
    }

    .product-list-card .admin-table td:nth-child(5)::before {
        content: "Status";
    }

    .product-list-card .admin-table td:nth-child(6)::before {
        content: "Action";
    }

    .variation-row {
        gap: 6px;
    }

    .variation-size {
        min-width: 48px;
    }
}
/* =========================================================
   INVOICE PRINT LAYOUT
========================================================= */

@media print {

    /* Completely remove admin interface */
    html,
    body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .admin-layout {
        display: block !important;
        width: 100% !important;
        min-height: 0 !important;
    }

    .admin-sidebar,
    .admin-topbar,
    .mobile-overlay,
    .invoice-toolbar {
        display: none !important;
    }

    .admin-main {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    .admin-content {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Invoice page */
    .invoice-page {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .invoice {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    /* Invoice header */
    .invoice-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        width: 100% !important;
        padding: 0 0 18px !important;
        margin-bottom: 20px !important;
        border-bottom: 2px solid #222 !important;
    }

    .invoice-header h2 {
        font-size: 24px !important;
        margin: 0 0 5px !important;
    }

    .invoice-header p {
        margin: 0 !important;
    }

    .invoice-number {
        text-align: right !important;
    }

    /* Customer / Delivery */
    .invoice-parties {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        margin: 0 0 20px !important;
    }

    .invoice-box {
        display: block !important;
        min-height: 145px !important;
        padding: 15px !important;
        border: 1px solid #bbb !important;
        box-sizing: border-box !important;
    }

    .invoice-box h3 {
        margin: 0 0 12px !important;
        padding-bottom: 7px !important;
        border-bottom: 1px solid #ddd !important;
        font-size: 13px !important;
    }

    .invoice-box p {
        margin: 6px 0 !important;
        line-height: 1.45 !important;
    }

    /* Payment / status */
    .invoice-info {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        width: 100% !important;
        margin: 0 0 20px !important;
        border: 1px solid #bbb !important;
        box-sizing: border-box !important;
    }

    .invoice-info > div {
        padding: 10px 12px !important;
        border-right: 1px solid #bbb !important;
    }

    .invoice-info > div:last-child {
        border-right: 0 !important;
    }

    /* Product table */
    .invoice-items {
        width: 100% !important;
        overflow: visible !important;
    }

    .invoice-items table {
        width: 100% !important;
        min-width: 0 !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }

    .invoice-items th {
        padding: 9px 8px !important;
        border: 1px solid #999 !important;
        background: #f2f2f2 !important;
        font-size: 11px !important;
    }

    .invoice-items td {
        padding: 9px 8px !important;
        border: 1px solid #ccc !important;
        font-size: 11px !important;
    }

    /* Column widths */
    .invoice-items th:nth-child(1),
    .invoice-items td:nth-child(1) {
        width: 5% !important;
        text-align: center !important;
    }

    .invoice-items th:nth-child(2),
    .invoice-items td:nth-child(2) {
        width: 42% !important;
        text-align: left !important;
    }

    .invoice-items th:nth-child(3),
    .invoice-items td:nth-child(3) {
        width: 13% !important;
        text-align: center !important;
    }

    .invoice-items th:nth-child(4),
    .invoice-items td:nth-child(4) {
        width: 8% !important;
        text-align: center !important;
    }

    .invoice-items th:nth-child(5),
    .invoice-items td:nth-child(5) {
        width: 16% !important;
        text-align: right !important;
    }

    .invoice-items th:nth-child(6),
    .invoice-items td:nth-child(6) {
        width: 16% !important;
        text-align: right !important;
    }

    /* Totals */
    .invoice-total-area {
        display: flex !important;
        justify-content: flex-end !important;
        width: 100% !important;
        margin-top: 15px !important;
    }

    .invoice-totals {
        width: 300px !important;
    }

    .invoice-totals > div {
        display: flex !important;
        justify-content: space-between !important;
        padding: 6px 0 !important;
    }

    .invoice-totals .grand-total {
        padding-top: 10px !important;
        margin-top: 4px !important;
        border-top: 2px solid #222 !important;
        font-size: 16px !important;
    }

    /* Footer */
    .invoice-footer {
        width: 100% !important;
        margin-top: 30px !important;
        padding-top: 15px !important;
        border-top: 1px solid #ccc !important;
        text-align: center !important;
    }

    /* Keep sections together */
    .invoice-header,
    .invoice-parties,
    .invoice-info,
    .invoice-items,
    .invoice-total-area,
    .invoice-footer {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* A4 */
    @page {
        size: A4 portrait;
        margin: 12mm;
    }
}


/* =========================================================
   ORDERS PAGE - FUNCTIONAL ADMIN TABLE
   ========================================================= */
.admin-page {
    width: 100%;
}

.admin-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-page .page-header h1 {
    margin: 0 0 5px;
    color: #252537;
    font-size: 23px;
    font-weight: 700;
}

.admin-page .page-header p {
    margin: 0;
    color: #77777f;
    font-size: 12px;
}

/* Status filter: clear tabs instead of decorative floating links */
.admin-page .filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 15px;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #e1e2e7;
    border-radius: 8px;
}

.admin-page .filter-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #d9dae0;
    border-radius: 6px;
    background: #f7f7f9;
    color: #4c4c58;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.admin-page .filter-bar a:hover {
    background: #252537;
    border-color: #252537;
    color: #fff;
}

.admin-page .filter-bar a.active {
    background: #252537;
    border-color: #252537;
    color: #fff;
}

/* Useful feedback, not giant decorative banners */
.admin-page .alert {
    margin-bottom: 15px;
    padding: 10px 13px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.admin-page .alert-success {
    background: #eaf7ee;
    border: 1px solid #c8e8d2;
    color: #237b3d;
}

/* Orders table */
.admin-page .table-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    box-shadow: none;
}

.admin-page .admin-table-wrapper {
    overflow-x: auto;
}

.admin-page .admin-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
}

.admin-page .admin-table th {
    padding: 12px 13px;
    background: #252537;
    color: #fff;
    border: 0;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .25px;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-page .admin-table td {
    padding: 13px;
    border-top: 1px solid #e9eaee;
    color: #353540;
    font-size: 11px;
    line-height: 1.45;
    vertical-align: middle;
}

.admin-page .admin-table tbody tr:hover {
    background: #fafafc;
}

.admin-page .admin-table td:first-child {
    width: 48px;
    color: #8a8b93;
    text-align: center;
}

/* Order number must look like a real link, not mysterious text */
.admin-page .admin-table .order-id-link {
    display: inline-flex;
    align-items: center;
    width: auto;
    margin: 0 7px 0 0;
    padding: 4px 7px;
    border: 1px solid #cfd3df;
    border-radius: 5px;
    background: #f3f4f7;
    color: #252537 !important;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
}

.admin-page .admin-table .order-id-link:hover {
    background: #252537;
    border-color: #252537;
    color: #fff !important;
}

.admin-page .admin-table td small {
    display: block;
    margin-top: 4px;
    color: #85868e;
    font-size: 9px;
    line-height: 1.35;
}

/* Keep order number and date visually connected */
.admin-page .admin-table td[data-label="Order ID"] small {
    margin-top: 5px;
}

.admin-page .admin-table td[data-label="Order Amount"] strong {
    color: #252537;
    font-size: 12px;
    white-space: nowrap;
}

/* Payment mode and status */
.admin-page .admin-table td[data-label="Mode of Payment"] {
    white-space: nowrap;
}

.admin-page .admin-table td[data-label="Mode of Payment"] small {
    display: inline-block;
    margin: 0 0 0 5px;
    padding: 3px 6px;
    border-radius: 4px;
    background: #f1f2f4;
    color: #62636c;
    font-weight: 600;
}

.admin-page .status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-page .status-success {
    background: #e7f6ec;
    color: #237a3c;
}

.admin-page .status-danger {
    background: #fdeaea;
    color: #b23838;
}

.admin-page .status-warning {
    background: #fff4df;
    color: #a56a16;
}

.admin-page .status-pending {
    background: #eef0f4;
    color: #5e606b;
}

/* Delivery partner block stays compact and readable */
.admin-page .admin-table td[data-label="Delivery Partner"] strong {
    display: block;
    color: #252537;
    font-size: 11px;
}

.admin-page .admin-table td[data-label="Delivery Partner"] small {
    margin-top: 2px;
    color: #72737c;
}

.admin-page .muted-text {
    color: #9a9ba2;
    font-size: 10px;
}

/* Action button must look clickable */
.admin-page .admin-table .btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 31px;
    padding: 6px 11px;
    border: 1px solid #252537;
    border-radius: 5px;
    background: #252537;
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
}

.admin-page .admin-table .btn-small:hover {
    background: #be9c5b;
    border-color: #be9c5b;
    color: #fff !important;
}

/* Desktop column sizing */
.admin-page .admin-table th:nth-child(1),
.admin-page .admin-table td:nth-child(1) { width: 55px; }
.admin-page .admin-table th:nth-child(2) { width: 145px; }
.admin-page .admin-table th:nth-child(3) { width: 150px; }
.admin-page .admin-table th:nth-child(4) { width: 150px; }
.admin-page .admin-table th:nth-child(5) { width: 115px; }
.admin-page .admin-table th:nth-child(6) { width: 130px; }
.admin-page .admin-table th:nth-child(7) { width: 105px; }
.admin-page .admin-table th:nth-child(8) { width: 150px; }
.admin-page .admin-table th:nth-child(9) { width: 90px; }

@media (max-width: 768px) {
    .admin-page .page-header {
        margin-bottom: 14px;
    }

    .admin-page .page-header h1 {
        font-size: 20px;
    }

    .admin-page .filter-bar {
        gap: 6px;
        padding: 8px;
    }

    .admin-page .filter-bar a {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 10px;
    }

    .admin-page .admin-table {
        min-width: 0;
        display: block;
    }

    .admin-page .admin-table thead {
        display: none;
    }

    .admin-page .admin-table tbody,
    .admin-page .admin-table tr,
    .admin-page .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-page .admin-table tr {
        padding: 13px 14px;
        border-top: 1px solid #e4e5e9;
    }

    .admin-page .admin-table tr:first-child {
        border-top: 0;
    }

    .admin-page .admin-table td {
        min-height: 30px;
        padding: 5px 0 5px 86px;
        border: 0;
        position: relative;
    }

    .admin-page .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 7px;
        width: 76px;
        color: #777983;
        font-size: 9px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .admin-page .admin-table td:first-child {
        display: none;
    }

    .admin-page .admin-table td[data-label="Order ID"] {
        padding-top: 7px;
        padding-bottom: 8px;
    }

    .admin-page .admin-table td[data-label="Order ID"] small {
        display: inline-block;
        margin-left: 2px;
    }

    .admin-page .admin-table td[data-label="Mode of Payment"] small {
        margin-left: 5px;
    }

    .admin-page .admin-table .btn-small {
        min-width: 76px;
    }
}


/* Reports */
.admin-report-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.admin-report-filters input,.admin-report-filters select{min-height:40px;padding:9px 11px;border:1px solid #dfe1e6;border-radius:7px;background:#fff;font:inherit;font-size:12px;min-width:170px}
.admin-report-filters label{display:flex;align-items:center;gap:7px;font-size:11px;font-weight:700;color:#626673}
.btn-light{background:#f1f2f5!important;color:#333!important;border-color:#ddd!important}
.report-tabs a{display:inline-flex;align-items:center}
.report-cards{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:22px}
.report-cards>div{background:#fff;border:1px solid #e2e3e8;border-radius:10px;padding:16px 15px}
.report-cards span{display:block;color:#737783;font-size:10px;font-weight:700;text-transform:uppercase;margin-bottom:8px}
.report-cards strong{font-size:21px;color:#252537}
.report-section{margin-top:24px}.report-section h2{font-size:16px;margin:0 0 10px;color:#252537}
@media(max-width:1100px){.report-cards{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.report-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-report-filters{align-items:stretch}.admin-report-filters input,.admin-report-filters select{width:100%;min-width:0}.admin-report-filters label{width:100%;display:block}.admin-report-filters label input,.admin-report-filters label select{margin-top:5px}.admin-report-filters .btn{width:100%}}

/* Catalog and admin palette */
body {
    background: #f7f7ef;
    color: #172e23;
}
.admin-sidebar {
    background: #123b2c;
}
.admin-logo {
    border-bottom-color: #e6b75b;
}
.admin-nav a.active {
    background: #ffffff17;
    box-shadow: inset 3px 0 #e6b75b;
}
.btn-primary {
    background: #205d42;
}
.btn-primary:hover {
    background: #123b2c;
}
