* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip !important;
}

/* Tablet */
@media screen and (max-width: 1024px) {

    .admin-wrapper,
    .super-admin-wrapper {
        display: block !important;
    }

    .sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 15px !important;
    }

    .sidebar-header {
        text-align: center;
        margin-bottom: 10px;
    }

    .sidebar-nav ul {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .sidebar-nav li {
        list-style: none !important;
        width: auto !important;
        margin: 0 !important;
    }

    .sidebar-nav a,
    .nav-link {
        display: inline-block !important;
        padding: 10px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
        white-space: nowrap !important;
    }

    .sidebar-footer {
        margin-top: 15px !important;
        text-align: center !important;
    }

    .logout-btn {
        display: inline-block !important;
        width: auto !important;
        padding: 10px 20px !important;
    }

    .admin-content,
    .super-admin-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }

    .admin-header,
    .super-admin-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        padding: 15px !important;
    }

    .header-right {
        width: 100% !important;
        justify-content: space-between !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    .stats-grid,
    .analytics-cards-grid,
    .dashboard-main-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }

    .report-container,
    .table-container-card,
    .donut-container-card,
    .dashboard-card-mini,
    .stat-card {
        width: 100% !important;
        overflow-x: auto !important;
    }

    table,
    .management-table,
    .inventory-table {
        min-width: 700px !important;
    }

    form,
    .filter-row {
        flex-wrap: wrap !important;
    }

    form>div,
    .form-group {
        min-width: 220px;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100% !important;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px !important;
    }

    .sidebar {
        border-radius: 0 !important;
    }

    .sidebar-header h1 {
        font-size: 20px !important;
    }

    .sidebar-header p {
        font-size: 12px !important;
    }

    .sidebar-nav ul {
        justify-content: flex-start !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        padding-bottom: 8px !important;
    }

    .sidebar-nav a,
    .nav-link {
        font-size: 12px !important;
        padding: 9px 10px !important;
    }

    .admin-content,
    .super-admin-content {
        padding: 10px !important;
    }

    .admin-header h1,
    .super-admin-header h1,
    .section-header h2 {
        font-size: 20px !important;
        line-height: 1.25 !important;
    }

    .admin-header p,
    .super-admin-header p,
    .section-header p {
        font-size: 13px !important;
    }

    .stats-grid,
    .analytics-cards-grid,
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-card-mini,
    .stat-card,
    .report-container,
    .table-container-card,
    .donut-container-card {
        padding: 15px !important;
        border-radius: 10px !important;
    }

    .filter-row,
    form[method="GET"],
    form[method="POST"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    form>div,
    .form-group {
        width: 100% !important;
        min-width: 100% !important;
    }

    input,
    select,
    textarea,
    button,
    .btn-add,
    .btn-activate,
    .btn-deactivate,
    .btn-primary {
        width: 100% !important;
        font-size: 14px !important;
        padding: 11px !important;
    }

    .right-sidebar {
        width: 100% !important;
        right: -100% !important;
    }

    .right-sidebar.active {
        right: 0 !important;
    }

    table,
    .management-table,
    .inventory-table {
        min-width: 650px !important;
        font-size: 12px !important;
    }

    th,
    td {
        padding: 10px !important;
        white-space: nowrap !important;
    }

    .donut-wrapper,
    .mini-chart-box {
        max-width: 100% !important;
        height: 240px !important;
    }
}

/* Small phones */
@media screen and (max-width: 480px) {

    .admin-header,
    .super-admin-header {
        padding: 12px !important;
    }

    .admin-header h1,
    .super-admin-header h1,
    .section-header h2 {
        font-size: 18px !important;
    }

    .notification-trigger {
        font-size: 12px !important;
    }

    .report-container {
        padding: 12px !important;
    }

    table,
    .management-table,
    .inventory-table {
        min-width: 600px !important;
    }
}

/* LOGIN PAGE MOBILE FIX */
@media screen and (max-width: 768px) {
    body {
        padding: 0 !important;
        align-items: stretch !important;
    }

    .main-dashboard-box {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .top-nav {
        padding: 18px 20px !important;
        justify-content: center !important;
    }

    .brand {
        margin-left: 0 !important;
        font-size: 24px !important;
        text-align: center !important;
    }

    .split-container {
        display: block !important;
        width: 100% !important;
    }

    .form-side {
        width: 100% !important;
        max-width: 100% !important;
        padding: 35px 24px !important;
    }

    .welcome-text {
        font-size: 34px !important;
        letter-spacing: 3px !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .subtitle {
        font-size: 14px !important;
        margin-bottom: 35px !important;
    }

    .form-options {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
    }

    .button-group {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .submit-btn-yellow,
    .signup-btn-yellow {
        width: 100% !important;
        text-align: center !important;
    }
}

@media screen and (max-width: 420px) {
    .welcome-text {
        font-size: 30px !important;
        letter-spacing: 2px !important;
    }

    .form-side {
        padding: 28px 20px !important;
    }

    .brand {
        font-size: 22px !important;
    }
}

/* LOGIN REMEMBER FORGOT CLEANUP */
@media screen and (max-width: 768px) {
    .form-options {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .checkbox-container {
        width: auto !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .checkbox-container span {
        white-space: nowrap !important;
    }

    .forgot-pass {
        width: auto !important;
        white-space: nowrap !important;
    }
}

@media screen and (max-width: 380px) {
    .form-options {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

/* PASSWORD SHOW BUTTON */
@media screen and (max-width: 768px) {
    .password-container {
        position: relative !important;
        width: 100% !important;
        display: block !important;
    }

    .password-container input {
        width: 100% !important;
        padding-right: 75px !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .toggle-btn {
        width: 60px !important;
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        bottom: auto !important;
        z-index: 2 !important;

        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        font-size: 13px !important;
        color: #fd071b !important;
        text-align: right !important;
    }
}

/* ============================================================
   SHARED LOGOUT CONFIRMATION MODAL
   Used by admin.php, super-admin.php, cashier_pos.php and
   customers_dashboard.php — replaces the old browser confirm()
   alert boxes with a branded pop-out dialog.
   ============================================================ */
.logout-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 10, 0.82);
    backdrop-filter: blur(3px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.logout-modal-overlay.open {
    display: flex;
    animation: logoutModalFadeIn 0.18s ease-out;
}

@keyframes logoutModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logout-modal-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    padding: 36px 30px 28px;
    text-align: center;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.logout-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: #f2f2f2;
    color: #888;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.logout-modal-close:hover {
    background: #e5e5e5;
    color: #333;
}

.logout-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #fdeced;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-modal-icon svg {
    width: 28px;
    height: 28px;
}

.logout-modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fd071b;
    margin-bottom: 8px;
}

.logout-modal-title {
    margin: 0 0 8px;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 21px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #1a1a1a;
}

.logout-modal-subtitle {
    margin: 0 0 24px;
    font-size: 13px;
    color: #777777;
    line-height: 1.5;
}

.logout-modal-actions {
    display: flex;
    gap: 10px;
}

.logout-modal-btn {
    flex: 1;
    height: 46px;
    border: none;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.logout-modal-btn:hover {
    filter: brightness(1.08);
}

.logout-modal-btn:active {
    transform: scale(0.97);
}

.logout-modal-btn--ghost {
    background: transparent;
    color: #555555;
    border: 2px solid #dddddd;
}

.logout-modal-btn--ghost:hover {
    border-color: #fd071b;
    color: #fd071b;
}

.logout-modal-btn--primary {
    background: #fd071b;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(253, 7, 27, 0.35);
}

@media screen and (max-width: 480px) {
    .logout-modal-box {
        padding: 30px 22px 24px;
    }

    .logout-modal-actions {
        flex-direction: column;
    }
}