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

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f2f2f2;
    color: #15191c;
    overflow-x: hidden;
}

.website-box {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* ===== HEADER ===== */
.page-header {
    height: 88px;
    background: repeating-linear-gradient(135deg, #0b0f11 0px, #0b0f11 9px, #121719 10px, #121719 11px);
    border-bottom: 5px solid #c90000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px 0 50px;
    position: relative;
    z-index: 5;
}

.header-logo {
    width: 290px;
    height: 70px;
    background: #ffffff;
    display: flex;
    align-items: center;
    padding: 5px 10px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}

.header-logo img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    margin-right: 10px;
}

.header-logo b {
    color: #15191c;
    font-size: 20px;
    letter-spacing: 3px;
    border-left: 3px solid #c90000;
    padding-left: 12px;
    white-space: nowrap;
}

.header-admin {
    color: white;
    font-size: 13px;
    letter-spacing: 1px;
}

.header-admin b {
    color: #ff3b3b;
}

/* ===== SIDEBAR ===== */
.menu-trigger {
    position: fixed;
    left: 0;
    top: 0;
    width: 20px;
    height: 100vh;
    z-index: 1001;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 255px;
    height: 100vh;
    background: linear-gradient(180deg, #202527 0%, #15191b 50%, #0f1315 100%);
    border-right: 2px solid #c90000;
    padding: 26px 18px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: 5px 0 20px rgba(0, 0, 0, .35);
    overflow-y: auto;
}

.menu-trigger:hover + .sidebar,
.sidebar:hover {
    transform: translateX(0);
}

.sidebar-header {
    color: white;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 0 4px 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid #555;
}

.admin-session-name {
    display: block;
    margin-top: 8px;
    color: #b8bdc0;
    font-size: 11px;
    font-weight: normal;
    letter-spacing: 0;
    text-transform: none;
}

.menu > a.logout-link {
    margin-top: 18px;
    border-bottom: 1px solid #444;
    color: #ff8e8e;
}

.menu {
    width: 100%;
}

.menu > a {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    background: transparent;
    border: 1px solid #444;
    border-bottom: none;
    transition: .2s ease;
}

.menu > a:last-child {
    border-bottom: 1px solid #444;
}

.menu > a:hover,
.menu > a.active {
    background: #c90000;
    color: white;
}

.menu-dropdown {
    width: 100%;
}

.dropdown-btn {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #1d2428;
    color: white;
    border: 1px solid #384248;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}

.dropdown-btn:hover,
.admin-dropdown.is-open .dropdown-btn {
    background: #c90000;
    border-color: #c90000;
}

.dropdown-btn .arrow {
    font-size: 20px;
    font-weight: bold;
}

.dropdown-content {
    display: none;
    width: 100%;
    background: #111516;
    border-left: 1px solid #444;
    border-right: 1px solid #444;
    border-bottom: 1px solid #444;
}

.admin-dropdown.is-open .dropdown-content { display: block; }

.dropdown-content a {
    display: block;
    padding: 12px 28px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: .2s ease;
}

.dropdown-content a:hover,
.dropdown-content a.active-sub {
    background: #252a2c;
    color: #ff2020;
    padding-left: 34px;
}

/* ===== MAIN ===== */
.main-content {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #edf0f2 100%);
}

/* Desktop admin navigation stays visible and fixed while the content scrolls. */
@media (min-width: 701px) {
    .menu-trigger { display: none; }

    .sidebar {
        transform: translateX(0);
    }

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

.admin-title {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px 0;
}

.admin-title p {
    color: #d00000;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.admin-title h1 {
    font-size: 42px;
    letter-spacing: -1px;
    margin-bottom: 18px;
}

.admin-title span {
    display: block;
    width: 55px;
    height: 4px;
    background: #15191c;
    margin-bottom: 30px;
}

/* ===== DASHBOARD STAT CARDS ===== */
.stats-grid {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: #171b1d;
    color: white;
    padding: 26px;
    border-radius: 14px;
    border-left: 4px solid #c90000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .15);
}

.admin-placeholder {
    width: min(620px, calc(100% - 40px));
    margin: 10px auto 80px;
    padding: 54px 34px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 35px rgba(20, 30, 35, .09);
    text-align: center;
}
.placeholder-icon { width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 50%; background: #fae5e5; color: #c90000; display: grid; place-items: center; font-size: 28px; }
.admin-placeholder h2 { font-size: 22px; margin-bottom: 10px; }
.admin-placeholder p { color: #647078; line-height: 1.6; }

.sales-report { width: min(1180px, calc(100% - 40px)); margin: 0 auto 80px; }
.report-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 18px; padding: 18px; border-radius: 12px; background: #fff; box-shadow: 0 7px 20px rgba(20, 30, 35, .07); }
.report-controls label { display: grid; gap: 5px; color: #68757c; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.report-controls input, .report-controls select { min-height: 37px; padding: 7px 9px; border: 1px solid #d7dfe2; border-radius: 5px; color: #273238; background: #fff; }
.report-btn { min-height: 37px; padding: 0 13px; border: 0; border-radius: 5px; background: #c90000; color: #fff; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.report-btn:hover { background: #a90000; }
.report-btn-alt { background: #2c383e; }
.report-btn-alt:hover { background: #1a2327; }
.report-btn-print { margin-left: auto; background: #296d49; }
.report-btn-print:hover { background: #1e5939; }
.report-status { min-height: 20px; margin: 0 0 15px; color: #5b686f; font-size: 13px; }
.report-table-wrap { overflow-x: auto; border-radius: 12px; background: #fff; box-shadow: 0 7px 20px rgba(20, 30, 35, .07); }
.report-table { width: 100%; min-width: 750px; border-collapse: collapse; }
.report-table th { padding: 14px; background: #182125; color: #fff; font-size: 12px; text-align: left; }
.report-table td { padding: 12px 14px; border-bottom: 1px solid #e4e8e9; color: #354147; font-size: 13px; }
.report-order-header td { background: #f0f3f4; color: #152025; font-weight: 800; }
.report-total-row td { background: #fbfcfc; font-weight: 800; }
.report-grand-total td { background: #fae7e7; color: #a10000; font-size: 14px; font-weight: 800; }
.report-empty { padding: 45px !important; color: #69767d !important; text-align: center; }
.sales-chart-wrap { margin-top: 24px; padding: 24px; border-radius: 12px; background: #fff; box-shadow: 0 7px 20px rgba(20, 30, 35, .07); }
.sales-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; }
.sales-chart-grid .sales-chart-wrap { min-height: 250px; margin: 0; padding: 18px; }
.sales-chart-grid .sales-chart-bar { grid-column: 1 / -1; min-height: 235px; }
.sales-chart-grid .sales-chart-wrap h2 { margin: 0 0 10px; color: #1d272b; font-size: 15px; }
.sales-chart-grid .sales-chart-pie, .sales-chart-grid .sales-chart-line { grid-column: auto; }
.sales-chart-grid canvas { max-height: 200px; }
@media print { .sidebar, .menu-trigger, .page-header, .report-controls, .report-status { display: none !important; } .main-content { background: #fff; } .admin-title { padding-top: 20px; } .sales-report { width: 100%; } .report-table-wrap, .sales-chart-wrap { box-shadow: none; } }
@media (max-width: 760px) { .sales-chart-grid { grid-template-columns: 1fr; } .sales-chart-grid .sales-chart-wide { grid-column: auto; } }

.stat-card .stat-label {
    font-size: 12px;
    letter-spacing: 1px;
    color: #b8bdc0;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 34px;
    font-weight: 800;
}

/* ===== DARK FORM BOX (matches the wireframe) ===== */
.admin-form-wrapper {
    width: 100%;
    max-width: 560px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.admin-form {
    background: #171b1d;
    color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.admin-form-header {
    background: #0f1315;
    padding: 18px 26px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    border-bottom: 2px solid #c90000;
}

.admin-form-body {
    padding: 26px;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #b8bdc0;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 13px;
    background: #0f1315;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    font-size: 14px;
}

.form-hint { display: block; margin-top: 8px; color: #9ea8ad; font-size: 11px; line-height: 1.4; }

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #c90000;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* image upload box */
.image-upload {
    width: 100%;
    height: 140px;
    border: 2px dashed #444;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #0f1315;
    overflow: hidden;
    position: relative;
}

.image-upload:hover {
    border-color: #c90000;
}

.image-upload span {
    color: #888;
    font-size: 13px;
    letter-spacing: 1px;
}

.image-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.image-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    background: #c90000;
    color: white;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 4px;
    font-size: 14px;
}

.btn:hover {
    background: #a90000;
}

.btn-secondary {
    background: #333;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #111;
}

.btn-danger {
    background: #b00000;
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== TABLE ===== */
.table-wrapper {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.order-status-chart {
    display: grid;
    grid-template-columns: minmax(210px, .85fr) minmax(280px, 1.15fr);
    align-items: center;
    gap: 26px;
    margin-bottom: 24px;
    padding: 28px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 7px 20px rgba(20, 30, 35, .08);
}

.order-status-chart p { margin-bottom: 9px; color: #c90000; font-size: 11px; font-weight: 800; letter-spacing: 1.4px; }
.order-status-chart h2 { margin: 0 0 9px; font-size: 26px; }
.order-status-chart span { color: #68757c; font-size: 13px; line-height: 1.5; }
.order-status-canvas { position: relative; height: 265px; }

.product-table-box {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .08);
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.product-table th {
    background: #171b1d;
    color: white;
    padding: 14px;
    text-align: left;
    font-size: 13px;
}

.product-table td {
    padding: 13px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.product-table tr:hover {
    background: #f7f7f7;
}

.product-image {
    width: 70px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.product-image-placeholder { display: inline-grid; place-items: center; padding: 5px; background: #f2f4f5; color: #66737a; font-size: 9px; line-height: 1.15; text-align: center; }

.inline-form { display: flex; align-items: center; gap: 7px; }
.order-actions { display: flex; align-items: center; gap: 9px; }
.order-actions form { margin: 0; }
.order-actions .btn { padding: 8px 10px; font-size: 11px; }
.inline-form select { min-width: 100px; padding: 7px; border: 1px solid #d5dde0; border-radius: 4px; }
.table-action { padding: 8px 10px; border: 0; border-radius: 4px; background: #c90000; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.order-status { display: inline-block; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-pending { background: #fff2cf; color: #886000; }
.status-processing { background: #e2f0ff; color: #156097; }
.status-completed { background: #e1f5e8; color: #227342; }
.status-cancelled { background: #fbe3e3; color: #a12d2d; }

.no-image {
    width: 70px;
    height: 48px;
    border: 1px dashed #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #888;
    border-radius: 4px;
}
.category-manager-grid { display: grid; grid-template-columns: minmax(280px, .75fr) minmax(0, 1.65fr); gap: 28px; width: min(1180px, 88%); margin: 0 auto 70px; align-items: start; }
.category-manager-form { margin: 0; }
.category-manager-table { width: 100%; margin: 0; }
.category-actions { display: flex; gap: 8px; align-items: center; }
.category-actions form { margin: 0; }
.category-actions .btn { padding: 8px 10px; font-size: 11px; }
@media (max-width: 900px) { .category-manager-grid { grid-template-columns: 1fr; } }

.category-badge {
    font-weight: bold;
    color: #c90000;
}

.empty-state {
    padding: 60px;
    text-align: center;
    color: #c90000;
    font-family: monospace;
    letter-spacing: 1px;
}

/* ===== ALERT ===== */
.alert {
    padding: 14px 26px;
    margin: 0 0 22px;
    background: #2a1414;
    border-left: 4px solid #c90000;
    font-size: 14px;
    color: #ffb3b3;
}

.alert.success {
    background: #14261a;
    border-left-color: #2ecc71;
    color: #a6f2c4;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        repeating-linear-gradient(135deg, #0b0f11 0px, #0b0f11 9px, #121719 10px, #121719 11px);
    padding: 20px;
}

.login-box {
    width: 380px;
    max-width: 100%;
    background: #171b1d;
    border-radius: 10px;
    padding: 40px 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
    border-top: 4px solid #c90000;
}

.login-box .login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.login-box .login-logo img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    margin-right: 10px;
}

.login-box .login-logo b {
    color: white;
    font-size: 18px;
    letter-spacing: 3px;
}

.login-box p.subtitle {
    text-align: center;
    color: #888;
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .page-header {
        padding-left: 20px;
    }

    .header-logo {
        width: 250px;
    }

    .header-admin {
        display: none;
    }

    .sidebar {
        width: 240px;
    }

    .admin-title {
        padding-top: 40px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .order-status-chart {
        grid-template-columns: 1fr;
        padding: 22px;
    }
}
