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

body{
    font-family:Karla,Arial,sans-serif;
    background:#f7f3f0;
    color:#2a1414;
    min-height:100vh;

    display:flex;
    align-items:center;
    justify-content:center;
}

.login-box{
    width:400px;
    max-width:90%;
    background:#fff;

    padding:35px;

    border-radius:12px;
    border:1px solid #e0d7d1;

    box-shadow:
        0 8px 25px
        rgba(67,11,11,.08);
}

.login-logo{
    width:80px;
    height:80px;

    display:block;

    margin:0 auto 15px;

    object-fit:contain;
}

.login-box h1{
    text-align:center;

    color:#430b0b;

    margin-bottom:8px;

    font-size:28px;
}

.login-box h2{
    text-align:center;

    color:#555;

    margin-bottom:30px;

    font-size:18px;

    font-weight:500;
}

.login-box label{
    display:block;

    font-size:13px;

    font-weight:600;

    margin-bottom:8px;

    color:#4a4140;
}

.login-box input{
    width:100%;

    height:44px;

    border:1px solid #cfc4be;

    border-radius:5px;

    padding:0 13px;

    margin-bottom:20px;

    outline:none;

    font-family:inherit;

    font-size:14px;
}

.login-box input:focus{
    border-color:#430b0b;
}

.login-box button{
    width:100%;

    height:46px;

    background:#430b0b;

    color:#fff;

    border:0;

    border-radius:5px;

    cursor:pointer;

    font-weight:600;

    font-family:inherit;

    transition:.2s;
}

.login-box button:hover{
    background:#5a1111;
}

.error{
    background:#ffe5e5;

    color:#8b0000;

    padding:10px;

    border-radius:5px;

    margin-bottom:20px;

    text-align:center;

    font-size:14px;
}

/* ===== ADMIN LOGIN STYLES ===== */

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

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

body{
    font-family:
        Karla,
        Arial,
        sans-serif;

    background:#f7f3f0;

    color:#2a1414;

    min-height:100vh;
}


/* =========================================================
   LAYOUT
========================================================= */

.admin-layout{
    display:flex;

    min-height:100vh;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar{
    width:245px;

    background:#fff;

    padding:32px 20px;

    border-right:
        1px solid #e5dcd6;

    position:fixed;

    left:0;
    top:0;
    bottom:0;

    overflow-y:auto;
}


.logo{
    width:72px;
    height:72px;

    border-radius:50%;

    display:block;

    margin:0 auto 12px;

    object-fit:contain;
}


.sidebar h2{
    text-align:center;

    font-size:18px;

    margin-bottom:30px;

    color:#430b0b;
}


/* =========================================================
   MENU
========================================================= */

.menu-title{
    font-size:11px;

    font-weight:600;

    color:#9a8e88;

    letter-spacing:1.5px;

    padding:0 16px;

    margin-bottom:10px;
}


.nav a{
    display:block;

    text-decoration:none;

    color:#5f5753;

    padding:14px 16px;

    border-radius:7px;

    margin-bottom:6px;

    transition:.2s;
}


.nav a:hover{
    background:#f2e9e5;

    color:#430b0b;
}


.nav a.active{
    background:#430b0b;

    color:#fff;
}


.menu-link{
    display:flex !important;

    align-items:center;

    gap:10px;
}


.menu-number{
    width:24px;
    height:24px;

    border-radius:50%;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:10px;

    background:#f1e8e4;

    color:#430b0b;

    flex-shrink:0;
}


/* =========================================================
   PRODUCT DROPDOWN
========================================================= */

.product-menu{
    margin-bottom:6px;
}


.product-dropdown{
    width:100%;

    border:0;

    background:transparent;

    color:#5f5753;

    padding:14px 16px;

    border-radius:7px;

    cursor:pointer;

    text-align:left;

    font-family:inherit;

    font-size:16px;

    transition:.2s;
}


.product-dropdown:hover{
    background:#f2e9e5;

    color:#430b0b;
}


.product-dropdown .menu-link{
    display:flex;

    align-items:center;

    gap:10px;
}


.product-dropdown .arrow{
    margin-left:auto;

    font-size:14px;

    transition:.2s;
}


.product-dropdown.open .arrow{
    transform:rotate(180deg);
}


/* =========================================================
   PRODUCT SUB MENU
========================================================= */

.product-submenu{
    display:none;

    padding:5px 0 5px 40px;
}


.product-submenu.show{
    display:block;
}


.product-submenu a{
    display:block;

    text-decoration:none;

    color:#6b625e;

    font-size:14px;

    padding:11px 14px;

    border-radius:6px;

    margin-bottom:3px;

    transition:.2s;
}


.product-submenu a:hover{
    background:#f2e9e5;

    color:#430b0b;
}


.product-submenu a.active{
    background:#430b0b;

    color:#fff;
}


/* =========================================================
   LOGOUT
========================================================= */

.logout{
    margin-top:25px !important;

    color:#900 !important;
}


.logout:hover{
    background:#ffeaea !important;

    color:#900 !important;
}


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

.main{
    margin-left:245px;

    flex:1;

    padding:42px 55px;
}


.page-title{
    text-align:center;

    color:#555;

    margin-bottom:28px;

    font-size:30px;

    font-weight:500;
}


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

.card{
    max-width:720px;

    margin:0 auto;

    background:#fff;

    border:
        1px solid #e0d7d1;

    border-radius:12px;

    padding:30px 34px;

    box-shadow:
        0 8px 25px
        rgba(67,11,11,.06);
}


.card-title{
    text-align:center;

    color:#430b0b;

    font-size:22px;

    margin-bottom:28px;
}


/* =========================================================
   FORM
========================================================= */

label{
    display:block;

    font-size:13px;

    font-weight:600;

    margin-bottom:8px;

    color:#4a4140;
}


input,
select,
textarea{
    width:100%;

    border:
        1px solid #cfc4be;

    border-radius:5px;

    font-size:14px;

    background:#fff;

    margin-bottom:20px;

    outline:none;
}


input,
select{
    height:44px;

    padding:0 13px;
}


textarea{
    min-height:110px;

    padding:12px 13px;

    resize:vertical;

    font-family:
        Karla,
        Arial,
        sans-serif;

    line-height:1.5;
}


input:focus,
select:focus,
textarea:focus{
    border-color:#430b0b;
}


.row{
    display:grid;

    grid-template-columns:
        1fr 1fr;

    gap:24px;
}


/* =========================================================
   IMAGE
========================================================= */

.image-box{
    height:180px;

    border:
        1px dashed #a99c95;

    border-radius:6px;

    display:flex;

    align-items:center;

    justify-content:center;

    color:#817771;

    margin-bottom:24px;

    cursor:pointer;

    overflow:hidden;

    position:relative;

    background:#fff;
}


#previewImage{
    display:none;

    width:100%;
    height:100%;

    object-fit:contain;
}


#editPreviewImage{
    width:100%;
    height:100%;

    object-fit:contain;
}


/* =========================================================
   BUTTON
========================================================= */

.add-btn{
    display:block;

    margin:4px auto 0;

    width:230px;

    min-height:48px;

    border:
        1px solid #430b0b;

    background:#fff;

    color:#430b0b;

    border-radius:4px;

    cursor:pointer;

    font-weight:600;

    letter-spacing:1px;

    transition:.2s;
}


.add-btn:hover{
    background:#430b0b;

    color:#fff;
}


/* =========================================================
   MESSAGE
========================================================= */

.message{
    max-width:1200px;

    margin:0 auto 20px;

    padding:12px;

    background:#e8f5e8;

    border:
        1px solid #b9d8b9;

    border-radius:6px;

    text-align:center;

    color:#315b31;
}


/* =========================================================
   PRODUCTS
========================================================= */

.products-box{
    max-width:1400px;

    margin:0 auto;

    background:#fff;

    border:
        1px solid #e0d7d1;

    border-radius:12px;

    padding:25px;

    overflow:auto;
}


.products-header{
    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    margin-bottom:20px;
}


.products-header h2{
    color:#430b0b;
}


.search-box{
    width:300px;

    height:42px;

    margin:0;

    padding:0 13px;
}


table{
    width:100%;

    border-collapse:collapse;

    min-width:1100px;
}


th{
    background:#430b0b;

    color:white;

    padding:12px;

    text-align:left;

    font-size:13px;
}


td{
    padding:12px;

    border-bottom:
        1px solid #ddd;

    vertical-align:middle;

    font-size:14px;
}


.product-img{
    width:70px;

    height:70px;

    object-fit:cover;

    border-radius:5px;

    border:
        1px solid #eee;
}


.description-cell{
    max-width:280px;

    min-width:220px;

    line-height:1.5;

    color:#5f5753;
}


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

.action{
    display:inline-block;

    padding:7px 10px;

    border-radius:4px;

    text-decoration:none;

    font-size:12px;

    margin:2px;
}


.edit-btn{
    background:#430b0b;

    color:white;
}


.edit-btn:hover{
    background:#5a1111;
}


.delete-btn{
    background:#fff;

    color:#900;

    border:
        1px solid #900;
}


.delete-btn:hover{
    background:#900;

    color:#fff;
}


/* =========================================================
   CANCEL BUTTON
========================================================= */

.cancel-btn{
    display:block;

    width:230px;

    height:48px;

    line-height:48px;

    text-align:center;

    margin:10px auto 0;

    border:
        1px solid #999;

    color:#555;

    text-decoration:none;

    border-radius:4px;

    font-weight:600;
}


.cancel-btn:hover{
    background:#eee;
}


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

@media(max-width:700px){

    .sidebar{
        width:190px;
    }

    .main{
        margin-left:190px;

        padding:28px 18px;
    }

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

    .card{
        padding:24px 18px;
    }

    .products-header{
        display:block;
    }

    .search-box{
        width:100%;

        margin-top:15px;
    }

}

/* Empty table state */
.empty-state{text-align:center;padding:30px}

/* Hidden file inputs */
#productImage,#editProductImage{display:none}


.back-to-store{
    display:block;
    margin-top:16px;
    text-align:center;
    color:#430b0b;
    text-decoration:none;
    font-size:13px;
    font-weight:600;
    letter-spacing:.5px;
}
.back-to-store:hover{
    text-decoration:underline;
}

/* =========================================================
   ORDERS (admin)
========================================================= */
.orders-empty{padding:30px;text-align:center;color:#8a5a3f;}
.order-address{min-width:200px;max-width:260px;}
.status-badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:12px;background:#f1d9cf;color:#430b0b;white-space:nowrap;}
.status-badge.status-processing{background:#fdebc8;color:#7a5200;}
.status-badge.status-shipped{background:#d7e8f8;color:#1d4a78;}
.status-badge.status-delivered{background:#dcefdc;color:#2d5a2d;}
.status-badge.status-cancelled{background:#f6d4d0;color:#8a2323;}
.order-view-btn,.order-back{display:inline-block;padding:8px 16px;background:#430b0b;color:#fff;border-radius:6px;font-size:12px;letter-spacing:1px;text-decoration:none;}
.order-view-btn:hover,.order-back:hover{background:#c0483f;}
.order-info-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:25px;}
.order-info-grid>div{background:#fbf6f1;border:1px solid #f1d9cf;border-radius:8px;padding:14px 16px;}
.order-info-grid>div.wide{grid-column:1/-1;}
.order-info-grid span{display:block;font-size:11px;letter-spacing:1px;color:#8a5a3f;margin-bottom:6px;}
.order-info-grid strong{font-weight:500;color:#2a1414;}
.order-items-table{min-width:0;margin-bottom:25px;}
.order-items-table tfoot td{border-bottom:0;font-size:16px;color:#430b0b;}
.order-total-label{text-align:right;letter-spacing:1px;font-size:12px!important;}
.order-status-form{display:flex;flex-wrap:wrap;align-items:center;gap:12px;}
.order-status-form label{font-size:12px;letter-spacing:1px;color:#430b0b;}
.order-status-form select{width:200px;margin:0;}
.order-status-form button{padding:12px 22px;background:#430b0b;color:#fff;border:0;border-radius:6px;cursor:pointer;letter-spacing:1px;font-family:inherit;}
.order-status-form button:hover{background:#c0483f;}
@media(max-width:700px){.order-status-form select{width:100%;}}

/* =========================================================
   DASHBOARD / CATEGORIES / CUSTOMERS / STOCK / REPORTS
========================================================= */
.message.error{background:#fbe9e7;border-color:#e6b8b2;color:#8a2323;}
.compact-table{min-width:0;}
.compact-table tfoot td{border-bottom:0;background:#fbf6f1;color:#430b0b;}
.dashboard-box{overflow:visible;}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px;margin-bottom:22px;}
.stat-grid.small{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));margin-top:6px;}
.stat-card{display:block;background:#fbf6f1;border:1px solid #f1d9cf;border-radius:10px;padding:22px 20px;text-decoration:none;color:#2a1414;transition:.2s;}
a.stat-card:hover{border-color:#430b0b;box-shadow:0 6px 18px rgba(67,11,11,.08);}
.stat-card span{display:block;font-size:11px;letter-spacing:1px;color:#8a5a3f;margin-bottom:10px;}
.stat-card strong{display:block;font-size:30px;font-weight:500;color:#430b0b;}
.stat-card small{display:block;margin-top:6px;font-size:11px;color:#8a5a3f;}
.header-actions{display:flex;align-items:center;gap:12px;}
.inline-form{display:inline;}
.cat-actions button.action{cursor:pointer;font-family:inherit;}
.sub-list{margin-bottom:6px;}
.sub-row{display:flex;align-items:center;gap:12px;}
.sub-row input[type=text]{margin-bottom:10px;}
.sub-row .sub-delete{display:flex;align-items:center;gap:6px;margin:0 0 10px;white-space:nowrap;font-weight:500;color:#900;}
.sub-row .sub-delete input{width:auto;height:auto;margin:0;}
.sub-used{margin:0 0 10px;font-size:12px;color:#8a5a3f;white-space:nowrap;}
.hint{font-weight:400;color:#8a5a3f;}
.stock-form{display:flex;align-items:center;gap:8px;}
.stock-form input{width:100px;height:36px;margin:0;}
.stock-form button{border:0;cursor:pointer;font-family:inherit;}
.stock-badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:12px;white-space:nowrap;}
.stock-ok{background:#dcefdc;color:#2d5a2d;}
.stock-low{background:#fdebc8;color:#7a5200;}
.stock-out{background:#f6d4d0;color:#8a2323;}
.report-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px;border-bottom:1px solid #e0d7d1;}
.report-tabs a{padding:10px 18px;text-decoration:none;color:#5f5753;font-size:13px;letter-spacing:.5px;border-bottom:3px solid transparent;margin-bottom:-1px;}
.report-tabs a:hover{color:#430b0b;}
.report-tabs a.active{color:#430b0b;font-weight:600;border-bottom-color:#430b0b;}
.report-filter{display:flex;flex-wrap:wrap;align-items:flex-end;gap:14px;margin-bottom:18px;}
.report-filter label{margin-bottom:6px;font-size:11px;letter-spacing:1px;}
.report-filter input{width:170px;margin:0;}
.report-filter .order-view-btn{border:0;cursor:pointer;font-family:inherit;height:44px;}
.report-clear{font-size:13px;color:#430b0b;align-self:center;}
.report-note{margin-top:14px;font-size:12px;color:#8a5a3f;}
.order-cancel-form{margin-top:18px;}
.order-cancel-form button{padding:12px 22px;background:#fff;color:#900;border:1px solid #900;border-radius:6px;cursor:pointer;letter-spacing:1px;font-family:inherit;}
.order-cancel-form button:hover{background:#900;color:#fff;}
.order-status-form select:disabled,.order-status-form button:disabled{opacity:.5;cursor:not-allowed;}

/* =====================================================================
   UI REFRESH LAYER (appended - refines the existing admin design)
   ===================================================================== */
body{-webkit-font-smoothing:antialiased;}
:focus-visible{outline:2px solid #c0483f;outline-offset:2px;}
.sidebar{box-shadow:4px 0 24px rgba(67,11,11,.06);overflow-y:auto;}
.nav a{transition:background .2s,color .2s,transform .15s;}
.nav a:hover{transform:translateX(2px);}
.main{background:#f7f3f0;}
.products-box,.card{border-radius:14px;box-shadow:0 4px 18px rgba(67,11,11,.06);}
.products-header h2,.page-title{font-family:Fraunces,Georgia,serif;font-weight:500;letter-spacing:.3px;color:#430b0b;}
input,select,textarea{border-radius:8px;}
input:focus,select:focus,textarea:focus{outline:0;border-color:#c0483f;box-shadow:0 0 0 3px rgba(192,72,63,.14);}

/* tables */
table{border-radius:10px;overflow:hidden;}
table thead th{background:#faf2ee;color:#430b0b;font-size:12px;letter-spacing:.8px;}
table tbody tr{transition:background .15s;}
table tbody tr:hover{background:#fdf8f5;}
.products-box{overflow-x:auto;}
.product-img{border-radius:8px;}

/* buttons */
.add-btn,.edit-btn,.delete-btn,.cancel-btn,.order-view-btn,.order-back,.order-status-form button,.order-cancel-form button{border-radius:8px;transition:background .2s,transform .15s,box-shadow .2s;}
.add-btn:hover,.edit-btn:hover,.order-view-btn:hover,.order-back:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(67,11,11,.18);}

/* stat cards + status */
.stat-card{border-radius:14px;box-shadow:0 4px 16px rgba(67,11,11,.06);transition:transform .2s,box-shadow .2s;}
a.stat-card:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(67,11,11,.12);}
.status-badge{font-weight:600;letter-spacing:.6px;}
tr.row-cancelled td{color:#9a7f78;background:#fffafa;}
tr.row-cancelled td:first-child{box-shadow:inset 3px 0 0 #c0483f;}
.message{border-radius:8px;}

/* tablet / mobile: sidebar becomes a top block instead of squeezing the page */
@media(max-width:800px){
    .admin-layout{flex-direction:column;}
    .sidebar{position:relative;width:100%;height:auto;bottom:auto;border-right:0;border-bottom:1px solid #e5dcd6;padding:18px 16px;}
    .main{margin-left:0;padding:22px 14px;}
    .nav{display:flex;flex-wrap:wrap;gap:6px;}
    .nav a{margin-bottom:0;}
    .products-box{padding:18px 14px;}
}

/* ---------- admin: dashboard extras + usability ---------- */
.dash-subtitle{margin:26px 0 12px;font-family:Karla,Arial,sans-serif;font-size:12px;letter-spacing:1.5px;color:#8a5a3f;font-weight:600;}
.dash-actions{display:flex;flex-wrap:wrap;gap:10px;margin:22px 0 4px;}
.dash-table-wrap{overflow-x:auto;}
.stat-card.attention strong{color:#430b0b;}
.stat-card.attention.warn{border-left:4px solid #e0a43a;}
.stat-card.attention.hot{border-left:4px solid #c0483f;}
.stat-card.attention.hot strong{color:#c0483f;}
.sidebar .nav a.active{box-shadow:0 4px 12px rgba(67,11,11,.25);}
.products-header{gap:12px;flex-wrap:wrap;}
.search-box{min-width:200px;}
table thead th{position:sticky;top:0;z-index:1;}
.orders-empty{background:#fdf8f5;border:1px dashed #e0d7d1;border-radius:10px;}
.report-tabs a{border-radius:8px 8px 0 0;}
.message{font-weight:500;}

/* ===== Reports > Sales Chart (jQuery + Chart.js) =====
   Scoped to .sales-report so the rest of the admin dashboard is not affected. */
.sales-report{font-family:'Karla',Arial,sans-serif;color:#2a1414;}
.sales-report h1,.sales-report h2{font-family:'Fraunces',Georgia,serif;color:#430b0b;text-transform:none;letter-spacing:0;margin:0;font-weight:600;}
.sales-report .sr-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:20px;}
.sales-report h1{font-size:30px;line-height:1.15;}
.sales-report h2{font-size:20px;margin-bottom:14px;text-align:left;}
.sales-report .sr-sub{margin:6px 0 0;color:#8a5a3f;font-size:14px;}
.sales-report .btn{border:0;cursor:pointer;height:auto;padding:10px 18px;border-radius:999px;font-family:'Karla',Arial,sans-serif;font-size:14px;font-weight:600;letter-spacing:.2px;text-transform:none;color:#fff;background:#430b0b;transition:background .15s,transform .15s,box-shadow .15s;float:none;margin:0;}
.sales-report .btn:hover{background:#c0483f;transform:translateY(-1px);box-shadow:0 6px 14px rgba(67,11,11,.18);opacity:1;}
.sales-report .btn.print{background:#fff;color:#430b0b;border:1px solid #e0cfc6;box-shadow:none;}
.sales-report .btn.print:hover{background:#fbf6f1;}
.sales-report .sr-filters{background:#fbf6f1;border:1px solid #f1d9cf;border-radius:16px;padding:18px 20px;display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px 28px;margin-bottom:20px;}
.sales-report .sr-label{display:block;font-size:11px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;color:#8a5a3f;margin-bottom:8px;}
.sales-report .sr-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.sales-report .sr-pills .btn{background:#fff;color:#430b0b;border:1px solid #e0cfc6;box-shadow:none;}
.sales-report .sr-pills .btn:hover{background:#f1d9cf;transform:none;box-shadow:none;}
.sales-report .sr-pills .btn.active{background:#430b0b;color:#fff;border-color:#430b0b;}
.sales-report .btn.custom{background:#c0483f;}
.sales-report .btn.custom:hover{background:#430b0b;}
.sales-report input.date-picker,.sales-report select.date-picker{width:auto;height:auto;margin:0;padding:9px 12px;border:1px solid #e0cfc6;border-radius:10px;background:#fff;color:#2a1414;font-family:'Karla',Arial,sans-serif;font-size:14px;}
.sales-report input.date-picker:focus,.sales-report select.date-picker:focus{outline:2px solid #c0483f;outline-offset:1px;}
.sales-report .sr-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px;margin-bottom:20px;}
.sales-report .sr-card{background:#fff;border:1px solid #f1d9cf;border-radius:16px;padding:18px 20px;box-shadow:0 4px 16px rgba(67,11,11,.06);border-top:4px solid #c0483f;}
.sales-report .sr-card:nth-child(2){border-top-color:#8a5a3f;}
.sales-report .sr-card:nth-child(3){border-top-color:#430b0b;}
.sales-report .sr-card span{display:block;font-size:11px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;color:#8a5a3f;}
.sales-report .sr-card strong{display:block;margin-top:6px;font-family:'Fraunces',Georgia,serif;font-size:28px;color:#430b0b;font-weight:600;}
.sales-report .sr-panel{background:#fff;border:1px solid #f1d9cf;border-radius:16px;padding:20px;box-shadow:0 4px 16px rgba(67,11,11,.06);margin-bottom:20px;}
.sales-report .sc-table-wrap{overflow-x:auto;border-radius:12px;border:1px solid #f1d9cf;}
.sales-report table{width:100%;min-width:640px;margin:0;border-collapse:collapse;background:#fff;}
.sales-report th,.sales-report td{padding:11px 12px;border:0;border-bottom:1px solid #f4e7df;text-align:center;font-family:'Karla',Arial,sans-serif;font-size:14px;letter-spacing:0;text-transform:none;color:#2a1414;}
.sales-report th{background:#430b0b;color:#fff;font-size:12px;font-weight:700;letter-spacing:1px;text-transform:uppercase;position:static;border-bottom:0;}
.sales-report .order-header td{background:#f1d9cf;font-weight:700;color:#430b0b;}
.sales-report tr:not(.order-header):not(.total-row):hover td{background:#fbf6f1;}
.sales-report .total-row td{background:#fbf6f1;font-weight:700;color:#430b0b;}
.sales-report .total-row.grand-total td{background:#430b0b;color:#fff;font-size:16px;border-bottom:0;}
.sales-report .orders-empty{background:#fdf8f5;border:0;border-radius:0;color:#8a5a3f;padding:28px;}
.sales-report .sr-chart{position:relative;width:100%;max-width:900px;margin:0 auto;}
.sales-report canvas{width:100% !important;max-width:100%;margin:0 auto;display:block;}
.sales-report .report-note{text-align:center;color:#8a5a3f;font-size:12px;margin:0;}
@media (max-width:600px){.sales-report h1{font-size:24px;}.sales-report .sr-card strong{font-size:24px;}}
@media print{
    .sidebar,.report-tabs,.products-header,.sales-report .sr-filters,.sales-report .btn.print{display:none !important;}
    .admin-layout{display:block !important;}
    .sales-report .sr-card,.sales-report .sr-panel{box-shadow:none;}
}

/* ---------- Admin charts (Orders + Reports) ---------- */
.chart-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:18px;margin:6px 0 24px;}
.chart-card{background:#fff;border:1px solid #f1d9cf;border-radius:14px;padding:18px 20px;box-shadow:0 4px 16px rgba(67,11,11,.06);}
.chart-card.wide{grid-column:1/-1;}
.chart-card h3{margin:0 0 12px;font-size:12px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:#430b0b;}
.chart-box{position:relative;width:100%;}
.chart-empty{margin:0;padding:40px 0;text-align:center;color:#8a5a3f;font-size:13px;}
@media print{.chart-card{box-shadow:none;break-inside:avoid;}}

/* =========================================================
   RESPONSIVE  (laptop -> tablet -> cellphone)
   Appended last so it can refine the earlier rules.
========================================================= */

/* --- base: admin pages never get wider than the screen --- */
html{-webkit-text-size-adjust:100%;}
body[data-current-page]{display:block;min-height:100vh;overflow-x:hidden;}
body[data-current-page] .admin-layout{width:100%;}
.main{min-width:0;}
.products-box,.card{max-width:100%;}
img{max-width:100%;}
.table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:10px;}
.table-scroll>table{margin:0;}

/* the mobile top bar only exists on small screens */
.mobile-topbar,.sidebar-backdrop{display:none;}

/* --- small laptops / landscape tablets --- */
@media(max-width:1200px){
    .main{padding:34px 30px;}
    .page-title{font-size:26px;margin-bottom:22px;}
}

/* --- tablets + phones: sidebar becomes a slide-in menu --- */
@media(max-width:900px){
    body[data-current-page] .admin-layout{display:block;}

    .mobile-topbar{
        display:flex;align-items:center;gap:12px;
        position:sticky;top:0;z-index:900;height:56px;padding:0 14px;
        background:#430b0b;color:#fff;box-shadow:0 2px 10px rgba(67,11,11,.25);
    }
    .mobile-topbar strong{font-family:Fraunces,Georgia,serif;font-weight:500;font-size:17px;letter-spacing:.4px;}
    .mobile-topbar-logo{width:30px;height:30px;border-radius:50%;background:#fff;object-fit:contain;}
    .menu-toggle{
        width:42px;height:42px;border:0;border-radius:8px;background:rgba(255,255,255,.12);
        display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;cursor:pointer;padding:0;
    }
    .menu-toggle span{display:block;width:20px;height:2px;background:#fff;border-radius:2px;transition:transform .2s,opacity .2s;}
    .menu-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg);}
    .menu-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
    .menu-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

    .sidebar{
        position:fixed;top:0;bottom:0;left:0;height:100%;width:280px;max-width:84vw;z-index:1000;
        padding:24px 18px;border-right:0;border-bottom:0;
        transform:translateX(-102%);transition:transform .25s ease;
        box-shadow:none;overflow-y:auto;-webkit-overflow-scrolling:touch;
    }
    .sidebar.open{transform:translateX(0);box-shadow:8px 0 30px rgba(0,0,0,.25);}
    .sidebar .nav{display:block;}
    .sidebar .nav a{margin-bottom:6px;}
    .sidebar-backdrop{
        display:block;position:fixed;inset:0;z-index:950;background:rgba(42,20,20,.5);
        opacity:0;pointer-events:none;transition:opacity .25s;
    }
    .sidebar-backdrop.show{opacity:1;pointer-events:auto;}
    body.menu-open{overflow:hidden;}

    .main{margin-left:0;padding:22px 16px 40px;}
    .page-title{display:none;}               /* the top bar already says "Glowblush Admin" */
    .products-box{padding:18px 16px;}
    .card{padding:24px 20px;}
}

/* --- phones --- */
@media(max-width:700px){
    .main{padding:16px 10px 36px;}
    .products-box{padding:14px 12px;border-radius:12px;}
    .card{padding:20px 14px;}
    .products-header{display:flex;flex-direction:column;align-items:stretch;gap:10px;}
    .products-header h2{font-size:20px;}
    .search-box{width:100%;min-width:0;margin:0;}
    .header-actions{flex-wrap:wrap;}

    /* forms: one column, big enough to tap, 16px stops iOS from zooming in */
    input,select,textarea{font-size:16px;}
    .row{grid-template-columns:1fr;gap:0;}
    .add-btn,.cancel-btn{width:100%;}
    .sub-row{flex-wrap:wrap;}

    /* dashboard / report cards: two per row */
    .stat-grid,.stat-grid.small{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
    .stat-card{padding:14px 12px;}
    .stat-card strong{font-size:22px;overflow-wrap:anywhere;}
    .stat-card span{font-size:10px;letter-spacing:.6px;}
    .dash-actions{gap:8px;}
    .dash-actions .order-view-btn{flex:1 1 calc(50% - 8px);text-align:center;}
    .order-info-grid{grid-template-columns:1fr;gap:10px;}

    /* report tabs scroll sideways instead of wrapping into 3 rows */
    .report-tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:2px;}
    .report-tabs a{white-space:nowrap;padding:10px 14px;}
    .report-filter>div{flex:1 1 130px;}
    .report-filter input{width:100%;}
    .report-filter .order-view-btn{flex:1 1 100%;}

    /* charts */
    .chart-grid{gap:12px;}
    .chart-card{padding:14px 12px;}

    /* sales chart tab */
    .sales-report h1{font-size:22px;}
    .sales-report .sr-filters{padding:14px;grid-template-columns:1fr;}
    .sales-report .sr-panel{padding:14px 12px;}
    .sales-report .sr-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
    .sales-report .sr-card:first-child{grid-column:1/-1;}
    .sales-report input.date-picker,.sales-report select.date-picker{flex:1 1 120px;min-width:0;}
    .sales-report .btn.print{width:100%;}

    /* order status form */
    .order-status-form{align-items:stretch;}
    .order-status-form button,.order-cancel-form button{width:100%;}

    /* ---------- tables become cards (labels come from js/admin_responsive.js) ---------- */
    .table-scroll{overflow:visible;}
    table.stack-table{min-width:0 !important;width:100%;display:block;background:transparent;border-radius:0;overflow:visible;}
    table.stack-table thead{display:none;}
    table.stack-table tbody,table.stack-table tfoot{display:block;}
    table.stack-table tr{
        display:block;margin-bottom:12px;padding:6px 14px;
        background:#fff;border:1px solid #f1d9cf;border-radius:12px;
        box-shadow:0 2px 10px rgba(67,11,11,.05);
    }
    table.stack-table tbody tr:hover{background:#fff;}
    table.stack-table td{
        display:flex;justify-content:space-between;align-items:center;gap:14px;
        padding:9px 0;border-bottom:1px dashed #efdfd6;text-align:right;
        min-width:0 !important;max-width:none !important;word-break:break-word;
    }
    table.stack-table td:last-child{border-bottom:0;}
    table.stack-table td:empty{display:none;}
    table.stack-table td::before{
        content:attr(data-label);flex:0 0 34%;max-width:40%;text-align:left;
        font-size:10.5px;font-weight:700;letter-spacing:.8px;text-transform:uppercase;color:#8a5a3f;
    }
    table.stack-table td[data-label=""]::before{display:none;}
    table.stack-table td[data-label=""]{justify-content:flex-end;}
    table.stack-table td>div{text-align:right;}
    table.stack-table .product-img{width:64px;height:64px;}
    table.stack-table .description-cell{line-height:1.45;}
    table.stack-table tfoot tr{background:#fbf6f1;}
    table.stack-table tr.row-cancelled{border-left:4px solid #c0483f;}
    table.stack-table tr.row-cancelled td:first-child{box-shadow:none;}
    table.stack-table .stock-form{justify-content:flex-end;}
    table.stack-table .stock-form input{width:84px;font-size:16px;}
    table.stack-table .action,table.stack-table .order-view-btn{padding:9px 14px;}

    /* the day-by-day sales table inside the Sales Chart tab keeps normal rows and scrolls sideways */
    .sales-report .sc-table-wrap{-webkit-overflow-scrolling:touch;}
}

/* --- very small phones --- */
@media(max-width:380px){
    .stat-grid,.stat-grid.small{grid-template-columns:1fr;}
    .mobile-topbar strong{font-size:15px;}
}

/* --- big screens: keep content from stretching too wide --- */
@media(min-width:1600px){
    .main{padding:48px 70px;}
}

@media print{
    .mobile-topbar,.sidebar-backdrop{display:none !important;}
    .main{margin-left:0 !important;padding:0 !important;}
}

/* ---------- Reports (Sales / Products Sales / Order Report) ---------- */
.sales-report .print-only{display:none;}
.sales-report .rc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:18px;}
.sales-report .rc-grid:empty{display:none;}
.sales-report .rc-chart h3{margin:0 0 12px;font-family:'Karla',Arial,sans-serif;font-size:12px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;color:#430b0b;text-align:left;}
.sales-report .rc-box{position:relative;width:100%;}
.sales-report .rc-box canvas{height:100% !important;}
.sales-report #chartsPanel:has(.rc-grid:empty){display:none;}
.sales-report td a{color:#430b0b;font-weight:700;}
.sales-report .status-badge{display:inline-block;}
@media print{
    @page{margin:14mm;}
    body,body[data-current-page]{background:#fff !important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
    .sales-report .sr-filters,.sales-report .btn.print{display:none !important;}
    .sales-report .print-only{display:inline;}
    .sales-report .sr-head{border-bottom:2px solid #430b0b;padding-bottom:10px;}
    .products-box{box-shadow:none !important;border:0 !important;padding:0 !important;}
    .sales-report .sr-card,.sales-report .sr-panel{box-shadow:none !important;break-inside:avoid;}
    .sales-report .sc-table-wrap{overflow:visible;}
    .sales-report table{min-width:0;}
    .sales-report thead{display:table-header-group;}
    .sales-report tr{break-inside:avoid;}
    .sales-report .rc-grid{grid-template-columns:1fr 1fr;}
}


/* =====================================================================
   RESPONSIVE FINISH — laptop + phone + tablet (admin side)
   ===================================================================== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
body{overflow-x:clip;}
img,video,svg,canvas{max-width:100%;}
.main{min-width:0;}
.mobile-topbar{padding-top:env(safe-area-inset-top);}
.sidebar{max-width:86vw;height:100vh;height:100dvh;}
.table-scroll,.sc-table-wrap,.dash-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;}
@media(max-width:900px){
  input,select,textarea{font-size:16px !important;max-width:100%;}
  .main{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right));padding-bottom:max(20px,env(safe-area-inset-bottom));}
}
@media(hover:none),(pointer:coarse){
  .sidebar a,.sidebar button,.menu-toggle,.main button,.main .btn{min-height:44px;}
}

.cancel-reason-note{margin-top:6px;color:#8a5a52;font-size:12px;max-width:200px;line-height:1.3}
