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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #f5f5f5;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.main-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
}

.navbar {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ecf0f1;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

/* Guest navbar */
.navbar-guest {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 1rem 2rem;
}

.navbar-guest .logo {
    font-size: 1.5rem;
}

.btn-login {
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    transition: all 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* Sidebar Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: #ecf0f1;
    text-decoration: none;
    display: block;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user .user-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ecf0f1;
    margin-bottom: 0.25rem;
}

.sidebar-user .user-points {
    display: block;
    font-size: 0.85rem;
    color: #3498db;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 0.875rem 1.25rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #3498db;
    border-left-color: #3498db;
}

.nav-item.active {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left-color: #3498db;
}

.nav-item span {
    display: block;
    font-size: 0.95rem;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.1);
    margin: 0.5rem 1.25rem;
}

.nav-group {
    margin: 0.5rem 0;
}

.nav-group-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0.25rem;
}

.nav-item-sub {
    padding-left: 2rem !important;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.nav-item-sub:hover {
    background-color: rgba(255,255,255,0.05);
    color: #3498db;
    border-left-color: #3498db;
}

.nav-item-logout {
    margin-top: auto;
    color: #e74c3c !important;
    border-left-color: transparent;
}

.nav-item-logout:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b !important;
    border-left-color: #e74c3c;
}

.nav-item-cart {
    position: relative;
}

.nav-cart-badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: #e74c3c;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: badgePulse 0.3s ease-in-out;
}

@keyframes badgePulse {
    0% {
        transform: translateY(-50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 2rem 0;
}

.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.welcome-section {
    background-color: #ffffff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.welcome-section h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.welcome-section p {
    margin-bottom: 1rem;
    color: #7f8c8d;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-form {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h1 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2c3e50;
    cursor: pointer;
}

.error-message {
    margin-top: 0.5rem;
    color: #e74c3c;
    font-size: 0.875rem;
}

.error-message span {
    display: block;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-block {
    width: 100%;
    display: block;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: #7f8c8d;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

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

.profile-section {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.profile-section h1 {
    color: #2c3e50;
    margin-bottom: 2rem;
}

.profile-info {
    margin-bottom: 2rem;
}

.info-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.info-item strong {
    color: #2c3e50;
    margin-right: 0.5rem;
}

.info-item.b24-user {
    border-left-color: #ff6900;
    background-color: #fff4ed;
}

.divider {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #bdc3c7;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background-color: #ffffff;
    padding: 0 1rem;
    color: #7f8c8d;
    position: relative;
    z-index: 1;
}

.divider-text {
    text-align: center;
    color: #7f8c8d;
    margin: 1.5rem 0;
}

.btn-b24 {
    background-color: #ff6900;
    color: #ffffff;
    border: none;
}

.btn-b24:hover {
    background-color: #e55a00;
}

.b24-login-section {
    margin-top: 2rem;
    text-align: center;
}

.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem 0;
    text-align: center;
}

.app-layout + .footer {
    margin-left: 260px;
}

.footer p {
    margin: 0;
}

/* Homepage categories grid */
.categories-section {
    width: 100%;
}
.categories-section .row {
    margin-left: 0;
    margin-right: 0;
}
.category-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    background-color: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
}
.category-card .card-img-top {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.category-card .card-body {
    padding-top: 0.75rem;
    padding-bottom: 0.9rem;
}
.category-card .card-title {
    font-size: 0.98rem;
}
.category-card .text-muted {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
    
    .welcome-section {
        padding: 2rem 1.5rem;
    }
    
    .sidebar {
        width: 220px;
    }
    
    .main-content {
        margin-left: 220px;
        padding: 1.5rem;
    }
    
    .app-layout + .footer {
        margin-left: 220px;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
        padding: 1rem;
    }
    
    .app-layout + .footer {
        margin-left: 200px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-header .logo {
        font-size: 1.1rem;
    }
    
    .nav-item {
        padding: 0.75rem 1rem;
    }
    
    .nav-item span {
        font-size: 0.875rem;
    }
}

/* Benefits page */
.benefits-page .card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    overflow: hidden;
    background-color: #fff;
}
.benefits-page .card .card-img-top {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}
.benefits-page .types-list {
    margin: 0;
}
.benefits-page .benefit-type-item {
    padding: 6px 8px;
    border-radius: 8px;
    background: #f9fafb;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.benefits-page .benefit-type-item:hover {
    background: #f3f6f8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) inset;
}
.benefits-page .benefit-type-item .type-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e6eaee;
}
.benefits-page .price-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.2;
    color: #0f5132;
    background: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: 999px;
}
.benefits-page .input-group-text {
    background: #f8f9fa;
}
.benefits-page .card .form-control,
.benefits-page .card .form-control-sm {
    border-color: #e1e6eb;
}
.benefits-page .card .form-control:focus,
.benefits-page .card .form-control-sm:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
.benefits-page .btn-outline-danger.btn-sm {
    padding: 2px 8px;
}

.benefits-page .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefits-page .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.benefits-page .card-body {
    display: flex;
    flex-direction: column;
}

.benefits-page .card-body .d-flex {
    margin-top: auto;
}

/* Admin User Profile Styles */
.admin-user-profile {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-user-profile .card {
    border-radius: 12px;
    overflow: hidden;
}

.admin-user-profile .card-header {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.user-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    font-weight: 600;
}

.info-value {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
}

.badge-admin {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge-moderator {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge-employee {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2c3e50;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.3;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-card-primary {
    color: #3498db;
}

.stat-card-success {
    color: #27ae60;
}

.stat-card-warning {
    color: #f39c12;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.8;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 70px;
}

.stat-mini-success {
    background: #d1e7dd;
}

.stat-mini-warning {
    background: #fff3cd;
}

.stat-mini-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #2c3e50;
}

.stat-mini-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-user-profile .table {
    margin-bottom: 0;
}

.admin-user-profile .table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem;
}

.admin-user-profile .table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.admin-user-profile .table tbody tr:hover {
    background-color: #f8f9fa;
}

.benefit-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.points-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.admin-user-profile .badge {
    font-weight: 500;
    padding: 0.4rem 0.8rem;
}

/* Admin Stats Page Styles */
.admin-stats-page {
    max-width: 1400px;
    margin: 0 auto;
}

.stat-card-danger {
    color: #e74c3c;
}

.stat-card-info {
    color: #3498db;
}

.stat-mini-large {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-mini-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-mini-large-success {
    background: #d1e7dd;
    border-color: #badbcc;
}

.stat-mini-large-warning {
    background: #fff3cd;
    border-color: #ffecb5;
}

.stat-mini-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.stat-mini-content {
    flex: 1;
}

.stat-mini-large .stat-mini-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-mini-large .stat-mini-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-mini-secondary {
    background: #e9ecef;
}

/* Fix for modal flickering */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Prevent modal from flickering */
.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.fade:not(.show) {
    opacity: 0;
}

.modal.show {
    display: block;
    opacity: 1;
}

/* Ensure only one modal backdrop */
body.modal-open {
    overflow: hidden;
}

body.modal-open .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100vw;
    height: 100vh;
    background-color: #000;
}

/* Admin History Page Styles */
.admin-history-page {
    max-width: 1400px;
    margin: 0 auto;
}

.admin-history-page .table {
    margin-bottom: 0;
}

.admin-history-page .table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 1rem;
    white-space: nowrap;
}

.admin-history-page .table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.admin-history-page .table tbody tr:hover {
    background-color: #f8f9fa;
}

.admin-history-page .pagination {
    margin-bottom: 0;
}

.admin-history-page .btn-group .btn {
    border-radius: 0;
}

.admin-history-page .btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.admin-history-page .btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

