@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* Donut pixel art styles removed as per redesign */


:root {
    /* Dunkin' Donuts Official Brand Palette */
    --dunkin-orange: #FF671F;
    --dunkin-orange-hover: #e5530b;
    --dunkin-orange-glow: rgba(255, 103, 31, 0.35);
    
    --dunkin-pink: #DA1884;
    --dunkin-pink-hover: #b80d6d;
    --dunkin-pink-glow: rgba(218, 24, 132, 0.35);

    /* Coffee & Cream Palette */
    --coffee-dark: #140b09;
    --coffee-card: #201310;
    --coffee-card-hover: #2a1916;
    --coffee-input: #0f0706;
    --coffee-border: rgba(255, 103, 31, 0.2);
    
    --cream-white: #FFF9F5;
    --cream-sub: #DBC8BC;
    --cream-muted: #9E897D;
    
    --stock-in: #FF671F;
    --stock-in-bg: rgba(255, 103, 31, 0.15);
    --stock-out: #DA1884;
    --stock-out-bg: rgba(218, 24, 132, 0.15);
    
    --success: #10b981;
    --danger: #ef4444;
}

/* Reset & Fonts */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Universal Link Fixes */
a, a:visited, a:hover, a:active, a:focus {
    text-decoration: none;
    color: inherit;
    outline: none;
}

ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

body {
    min-height: 100vh;
    background: var(--coffee-dark);
    background-image: radial-gradient(circle at 50% -10%, #3d1c16 0%, #1c0e0b 60%, #110706 100%);
    background-attachment: fixed;
    color: var(--cream-white);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Dunkin' Top Navigation Bar */
.main-navbar {
    width: 100%;
    background: rgba(20, 11, 9, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--dunkin-orange);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--cream-white) !important;
    letter-spacing: -0.01em;
}

.nav-brand i {
    color: var(--dunkin-orange);
    font-size: 1.4rem;
}

.nav-brand span.brand-dunkin {
    color: var(--dunkin-orange);
}

.nav-brand span.brand-sub {
    color: var(--dunkin-pink);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item-link {
    color: var(--cream-sub) !important;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 12px;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-item-link:hover {
    color: var(--cream-white) !important;
    background: rgba(255, 103, 31, 0.12);
}

.nav-item-link.active {
    color: #ffffff !important;
    background: var(--dunkin-orange);
    box-shadow: 0 4px 14px var(--dunkin-orange-glow);
}

.nav-item-link.nav-stock-in.active {
    background: var(--dunkin-orange);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--dunkin-orange-glow);
}

.nav-item-link.nav-stock-out.active {
    background: var(--dunkin-pink);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--dunkin-pink-glow);
}

.nav-logout-btn {
    color: #fca5a5 !important;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.nav-logout-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff !important;
}

/* Main Container Wrapper */
.page-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Dunkin Auth Card */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto auto;
    padding: 2.5rem 1rem;
}

.auth-card {
    background: var(--coffee-card);
    border: 1px solid var(--coffee-border);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7),
                0 0 30px rgba(255, 103, 31, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--cream-white);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.auth-header p {
    font-size: 0.92rem;
    color: var(--cream-sub);
}

/* Dunkin Role Selector */
.role-selector {
    display: flex;
    background: var(--coffee-input);
    padding: 5px;
    border-radius: 16px;
    border: 1px solid var(--coffee-border);
    margin-bottom: 1.5rem;
}

.role-option {
    flex: 1;
    text-align: center;
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
}

.role-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--cream-sub);
    cursor: pointer;
    transition: all 0.25s ease;
}

.role-option input[type="radio"]:checked + .role-label.cashier {
    background: var(--dunkin-orange);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--dunkin-orange-glow);
}

.role-option input[type="radio"]:checked + .role-label.supervisor {
    background: var(--dunkin-pink);
    color: #ffffff !important;
    box-shadow: 0 4px 14px var(--dunkin-pink-glow);
}

/* Inputs & Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cream-sub);
    margin-bottom: 0.45rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--dunkin-orange);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 0.88rem 1rem 0.88rem 2.85rem;
    background: var(--coffee-input);
    border: 1px solid var(--coffee-border);
    border-radius: 14px;
    font-size: 0.95rem;
    color: var(--cream-white);
    outline: none;
    transition: all 0.25s ease;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23FF671F' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 14px) center;
    padding-right: 2.5rem;
}

select.form-control option {
    background: #140b09;
    color: #FFF9F5;
}

.form-control:focus {
    border-color: var(--dunkin-orange);
    box-shadow: 0 0 0 3px rgba(255, 103, 31, 0.25);
    background: #180e0c;
}

.btn-primary {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, var(--dunkin-orange) 0%, var(--dunkin-orange-hover) 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--dunkin-orange-glow);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 25px var(--dunkin-orange-glow);
}

.btn-stock-in {
    background: linear-gradient(135deg, var(--dunkin-orange) 0%, #d44903 100%);
    box-shadow: 0 10px 20px var(--dunkin-orange-glow);
}

.btn-stock-in:hover {
    background: linear-gradient(135deg, #e5530b 0%, #b83d00 100%);
}

.btn-stock-out {
    background: linear-gradient(135deg, var(--dunkin-pink) 0%, #a80b62 100%);
    box-shadow: 0 10px 20px var(--dunkin-pink-glow);
}

.btn-stock-out:hover {
    background: linear-gradient(135deg, #c71477 0%, #8c054e 100%);
}

/* Dunkin Alert Banners */
.alert {
    padding: 0.95rem 1.15rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success {
    background: rgba(255, 103, 31, 0.15);
    border: 1px solid rgba(255, 103, 31, 0.35);
    color: #ffd2ba;
}

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--coffee-border);
    font-size: 0.92rem;
    color: var(--cream-sub);
}

.auth-footer a {
    color: var(--dunkin-orange) !important;
    font-weight: 800;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--coffee-card);
    border: 1px solid var(--coffee-border);
    border-radius: 28px;
    padding: 2.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6),
                0 0 35px rgba(255, 103, 31, 0.05);
    margin-bottom: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--coffee-border);
    margin-bottom: 1.75rem;
}

.dashboard-header h2 {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--cream-white);
    letter-spacing: -0.02em;
}

/* Dunkin Badges */
.badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-cashier {
    background: var(--stock-in-bg);
    color: var(--dunkin-orange) !important;
    border: 1px solid rgba(255, 103, 31, 0.4);
}

.badge-supervisor {
    background: var(--stock-out-bg);
    color: var(--dunkin-pink) !important;
    border: 1px solid rgba(218, 24, 132, 0.4);
}

.badge-in {
    background: var(--stock-in-bg);
    color: var(--dunkin-orange) !important;
    border: 1px solid rgba(255, 103, 31, 0.4);
}

.badge-out {
    background: var(--stock-out-bg);
    color: var(--dunkin-pink) !important;
    border: 1px solid rgba(218, 24, 132, 0.4);
}

/* Cashier ID Banner Card */
.cashier-id-card {
    background: linear-gradient(135deg, rgba(255, 103, 31, 0.15) 0%, rgba(218, 24, 132, 0.15) 100%);
    border: 1px solid rgba(255, 103, 31, 0.35);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cashier-id-label {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--dunkin-orange);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.cashier-id-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Outfit', monospace;
    letter-spacing: 0.06em;
}

/* Feature Action Cards Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

.feature-card {
    background: rgba(15, 7, 6, 0.6);
    border: 1px solid var(--coffee-border);
    border-radius: 22px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    background: var(--coffee-card-hover);
}

.feature-card.stock-in-card {
    border-top: 4px solid var(--dunkin-orange);
}

.feature-card.stock-in-card:hover {
    border-color: var(--dunkin-orange);
    box-shadow: 0 15px 30px var(--dunkin-orange-glow);
}

.feature-card.stock-out-card {
    border-top: 4px solid var(--dunkin-pink);
}

.feature-card.stock-out-card:hover {
    border-color: var(--dunkin-pink);
    box-shadow: 0 15px 30px var(--dunkin-pink-glow);
}

.feature-card h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--cream-white) !important;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.92rem;
    color: var(--cream-sub) !important;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.feature-btn {
    padding: 0.8rem 1.25rem;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-top: auto;
}

.feature-btn-in {
    background: var(--dunkin-orange);
    color: #ffffff !important;
    box-shadow: 0 6px 16px var(--dunkin-orange-glow);
}

.feature-btn-in:hover {
    background: var(--dunkin-orange-hover);
    box-shadow: 0 8px 20px var(--dunkin-orange-glow);
}

.feature-btn-out {
    background: var(--dunkin-pink);
    color: #ffffff !important;
    box-shadow: 0 6px 16px var(--dunkin-pink-glow);
}

.feature-btn-out:hover {
    background: var(--dunkin-pink-hover);
    box-shadow: 0 8px 20px var(--dunkin-pink-glow);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.stat-box {
    background: rgba(15, 7, 6, 0.6);
    border: 1px solid var(--coffee-border);
    border-radius: 20px;
    padding: 1.35rem;
}

.stat-box h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cream-sub);
    margin-bottom: 0.5rem;
}

.stat-box .number {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--cream-white);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--coffee-border);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 7, 6, 0.6);
    font-size: 0.92rem;
}

.custom-table th {
    background: #180e0c;
    padding: 15px 18px;
    text-align: left;
    color: var(--cream-sub);
    font-weight: 800;
    border-bottom: 1px solid var(--coffee-border);
    white-space: nowrap;
}

.custom-table td {
    padding: 15px 18px;
    border-bottom: 1px solid rgba(255, 103, 31, 0.08);
    color: var(--cream-white);
    white-space: nowrap;
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.custom-table tr:hover td {
    background: rgba(255, 103, 31, 0.04);
}

/* Mobile Navigation Hamburger Toggle Button */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--coffee-border);
    transition: all 0.25s ease;
}

.mobile-nav-toggle:hover, .mobile-nav-toggle:focus {
    background: rgba(255, 103, 31, 0.15);
    border-color: var(--dunkin-orange);
}

.hamburger-bar {
    width: 22px;
    height: 2.5px;
    background-color: var(--cream-white);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2.5px 0;
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ==========================================
   Responsive Smartphone & Mobile Layouts
   ========================================== */

/* Tablet & Smaller Devices (<= 992px) */
@media screen and (max-width: 992px) {
    .page-wrapper {
        padding: 1.25rem 1rem;
    }

    .dashboard-card {
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    .cashier-id-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.85rem;
    }

    .supervisor-modal-panel {
        width: 100%;
        height: 95vh;
        border-radius: 12px;
    }
}

/* Mobile & Smartphone (<= 768px) */
@media screen and (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .nav-container {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    .nav-brand-img, .donut-brand-img {
        width: 32px !important;
        height: 32px !important;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        background: rgba(20, 11, 9, 0.98);
        border: 1px solid var(--coffee-border);
        border-radius: 16px;
        padding: 12px;
        margin-top: 10px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
        gap: 8px;
    }

    .nav-menu.nav-open {
        display: flex !important;
        animation: navSlideDown 0.25s ease-out forwards;
    }

    @keyframes navSlideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .nav-item-link {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 0.92rem;
        border-radius: 10px;
    }

    .nav-logout-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 4px;
        padding: 12px 16px;
        font-size: 0.92rem;
    }

    .dashboard-header h2 {
        font-size: 1.35rem;
    }

    .dashboard-header p {
        font-size: 0.88rem !important;
    }

    /* iOS Auto-zoom Prevention & Full Touch Target Sizing */
    .form-control, input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom on mobile focus */
        min-height: 44px;
    }

    /* Stack form elements vertically on mobile */
    form[action="scan_dbf.php"],
    form[method="GET"],
    form[method="POST"],
    .form-inline {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    form[action="scan_dbf.php"] > div,
    form[method="GET"] > div,
    form[method="POST"] > div,
    .form-inline > div {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    form[action="scan_dbf.php"] .form-control,
    form[method="GET"] .form-control,
    form[method="POST"] .form-control,
    select.form-control,
    input.form-control {
        width: 100% !important;
        max-width: 100% !important;
    }

    .btn-primary,
    .feature-btn,
    button[type="submit"] {
        width: 100% !important;
        min-height: 46px;
        font-size: 0.95rem;
    }

    /* Override inline flex/wrap wrappers for filters and actions */
    div[style*="display:flex"],
    div[style*="display: flex"] {
        max-width: 100%;
    }

    /* Ensure filter dropdowns and inputs fit phone screens without horizontal scroll */
    #history_outlet_filter,
    #history_date_filter,
    #inv_search_cashier,
    #inv_search_sup {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Table adjustments for mobile touch scrolling */
    .table-responsive {
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        width: 100%;
    }

    .custom-table th,
    .custom-table td {
        padding: 10px 10px;
        font-size: 0.82rem;
    }

    /* Auth card responsive fix */
    .auth-wrapper {
        padding: 1rem 0.5rem;
    }

    .auth-card {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }

    .role-label {
        padding: 9px 8px;
        font-size: 0.82rem;
    }

    .history-delete-btn,
    .btn-stock-in {
        min-height: 38px;
    }

    /* Modal Overlay Responsive */
    .supervisor-modal,
    .supervisor-modal-overlay {
        padding: 8px !important;
    }

    .supervisor-modal-panel {
        width: 100% !important;
        max-width: 100% !important;
        height: 96vh !important;
        border-radius: 16px !important;
        padding: 0.75rem !important;
    }
}

/* Small Smartphone (<= 480px) */
@media screen and (max-width: 480px) {
    .page-wrapper {
        padding: 0.75rem 0.4rem;
    }

    .dashboard-card {
        padding: 1rem 0.65rem;
        border-radius: 16px;
    }

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

    .stat-box {
        padding: 0.85rem 0.75rem;
    }

    .stat-box h4 {
        font-size: 0.78rem;
    }

    .stat-box .number {
        font-size: 1.35rem;
    }

    .cashier-id-value {
        font-size: 1.25rem;
        word-break: break-all;
    }

    .auth-header h1 {
        font-size: 1.4rem;
    }

    .badge {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .custom-table th,
    .custom-table td {
        padding: 8px 6px;
        font-size: 0.76rem;
    }

    /* Stack history table action buttons on narrow phones */
    .custom-table td div[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }

    .custom-table td .btn-stock-in,
    .custom-table td .history-delete-btn {
        width: 100% !important;
        text-align: center;
        justify-content: center;
    }
}


