/* BƠBERRY ADMIN - BRAND STYLE */

:root {
    --olive: #65734C;
    --olive-dark: #4A5836;
    --cream: #F5F1E8;
    --white: #FFFEFB;
    --berry: #A13F48;
    --text: #343C2D;
    --muted: #858579;
    --border: #E3DFD4;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body {
    font-family: Arial, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
}

/* TRANG ĐĂNG NHẬP */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    padding: 42px 36px;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(65, 75, 45, 0.08);
}

/* THƯƠNG HIỆU */

.brand {
    text-align: center;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.brand h1 {
    font-family: Georgia, serif;
    font-size: 42px;
    font-weight: normal;
    letter-spacing: 3px;
    color: var(--olive);
}

.brand p {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-top: 12px;
}

.login-card h2 {
    font-size: 25px;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 30px;
}

/* Ô NHẬP LIỆU */

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

input {
    width: 100%;
    padding: 14px 15px;
    font-size: 16px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
    transition: 0.2s;
}

input:focus {
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(101, 115, 76, 0.12);
}

input::placeholder {
    color: #A5A59B;
}

/* NÚT BẤM */

button {
    border: none;
    border-radius: 8px;
    background: var(--olive);
    color: white;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: var(--olive-dark);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#login-btn {
    width: 100%;
    margin-top: 5px;
}

#login-message {
    color: var(--berry);
    font-size: 13px;
    text-align: center;
    margin-top: 15px;
    line-height: 1.6;
}

.login-footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
    margin-top: 30px;
}

/* TRANG QUẢN TRỊ */

#admin-page {
    min-height: 100vh;
}

#admin-page header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 20px 30px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

#admin-page header h1 {
    font-family: Georgia, serif;
    font-size: 24px;
    color: var(--olive);
}

#admin-page section {
    padding: 30px;
}

#admin-page section h2 {
    margin-bottom: 15px;
}

/* TƯƠNG THÍCH ĐIỆN THOẠI */

@media (max-width: 480px) {

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .brand h1 {
        font-size: 34px;
    }

    #admin-page header {
        padding: 16px;
    }

    #admin-page header h1 {
        font-size: 18px;
    }

    #admin-page section {
        padding: 20px;
    }
}



/* =================================
   BOBERRY ADMIN - DASHBOARD
================================= */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* MENU BÊN TRÁI */

.sidebar {
    width: 245px;
    height: 100vh;
    background: var(--olive-dark);
    color: white;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 28px 16px 20px;
    overflow-y: auto;
}

.sidebar-brand {
    text-align: center;
    padding-bottom: 25px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.sidebar-brand h1 {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: normal;
    letter-spacing: 2px;
    color: #FFFEFB;
}

.sidebar-brand p {
    font-size: 10px;
    letter-spacing: 3px;
    margin-top: 10px;
    color: #D6DCCB;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.nav-item {
    width: 100%;
    background: transparent;
    color: #E9EBDD;
    text-align: left;
    font-size: 14px;
    font-weight: 400;
    padding: 13px 16px;
    border-radius: 8px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.13);
    color: white;
}

.menu-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #B8C3A8;
    margin: 24px 0 8px 16px;
}

#logout-btn {
    margin-top: 25px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 13px;
}

#logout-btn:hover {
    background: var(--berry);
}

/* NỘI DUNG CHÍNH */

.admin-content {
    flex: 1;
    min-width: 0;
    background: var(--cream);
}

#admin-page .topbar {
    min-height: 76px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

#admin-page .topbar h1 {
    font-family: Arial, sans-serif;
    font-size: 21px;
    color: var(--text);
}

.admin-badge {
    background: #E8ECDF;
    color: var(--olive-dark);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    letter-spacing: 1px;
}

#menu-toggle {
    display: none;
}

#admin-page .page-section {
    padding: 30px;
    max-width: 1600px;
    margin: auto;
}

/* KHUNG CHÀO MỪNG */

.welcome-box {
    background: var(--olive);
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
}

#admin-page .welcome-box h2 {
    font-family: Georgia, serif;
    font-size: 28px;
    font-weight: normal;
    margin-bottom: 12px;
}

.welcome-box p {
    font-size: 14px;
    line-height: 1.7;
    color: #F1F3EB;
}

#today-date {
    margin-top: 12px;
    font-size: 12px;
}

/* CÁC Ô THỐNG KÊ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(65,75,45,0.03);
}

.stat-card p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.5;
}

#admin-page .stat-card h2 {
    font-size: 27px;
    color: var(--olive-dark);
    margin: 0;
    overflow-wrap: anywhere;
}

#total-unpaid {
    color: var(--berry) !important;
}

/* THAO TÁC NHANH */

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.quick-actions button {
    padding: 15px 24px;
}

#quick-cost-btn {
    background: var(--white);
    color: var(--olive-dark);
    border: 1px solid var(--olive);
}

#quick-cost-btn:hover:not(:disabled) {
    background: #E8ECDF;
}

/* KHUNG NỘI DUNG */

.content-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

#admin-page .content-card h2 {
    font-size: 17px;
    margin-bottom: 20px;
}

#today-deliveries,
#recent-orders {
    font-size: 14px;
    color: var(--muted);
    padding: 20px 0;
    text-align: center;
}

/* TƯƠNG THÍCH TABLET */

@media (max-width: 1100px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar {
        width: 220px;
    }
}

/* TƯƠNG THÍCH ĐIỆN THOẠI */

@media (max-width: 768px) {

    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(260px, 85vw);
        height: 100dvh;
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0,0,0,0.15);
    }

    .sidebar.open {
        display: flex;
    }

    #menu-toggle {
        display: block;
        padding: 9px 12px;
        font-size: 20px;
    }

    #admin-page .topbar {
        padding: 15px;
        gap: 10px;
    }

    #admin-page .topbar h1 {
        flex: 1;
        font-size: 16px;
    }

    #admin-page .page-section {
        padding: 16px;
    }

    .welcome-box {
        padding: 22px;
    }

    #admin-page .welcome-box h2 {
        font-size: 23px;
    }

    .dashboard-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    #admin-page .stat-card h2 {
        font-size: 21px;
    }

    .stat-card p {
        font-size: 12px;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-actions button {
        width: 100%;
    }

    .content-card {
        padding: 18px;
    }

    .admin-badge {
        display: none;
    }
}



/* =================================
   BOBERRY - QUAN LY DON HANG
================================= */

#orders {
    padding: 36px !important;
}

/* TIEU DE VA NUT TAO DON */

.order-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.order-toolbar h2 {
    font-size: 26px;
    font-weight: 600;
    line-height: 1.5;
}

.order-toolbar button {
    width: auto;
    min-height: 48px;
    padding: 14px 24px;
    border-radius: 9px;
}

/* KHUNG NOI DUNG */

#orders .content-card {
    padding: 30px;
    margin-bottom: 28px;
    border-radius: 14px;
}

/* TIEU DE O NHAP LIEU */

#orders label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* DONG BO O NHAP LIEU */

#orders input,
#orders select,
#orders textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 14px 16px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    box-sizing: border-box;
}

#orders input:focus,
#orders select:focus,
#orders textarea:focus {
    outline: none;
    border-color: var(--olive);
    box-shadow: 0 0 0 3px rgba(101,115,76,0.1);
}

/* DONG HUONG DAN TIM KIEM */

.field-hint {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    margin-top: 12px;
    margin-bottom: 28px;
}

/* DANH SACH DON HANG */

#order-result-count {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 20px;
}

#order-list {
    line-height: 1.8;
    color: var(--muted);
    padding: 20px 0;
}

/* FORM NHAP DON HANG */

#order-form-panel {
    margin-top: 36px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.form-field {
    min-width: 0;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

#orders textarea {
    resize: vertical;
    line-height: 1.7;
}

/* TONG KET THANH TOAN */

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.remaining-box {
    margin-top: 26px;
    padding: 24px;
    background: var(--cream);
    border-radius: 10px;
}

.remaining-box p {
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

#order-remaining {
    color: var(--berry);
    font-size: 30px;
}

#save-order-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 20px;
}

.secondary-btn {
    background: var(--white);
    color: var(--olive-dark);
    border: 1px solid var(--border);
}

/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    #orders {
        padding: 24px 20px !important;
    }

    .order-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 28px;
    }

    .order-toolbar h2 {
        font-size: 23px;
    }

    #orders .content-card {
        padding: 24px;
        margin-bottom: 26px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    #orders input,
    #orders select,
    #orders textarea {
        font-size: 16px;
    }

    .field-hint {
        margin-bottom: 26px;
    }
}



/* DIEU CHINH FORM TAO DON */

#order-form-panel {
    margin-top: 0;
}

#order-form-message {
    font-size: 14px;
    line-height: 1.7;
    margin: 16px 0;
}

#order-form-message:empty {
    display: none;
}

#save-order-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



/* =================================
   BOBERRY - DINH DANG TIEN TE
================================= */

/* AN MUI TEN TANG GIAM SO */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* O NHAP TIEN */

.money-input-wrapper {
    position: relative;
    width: 100%;
}

.money-input-wrapper input {
    padding-right: 45px !important;
    font-variant-numeric: tabular-nums;
}

.money-unit {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
}



/* =================================
   BOBERRY - DANH SACH DON HANG
================================= */

#order-list {
    display: grid;
    grid-template-columns: repeat(
        auto-fit, minmax(min(100%, 340px), 1fr)
    );
    gap: 28px;
    padding: 0;
    color: var(--text);
}

.order-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    min-width: 0;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.order-code {
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.order-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    background: #F4EBD9;
    color: #92713B;
}

.order-status.completed {
    background: #E8ECDF;
    color: var(--olive-dark);
}

.order-status.cancelled {
    background: #F5E3E3;
    color: var(--berry);
}

.order-customer-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.order-phone {
    font-size: 15px;
    color: var(--olive-dark);
}

.order-card-section {
    padding: 22px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border);
}

.order-product {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
}

.order-detail-text {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.8;
    margin-top: 8px;
    overflow-wrap: anywhere;
}

.order-money-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    padding: 10px 0;
}

.order-paid {
    color: var(--olive-dark);
}

.order-balance {
    margin-top: 18px;
    background: var(--cream);
    padding: 22px;
    border-radius: 10px;
}

.order-balance p {
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.order-balance strong {
    font-size: 26px;
    color: var(--berry);
    overflow-wrap: anywhere;
}

.order-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

@media (max-width: 768px) {

    #order-list {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .order-card {
        padding: 24px;
    }

    .order-customer-name {
        font-size: 19px;
    }

    .order-balance strong {
        font-size: 24px;
    }
}



/* =================================
   BOBERRY - CHI TIET DON HANG
================================= */

#order-detail-panel {
    width: 100%;
}

.order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.order-detail-grid .content-card {
    margin-bottom: 0 !important;
}

.order-detail-field {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.order-detail-field:last-child {
    border-bottom: none;
}

.order-detail-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
    line-height: 1.6;
}

.order-detail-value {
    font-size: 16px;
    color: var(--text);
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.order-detail-heading {
    font-size: 20px;
    color: var(--olive-dark);
    margin-bottom: 16px;
}

.order-detail-code {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.order-detail-top {
    margin-bottom: 28px;
}

.order-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.order-action-grid button {
    width: 100%;
    min-height: 50px;
    padding: 14px 20px;
    line-height: 1.6;
}

.danger-btn {
    background: #F8EEEE;
    color: var(--berry);
    border: 1px solid #E7CACA;
}

.danger-btn:hover:not(:disabled) {
    background: var(--berry);
    color: white;
}

.order-action-grid button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#order-detail-content {
    margin-bottom: 28px;
}

#order-detail-message {
    font-size: 14px;
    line-height: 1.7;
    margin-top: 20px;
}

#order-detail-message:empty {
    display: none;
}

.view-order-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    background: var(--white);
    color: var(--olive-dark);
    border: 1px solid var(--olive);
}

.view-order-btn:hover {
    background: #E8ECDF;
    color: var(--olive-dark);
}

@media (max-width: 768px) {

    .order-detail-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .order-action-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .order-detail-field {
        padding: 18px 0;
    }

    .order-detail-value {
        font-size: 15px;
    }
}



/* =====================================
   BOBERRY - CHINH BO CUC CHI TIET DON HANG
   ===================================== */

#order-detail-panel .order-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

#order-detail-panel .content-card {
    padding: 24px !important;
    margin: 0 !important;
    min-width: 0;
    height: auto !important;
}

#order-detail-panel .order-detail-heading {
    font-size: 18px;
    font-weight: 600;
    color: #4A5836;
    margin: 0 0 16px !important;
    padding: 0 !important;
}

#order-detail-panel .order-detail-field {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 6px !important;
    padding: 14px 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    border-bottom: 1px solid #E3DFD4;
}

#order-detail-panel .order-detail-field:last-child {
    border-bottom: none;
    padding-bottom: 0 !important;
}

#order-detail-panel .order-detail-label {
    font-size: 13px;
    color: #858579;
    line-height: 1.5;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    white-space: normal !important;
}

#order-detail-panel .order-detail-value {
    display: block;
    width: 100%;
    font-size: 15px;
    font-weight: 500;
    color: #343C2D;
    line-height: 1.6;
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    white-space: pre-line !important;
    overflow-wrap: anywhere;
}

#order-detail-panel .order-detail-top {
    margin-bottom: 24px;
}

#order-detail-panel .order-detail-code {
    overflow-wrap: anywhere;
}

/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    #order-detail-panel .order-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    #order-detail-panel .content-card {
        padding: 20px !important;
    }

    #order-detail-panel .order-detail-field {
        padding: 12px 0 !important;
    }

    #order-detail-panel .order-detail-heading {
        font-size: 17px;
    }

}


/* KHOA TIEN COC KHI CHINH SUA DON */

#orders .locked-payment-input,
#orders #payment-method:disabled {
    background: #F0EEE7 !important;
    color: #858579 !important;
    cursor: not-allowed;
    opacity: 1;
}


/* =====================================
   BOBERRY - LICH SU CHINH SUA DON HANG
   ===================================== */

#order-detail-panel #order-edit-history-panel {
    margin-top: 24px !important;
}

#order-edit-history-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#order-edit-history-content .history-item {
    background: #FFFEFB;
    border: 1px solid #E3DFD4;
    border-radius: 12px;
    padding: 20px;
    min-width: 0;
}

#order-edit-history-content h4 {
    color: #4A5836;
    font-size: 16px;
    margin: 0 0 8px;
}

#order-edit-history-content .history-date {
    color: #858579;
    font-size: 13px;
    margin-bottom: 16px;
}

#order-edit-history-content .history-change {
    border-top: 1px solid #E3DFD4;
    padding: 12px 0;
}

#order-edit-history-content .history-label {
    color: #858579;
    font-size: 13px;
    margin: 0 0 6px;
}

#order-edit-history-content .history-old {
    color: #858579;
    text-decoration: line-through;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#order-edit-history-content .history-new {
    color: #4A5836;
    font-size: 15px;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#order-edit-history-content .history-total {
    background: #F5F1E8;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#order-edit-history-content .history-positive {
    color: #65734C;
}

#order-edit-history-content .history-negative {
    color: #A13F48;
}

#order-edit-history-content .history-reason {
    margin-top: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#order-edit-history-content .history-empty {
    color: #858579;
    font-size: 14px;
    padding: 12px 0;
}

@media (max-width: 768px) {

    #order-edit-history-content .history-item {
        padding: 16px;
    }

}


/* =====================================
   BOBERRY - NUT LICH SU VA POPUP
   ===================================== */

#open-order-history {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    padding: 0 !important;
    margin: 0 !important;
    background: #FFFEFB;
    color: #65734C;
    border: 1px solid #D8D9CE;
    border-radius: 9px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto !important;
}

#open-order-history:hover:not(:disabled) {
    background: #E8ECDF;
}

#order-detail-panel :has(> #back-order-list):has(> #open-order-history) {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#order-detail-panel #back-order-list {
    width: auto !important;
    margin: 0 !important;
}

/* CUA SO LICH SU */

#order-detail-panel #order-edit-history-panel {
    position: fixed;
    inset: 0;
    width: min(560px, calc(100% - 32px));
    max-height: 85dvh;
    margin: auto !important;
    padding: 24px;
    border: 1px solid #E3DFD4;
    border-radius: 16px;
    background: #FFFEFB;
    color: #343C2D;
    overflow-y: auto;
    box-sizing: border-box;
}

#order-edit-history-panel:not([open]) {
    display: none !important;
}

#order-edit-history-panel::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.history-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.history-popup-header h3 {
    font-size: 18px;
    color: #4A5836;
    margin: 0;
}

#close-order-history {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #F5F1E8;
    color: #65734C;
    font-size: 25px;
    border: none;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

/* SUA KHOANG CACH NOI DUNG LICH SU */

#order-edit-history-content .history-old,
#order-edit-history-content .history-new,
#order-edit-history-content .history-reason {
    white-space: normal !important;
    padding: 0 !important;
    text-align: left !important;
    min-height: 0 !important;
}

@media (max-width: 768px) {

    #order-detail-panel #order-edit-history-panel {
        padding: 18px;
    }

    .history-popup-header h3 {
        font-size: 16px;
    }

}


/* =====================================
   BOBERRY - CAP NHAT TRANG THAI DON HANG
   ===================================== */

#order-status-popup {
    position: fixed;
    inset: 0;
    width: min(440px, calc(100% - 32px));
    max-height: 85dvh;
    margin: auto;
    padding: 24px;
    border: 1px solid #E3DFD4;
    border-radius: 16px;
    background: #FFFEFB;
    color: #343C2D;
    overflow-y: auto;
    box-sizing: border-box;
}

#order-status-popup:not([open]) {
    display: none !important;
}

#order-status-popup::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.status-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.status-popup-header h3 {
    font-size: 18px;
    color: #4A5836;
    margin: 0;
}

#close-status-popup {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #F5F1E8;
    color: #65734C;
    font-size: 25px;
    border: none;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.status-current-box {
    background: #F5F1E8;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
}

#order-status-popup label {
    display: block;
    font-size: 14px;
    color: #858579;
    margin-bottom: 10px;
}

#current-order-status {
    display: block;
    color: #65734C;
    font-size: 16px;
}

#new-order-status {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    border: 1px solid #E3DFD4;
    border-radius: 8px;
    background: #FFFEFB;
    color: #343C2D;
    font-size: 15px;
}

#status-update-message {
    color: #A13F48;
    font-size: 13px;
    line-height: 1.6;
    margin: 12px 0;
}

#save-order-status {
    width: 100%;
    min-height: 48px;
    background: #65734C;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#save-order-status:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* =====================================
   BOBERRY - POPUP HUY DON HANG
   ===================================== */

#order-cancel-popup {
    position: fixed;
    inset: 0;
    width: min(480px, calc(100% - 32px));
    max-height: 85dvh;
    margin: auto;
    padding: 24px;
    border: 1px solid #E3DFD4;
    border-radius: 16px;
    background: #FFFEFB;
    color: #343C2D;
    overflow-y: auto;
    box-sizing: border-box;
}

#order-cancel-popup:not([open]) {
    display: none !important;
}

#order-cancel-popup::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.cancel-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.cancel-popup-header h3 {
    font-size: 18px;
    color: #A13F48;
    margin: 0;
}

#close-cancel-popup {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #F5F1E8;
    color: #65734C;
    font-size: 25px;
    border: none;
    border-radius: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

.cancel-section-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

#order-cancel-popup .cancel-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid #E3DFD4;
    border-radius: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    line-height: 1.5;
}

#order-cancel-popup .cancel-option:has(input:checked) {
    background: #EDF0E7;
    border-color: #65734C;
}

#order-cancel-popup input[type="radio"],
#order-cancel-popup input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-height: 0 !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    accent-color: #65734C;
}

.cancel-option strong {
    display: block;
    font-size: 14px;
}

.cancel-option small {
    display: block;
    font-size: 13px;
    color: #858579;
    margin-top: 5px;
}

.cancel-warning {
    background: #FAF0F0;
    color: #A13F48;
    padding: 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
    margin: 20px 0;
}

.cancel-money-box {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    background: #F5F1E8;
    padding: 16px;
    border-radius: 10px;
    margin: 20px 0;
}

.cancel-money-box span {
    font-size: 13px;
    color: #858579;
}

.cancel-money-box strong {
    color: #4A5836;
    font-size: 16px;
    text-align: right;
}

#cancel-order-reason {
    display: block;
    width: 100%;
    min-height: 90px;
    padding: 12px;
    margin-top: 10px;
    border: 1px solid #E3DFD4;
    border-radius: 8px;
    background: #FFFEFB;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

#cancel-order-message {
    color: #A13F48;
    font-size: 13px;
    line-height: 1.6;
    margin: 14px 0;
}

#confirm-cancel-order {
    width: 100%;
    min-height: 48px;
    background: #A13F48;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#confirm-cancel-order:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 768px) {

    #order-cancel-popup {
        padding: 18px;
    }

}

/* =====================================
   BOBERRY - THONG TIN DON DA HUY
   ===================================== */

.order-cancellation-card {
    grid-column: 1 / -1;
    background: #FFFEFB;
    border: 1px solid #E3DFD4;
    border-radius: 14px;
    padding: 28px;
    margin-top: 12px;
}

.cancellation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #E3DFD4;
}

.cancellation-card-header h3 {
    color: #A13F48;
    font-size: 18px;
    margin: 0;
}

.cancellation-badge {
    background: #FAF0F0;
    color: #A13F48;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.cancellation-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.cancellation-info-grid > div {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cancellation-info-grid span {
    color: #858579;
    font-size: 13px;
}

.cancellation-info-grid strong {
    color: #343C2D;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.cancellation-full-width {
    grid-column: 1 / -1;
}

.cancellation-info-grid .refund-pending-text {
    color: #A13F48;
}

.cancellation-money-summary {
    background: #F5F1E8;
    border-radius: 10px;
    padding: 20px;
    margin-top: 24px;
}

.cancellation-money-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
}

.cancellation-money-summary span {
    color: #858579;
    font-size: 14px;
}

.cancellation-money-summary strong {
    color: #4A5836;
    font-size: 16px;
    text-align: right;
}

.refund-completed-date {
    color: #65734C;
    font-size: 14px;
    margin-top: 20px;
    line-height: 1.6;
}

#open-deposit-refund {
    width: 100%;
    min-height: 48px;
    margin-top: 24px;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    background: #65734C;
    color: #FFFFFF;
    cursor: pointer;
}

#open-deposit-refund:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 768px) {

    .order-cancellation-card {
        padding: 20px;
    }

    .cancellation-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cancellation-money-summary {
        padding: 14px;
    }

}

/* =====================================
   BOBERRY - POPUP HOAN TIEN COC
   ===================================== */

#deposit-refund-popup {
    position: fixed;
    inset: 0;
    width: min(440px, calc(100% - 32px));
    max-height: 85dvh;
    margin: auto;
    padding: 26px;
    border: 1px solid #E3DFD4;
    border-radius: 16px;
    background: #FFFEFB;
    color: #343C2D;
    overflow-y: auto;
    box-sizing: border-box;
}

#deposit-refund-popup:not([open]) {
    display: none !important;
}

#deposit-refund-popup::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.refund-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.refund-popup-header h3 {
    color: #4A5836;
    font-size: 18px;
    margin: 0;
}

#close-deposit-refund {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none;
    border-radius: 8px;
    background: #F5F1E8;
    color: #65734C;
    font-size: 25px;
    cursor: pointer;
    flex-shrink: 0;
}

.refund-amount-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #F5F1E8;
    padding: 22px;
    border-radius: 10px;
    margin-bottom: 24px;
}

.refund-amount-box span {
    font-size: 14px;
    color: #858579;
}

.refund-amount-box strong {
    font-size: 28px;
    color: #4A5836;
}

#deposit-refund-popup > label {
    font-size: 14px;
    font-weight: 500;
}

#deposit-refund-method,
#deposit-refund-notes {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 22px;
    border: 1px solid #E3DFD4;
    border-radius: 8px;
    background: #FFFEFB;
    color: #343C2D;
    font-family: inherit;
    font-size: 14px;
}

#deposit-refund-method {
    min-height: 48px;
}

#deposit-refund-notes {
    min-height: 90px;
    resize: vertical;
}

.refund-warning {
    background: #FAF0F0;
    color: #A13F48;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.refund-confirm-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.6;
    cursor: pointer;
}

#confirm-refund-completed {
    width: 18px !important;
    height: 18px !important;
    min-height: 0 !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    accent-color: #65734C;
    flex-shrink: 0;
}

#deposit-refund-message {
    color: #A13F48;
    font-size: 13px;
    line-height: 1.6;
    margin: 16px 0;
}

#save-deposit-refund {
    width: 100%;
    min-height: 48px;
    padding: 12px;
    background: #65734C;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#save-deposit-refund:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 768px) {

    #deposit-refund-popup {
        padding: 20px;
    }

}


/* CANH BAO THOI GIAN GIAO HOA */

.order-priority {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    margin-top: 18px;
    border-radius: 10px;
    line-height: 1.5;
}

.order-priority strong {
    font-size: 13px;
    font-weight: 700;
}

.order-priority span {
    font-size: 13px;
    font-weight: 400;
}

/* CANH BAO TRONG 24 GIO */

.order-priority.priority-24h {
    background: #FFF3CD;
    color: #947019;
}

/* CANH BAO TRONG 12 GIO */

.order-priority.priority-12h {
    background: #FFE5CC;
    color: #B5651D;
}

/* CANH BAO TRONG 6 GIO */

.order-priority.priority-6h {
    background: #FADEDF;
    color: #A13F48;
}

/* QUA HAN GIAO HOA */

.order-priority.priority-overdue {
    background: #A13F48;
    color: #FFFFFF;
}

/* ============================== */
/* LICH QUAN LY DON HANG */
/* ============================== */

#order-calendar {
    padding: 36px;
}

.calendar-heading {
    margin-bottom: 28px;
}

.calendar-heading h2 {
    color: var(--olive-dark);
    font-size: 26px;
    margin-bottom: 10px;
}

.calendar-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* THE THONG KE */

.calendar-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.calendar-stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
}

.calendar-stat-card p {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.calendar-stat-card strong {
    color: var(--olive-dark);
    font-size: 30px;
}

#calendar-busy-total {
    color: var(--berry);
}

/* KHUNG LICH */

.calendar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

#calendar-month-title {
    color: var(--olive-dark);
    font-size: 21px;
    text-align: center;
}

#calendar-prev-month,
#calendar-next-month {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--cream);
    color: var(--olive-dark);
    border-radius: 9px;
    cursor: pointer;
    flex-shrink: 0;
}

#calendar-go-today {
    display: block;
    margin: 0 auto 24px;
    padding: 10px 20px;
    background: var(--olive);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* LUOI LICH */

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 12px;
}

.calendar-weekdays span {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.calendar-day {
    min-width: 0;
    min-height: 100px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.calendar-day-number {
    font-size: 17px;
    font-weight: 600;
}

.calendar-day-count {
    font-size: 12px;
    font-weight: 500;
}

.calendar-day.normal {
    background: #E8EDDF;
    color: #4A5836;
}

.calendar-day.busy {
    background: #FFF3CD;
    color: #947019;
}

.calendar-day.overload {
    background: #FADEDF;
    color: #A13F48;
}

.calendar-day.today {
    font-weight: 700;
    box-shadow: inset 0 -3px 0 var(--olive);
}

.calendar-day.selected {
    outline: 2px solid var(--olive);
    outline-offset: -2px;
}

.calendar-day-empty {
    min-height: 100px;
}

/* CHU THICH MAU */

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

.calendar-legend span {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.legend-normal {
    background: #E8EDDF;
    color: #4A5836;
}

.legend-busy {
    background: #FFF3CD;
    color: #947019;
}

.legend-overload {
    background: #FADEDF;
    color: #A13F48;
}

/* DANH SACH DON TRONG NGAY */

.calendar-day-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.calendar-day-heading h3 {
    color: var(--olive-dark);
    font-size: 18px;
}

#calendar-selected-count {
    color: var(--olive);
    font-size: 18px;
}

#calendar-overload-warning {
    background: #FADEDF;
    color: #A13F48;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

#calendar-day-orders {
    color: var(--muted);
    line-height: 1.6;
}

.calendar-order-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.calendar-order-time {
    color: var(--olive-dark);
    font-weight: 700;
    min-width: 55px;
}

.calendar-order-info {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.calendar-order-info strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
}

.calendar-order-info p {
    font-size: 13px;
}

/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    #order-calendar {
        padding: 24px 16px;
    }

    .calendar-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .calendar-stat-card {
        padding: 18px;
    }

    .calendar-stat-card strong {
        font-size: 25px;
    }

    .calendar-card {
        padding: 16px;
    }

    .calendar-weekdays,
    .calendar-days {
        gap: 4px;
    }

    .calendar-day,
    .calendar-day-empty {
        min-height: 62px;
    }

    .calendar-day {
        padding: 6px 2px;
        gap: 5px;
        border-radius: 6px;
    }

    .calendar-day-number {
        font-size: 14px;
    }

    .calendar-day-count {
        font-size: 10px;
    }

    #calendar-month-title {
        font-size: 17px;
    }

    .calendar-legend {
        gap: 8px;
    }

    .calendar-legend span {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* NUT XEM CHI TIET DON TREN LICH */

.calendar-view-order-btn {
    display: inline-block;
    width: auto;
    margin-top: 12px;
    padding: 9px 16px;
    background: transparent;
    color: var(--olive);
    border: 1px solid var(--olive);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.calendar-view-order-btn:hover {
    background: var(--olive);
    color: #FFFFFF;
}


/* DINH DANG O CHON NGAY */

.shop-date-picker {
    position: relative;
    width: 100%;
    min-height: 50px;
}

.shop-date-display {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 50px;
    padding: 12px 42px 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--muted);
    font-size: 15px;
    pointer-events: none;
}

.shop-date-display.has-value {
    color: var(--text);
}

#orders .shop-date-picker input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.shop-date-picker::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    background-color: var(--olive);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
}

.shop-date-picker:focus-within .shop-date-display {
    border-color: var(--olive);
    outline: 2px solid var(--olive);
    outline-offset: 2px;
}

/* ========================================
   CANH BAO NGAY CAO DIEM
======================================== */

#busy-day-panel {
    padding: 28px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.busy-day-heading {
    margin-bottom: 24px;
}

.busy-day-heading h2 {
    color: var(--olive-dark);
    font-size: 21px;
    margin-bottom: 10px;
}

.busy-day-heading p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

#busy-day-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.busy-day-empty {
    padding: 24px 18px;
    background: var(--cream);
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}


/* THE CANH BAO */

.busy-day-card {
    padding: 22px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid transparent;
}

.busy-day-card.pending {
    background: #FADEDF;
    color: #A13F48;
    border-color: #EDC3C6;
}

.busy-day-card.prepared {
    background: #E0E9D5;
    color: #4A5836;
    border-color: #CCD9BD;
}

.busy-day-card.needs-review {
    background: #FFF3CD;
    color: #947019;
    border-color: #EBD99E;
}


/* NGAY GIAO VA SO DON */

.busy-day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.busy-day-date {
    font-size: 18px;
    font-weight: 600;
}

.busy-day-count {
    font-size: 24px;
    font-weight: 700;
}

.busy-day-status {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.busy-day-description {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

.busy-day-confirmed-time {
    font-size: 13px;
    line-height: 1.6;
}


/* CAC NUT THAO TAC */

.busy-day-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.busy-day-actions button {
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
}

.busy-day-confirm-btn {
    background: var(--olive);
    color: #FFFFFF;
    border: 1px solid var(--olive);
}

.busy-day-confirm-btn:hover {
    background: var(--olive-dark);
}

.busy-day-undo-btn,
.busy-day-view-btn {
    background: transparent;
    color: var(--olive-dark);
    border: 1px solid var(--olive);
}

.busy-day-undo-btn:hover,
.busy-day-view-btn:hover {
    background: rgba(101, 115, 76, 0.1);
}

.busy-day-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    #busy-day-panel {
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .busy-day-heading h2 {
        font-size: 19px;
    }

    .busy-day-card {
        padding: 18px;
        gap: 14px;
    }

    .busy-day-date {
        font-size: 16px;
    }

    .busy-day-count {
        font-size: 21px;
    }

    .busy-day-actions {
        flex-direction: column;
    }

    .busy-day-actions button {
        width: 100%;
    }

}


/* TOI UU GIAO DIEN LICH DON HANG */

#order-calendar .calendar-day {
    position: relative;
    height: 100px;
    min-height: 100px;
    padding: 24px 2px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 6px;
}

#order-calendar .calendar-day-empty {
    height: 100px;
    min-height: 100px;
}

/* NGAY THANG */

#order-calendar .calendar-day-number {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: var(--text);
}

/* SO LUONG BO HOA */

#order-calendar .calendar-day-count {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* SO LUONG KHACH HANG */

#order-calendar .calendar-day-customers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--muted);
    white-space: nowrap;
}

#order-calendar .calendar-day-customers svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    #order-calendar .calendar-day {
        height: 84px;
        min-height: 84px;
        padding: 22px 1px 5px;
        gap: 4px;
    }

    #order-calendar .calendar-day-empty {
        height: 84px;
        min-height: 84px;
    }

    #order-calendar .calendar-day-number {
        top: 6px;
        left: 6px;
        font-size: 12px;
    }

    #order-calendar .calendar-day-count {
        font-size: 13px;
    }

    #order-calendar .calendar-day-customers {
        font-size: 10px;
    }

    #order-calendar .calendar-day-customers svg {
        width: 11px;
        height: 11px;
    }

}

/* THONG KE CHI TIET NGAY GIAO HOA */

#order-calendar .calendar-day-heading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

#calendar-selected-count {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.calendar-detail-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 8px;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.calendar-detail-stat strong {
    font-size: 28px;
    font-weight: 700;
    color: var(--olive-dark);
    line-height: 1.2;
}

.calendar-detail-stat span {
    font-size: 13px;
    font-weight: 400;
    color: var(--muted);
    white-space: nowrap;
}

#calendar-overload-warning {
    margin-top: 18px;
    line-height: 1.6;
}

/* TOI UU TREN DIEN THOAI */

@media (max-width: 768px) {

    #calendar-selected-count {
        gap: 8px;
    }

    .calendar-detail-stat {
        padding: 16px 4px;
        gap: 6px;
    }

    .calendar-detail-stat strong {
        font-size: 24px;
    }

    .calendar-detail-stat span {
        font-size: 11px;
    }

}


/* THONG KE SO KHACH VA SO DON NGAY CAO DIEM */

.busy-day-substats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    line-height: 1.5;
}

.busy-day-dot {
    opacity: 0.5;
    font-size: 10px;
}


/* CO DINH THANH TIEU DE TREN DIEN THOAI */

@media (max-width: 768px) {

    .topbar {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--white);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    }

}


/* =========================================
   BOBERRY - BANG QUAN LY DON HANG
   ========================================= */

/* KHUNG CUON BANG */

.order-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: auto;
    max-height: 70vh;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
}

/* CAU TRUC BANG */

.order-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--text);
}

/* TIEU DE CAC COT */

.order-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--olive);
    color: #ffffff;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

/* CAC DONG DON HANG */

.order-table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--white);
}

.order-table tbody tr:nth-child(even) td {
    background: #F5F1E8;
}

.order-table tbody tr:hover td {
    background: #E9EDDF;
}

/* COT SO THU TU */

.order-table .table-stt {
    width: 45px;
    min-width: 45px;
    text-align: center;
}

/* COT KHACH HANG CO DINH */

.order-table .table-customer {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 190px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}

.order-table thead .table-customer {
    z-index: 6;
    background: var(--olive);
}

/* TEN KHACH HANG VA NUT VIEW */

.table-customer-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.table-customer-phone {
    margin-top: 5px;
    font-size: 12px;
    color: var(--muted);
}

/* COT SO LUONG */

.order-table .table-quantity {
    min-width: 45px;
    text-align: center;
    font-weight: 600;
}

/* COT LICH GIAO */

.table-delivery {
    min-width: 110px;
    white-space: nowrap;
}

/* COT TRANG THAI */

.table-status {
    min-width: 150px;
}

/* CAC COT TIEN */

.table-money {
    min-width: 100px;
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
}

.table-unpaid {
    color: var(--berry);
}

.table-paid-full {
    color: var(--olive-dark);
}

/* NHOM NUT THAO TAC */

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* NUT THAO TAC NHO GON */

#orders .order-table button {
    width: auto;
    min-height: 30px;
    margin: 0;
    padding: 6px 9px;
    border: 1px solid var(--olive);
    border-radius: 5px;
    background: transparent;
    color: var(--olive-dark);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

#orders .order-table button:hover {
    background: var(--olive);
    color: #ffffff;
}

/* NUT HUY DON HANG */

#orders .order-table .table-cancel-btn {
    border-color: var(--berry);
    color: var(--berry);
}

#orders .order-table .table-cancel-btn:hover {
    background: var(--berry);
    color: #ffffff;
}

/* NUT KHONG DUOC PHEP THAO TAC */

#orders .order-table button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* CANH BAO THOI HAN GIAO HOA */

.order-table .order-priority {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 5px;
    gap: 3px;
}

.order-table .order-priority strong {
    font-size: 11px;
}

.order-table .order-priority span {
    display: none;
}

/* TOI UU KHUNG HIEN THI */

.admin-content,
#orders,
#order-list {
    min-width: 0;
}

#order-list {
    max-width: 100%;
}

/* GIAO DIEN DIEN THOAI */

@media (max-width: 768px) {

    .order-table-wrapper {
        max-height: 65vh;
        -webkit-overflow-scrolling: touch;
    }

    .order-table {
        font-size: 12px;
    }

    .order-table thead th,
    .order-table tbody td {
        padding: 10px 8px;
    }

    .order-table .table-customer {
        min-width: 150px;
    }

}


/* BO LOC TRANG THAI TREN TIEU DE BANG */

.table-status-heading {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
}

#orders #table-status-filter {
    width: 100%;
    min-width: 140px;
    min-height: 30px;
    height: 30px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--white);
    color: var(--olive-dark);
    font-size: 12px;
    cursor: pointer;
}

/* BANG KHONG CO DON HANG */

.order-table .table-empty {
    padding: 30px 15px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
}

/* =========================================
   MAU SAC 6 TRANG THAI DON HANG
   ========================================= */

/* CHUA LAM */

.order-table .order-status.pending {
    background: #F0E9D7;
    color: #947019;
}

/* DANG LAM */

.order-table .order-status.preparing {
    background: #DCE8F8;
    color: #285EA8;
}

/* CHO GIAO */

.order-table .order-status.ready {
    background: #FFF3CD;
    color: #947019;
}

/* DANG GIAO */

.order-table .order-status.delivering {
    background: #FFE5CC;
    color: #B5651D;
}

/* HOAN THANH */

.order-table .order-status.completed {
    background: #E0E9D5;
    color: #4A5836;
}

/* DA HUY */

.order-table .order-status.cancelled {
    background: #FADEDF;
    color: #A13F48;
}

/* DINH DANG NHAN TRANG THAI */

.order-table .order-status {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}


/* BOBERRY - CHUONG THONG BAO */

.notification-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    background: transparent;
    color: var(--olive-dark);
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.notification-toggle:hover {
    background: var(--cream);
}

.notification-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--berry);
    color: white;
    border: 2px solid var(--white);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .notification-toggle {
        width: 40px;
        height: 40px;
    }
}


/* BOBERRY - TRUNG TAM THONG BAO */

.notification-panel {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 420px;
    max-height: calc(100dvh - 100px);
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    z-index: 500;
    overflow: hidden;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.notification-header h2 {
    font-size: 20px;
    color: var(--olive-dark);
}

#notification-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: var(--cream);
    color: var(--olive);
    cursor: pointer;
}

.notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    font-size: 13px;
    color: var(--muted);
}

#notification-read-all {
    background: transparent;
    color: var(--olive-dark);
    border: none;
    padding: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

#notification-list {
    min-height: 0;
    overflow-y: auto;
    padding: 0 16px 16px;
}

.notification-empty {
    padding: 40px 15px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 768px) {

    .notification-panel {
        top: 80px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100dvh - 100px);
    }

}


/* BOBERRY - NOI DUNG THONG BAO */

.notification-item {
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
    cursor: pointer;
}

.notification-item.unread {
    background: #F5F1E8;
    border-left: 4px solid var(--olive);
}

.notification-item.unread.reminder-24 {
    background: #FFF3CD;
    border-left-color: #947019;
}

.notification-item.unread.reminder-12 {
    background: #FFE5CC;
    border-left-color: #B5651D;
}

.notification-item.unread.reminder-6,
.notification-item.unread.busy-day {
    background: #FADEDF;
    border-left-color: #A13F48;
}

.notification-item-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.notification-item-message {
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    color: var(--text);
}

.notification-item-time {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
}

.notification-unread-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--berry);
}

/* TRANG THAI DA DOC */

.notification-item {
    transition: background-color .2s,
                border-color .2s;
}

.notification-item:hover {
    border-color: var(--olive);
}

#notification-read-all:disabled {
    opacity: .5;
    cursor: not-allowed;
}