/**
 * Offerings Management System (OMS)
 * Custom Styles
 *
 * Theme Colors:
 * - Primary: #395498 (Blue)
 * - Secondary: #FBC908 (Gold/Yellow)
 * - White: #FFFFFF
 * - Dark (sidebar): #1a1a2e
 */

/* ============================================
   CSS Variables (Theme Colors)
   ============================================ */
:root {
    /* Primary Colors */
    --primary: #395498;
    --primary-hover: #284796;
    --primary-light: rgba(167, 24, 28, 0.1);
    --primary-rgb: 167, 24, 28;

    /* Secondary Colors */
    --secondary: #FBC908;
    --secondary-hover: #e0b507;
    --secondary-light: rgba(251, 201, 8, 0.1);

    /* Dark Theme (Sidebar) */
    --dark: #1a1a2e;
    --dark-secondary: #16213e;
    --dark-text: #e2e2e2;
    --dark-muted: #8a8a9a;

    /* Standard Colors */
    --white: #FFFFFF;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    /* Spacing */
    --sidebar-width: 260px;
    --mobile-nav-height: 70px;
    --mobile-header-height: 56px;

    /* Typography */
    --font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: var(--light);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   App Layout
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: 0;
    padding-bottom: var(--mobile-nav-height);
}

@media (min-width: 992px) {
    .main-content {
        margin-left: var(--sidebar-width);
        padding-bottom: 0;
    }
}

.page-content {
    flex: 1;
    padding: 1rem;
}

@media (min-width: 768px) {
    .page-content {
        padding: 1.5rem 2rem;
    }
}

/* ============================================
   Sidebar (Desktop)
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-secondary) 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--white);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--dark-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: var(--white);
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--dark-muted);
    font-size: 0.75rem;
    text-transform: capitalize;
}

.btn-logout {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius);
    color: var(--dark-muted);
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--danger);
    color: var(--white);
}

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    position: sticky;
    top: 0;
    height: var(--mobile-header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
}

.hamburger-btn:hover {
    background-color: var(--gray-light);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
}

.mobile-brand i,
.mobile-brand .mobile-brand-icon {
    font-size: 1.25rem;
}

.mobile-brand .mobile-brand-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-user-btn {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.user-initial {
    color: var(--white);
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background: var(--white);
    border-top: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.625rem;
    font-weight: 500;
    transition: color 0.2s ease;
    flex: 1;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-add {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 50%;
    color: var(--white) !important;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.4);
    flex: none;
}

.mobile-nav-add i {
    font-size: 1.5rem;
}

/* ============================================
   Mobile Offcanvas Menu
   ============================================ */
.offcanvas-header-dark {
    background: linear-gradient(180deg, var(--dark) 0%, var(--dark-secondary) 100%);
    padding: 1rem 1.25rem;
}

.offcanvas-body-nav {
    display: flex;
    flex-direction: column;
}

.offcanvas-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.offcanvas-nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.offcanvas-nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.offcanvas-nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.offcanvas-nav-link.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.offcanvas-nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.offcanvas-nav-divider {
    height: 1px;
    background-color: var(--gray-light);
    margin: 0.5rem 1.25rem;
}

.offcanvas-user-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-light);
    background-color: var(--light);
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 576px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-light);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    opacity: 0.8;
}

/* Stat icon color variants */
.stat-card .stat-icon.bg-primary-subtle {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
}

.stat-card .stat-icon.bg-success-subtle {
    background: rgba(40, 167, 69, 0.15) !important;
    color: var(--success) !important;
}

.stat-card .stat-icon.bg-warning-subtle {
    background: rgba(255, 193, 7, 0.2) !important;
    color: #b58a00 !important;
}

.stat-card .stat-icon.bg-info-subtle {
    background: rgba(23, 162, 184, 0.15) !important;
    color: var(--info) !important;
}

.stat-card .stat-icon.bg-secondary-subtle {
    background: rgba(108, 117, 125, 0.15) !important;
    color: var(--gray) !important;
}

.stat-card .stat-icon.bg-danger-subtle {
    background: rgba(220, 53, 69, 0.15) !important;
    color: var(--danger) !important;
}

.stat-card .stat-sublabel {
    font-size: 0.75rem;
    margin-top: 0.125rem;
}

.stat-card.stat-card-primary .stat-value { color: var(--primary); font-size: 1.15rem; }
.stat-card.stat-card-success .stat-value { color: var(--success); font-size: 1.15rem; }
.stat-card.stat-card-info .stat-value { color: var(--info); font-size: 1.15rem; }
.stat-card.stat-card-warning .stat-value { color: var(--warning); font-size: 1.15rem; }
.stat-card.stat-card-danger .stat-value { color: var(--danger); font-size: 1.15rem; }

.stat-card .stat-value {
    font-size: 1.10rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   Settings Cards
   ============================================ */
.settings-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.settings-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.settings-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: 1.5rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: var(--dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: var(--secondary-hover);
    border-color: var(--secondary-hover);
    color: var(--dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ============================================
   Forms
   ============================================ */
.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-light);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--primary);
}

/* Form Check */
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============================================
   Tables
   ============================================ */
.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--light);
    border-bottom: 2px solid var(--gray-light);
    font-weight: 600;
    color: var(--dark);
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-light);
}

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

.table tbody tr:hover {
    background-color: var(--primary-light);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions .btn {
    padding: 0.375rem 0.5rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

/* ============================================
   Badges
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.375rem 0.625rem;
    border-radius: var(--radius-sm);
}

.badge-primary {
    background-color: var(--primary);
}

.badge-success {
    background-color: var(--success);
}

.badge-danger {
    background-color: var(--danger);
}

.badge-warning {
    background-color: var(--warning);
    color: var(--dark);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-secondary) 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.login-header {
    background: var(--primary);
    padding: 2rem;
    text-align: center;
}

.login-logo {
    width: 60px;
    height: 60px;
    background: var(--white);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.75rem;
    color: var(--primary);
}

.login-logo-img {
    max-width: 180px;
    height: auto;
    max-height: 48px;
    margin: 0 auto 1rem;
    display: block;
    object-fit: contain;
}

.login-title {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    padding: 0 2rem 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray);
}

/* ============================================
   Autocomplete
   ============================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-light);
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--primary-light);
}

.autocomplete-item-name {
    font-weight: 500;
    color: var(--dark);
}

.autocomplete-item-phone {
    font-size: 0.875rem;
    color: var(--gray);
}

.autocomplete-add-new {
    background-color: var(--light);
    color: var(--primary);
    font-weight: 500;
}

.autocomplete-add-new:hover {
    background-color: var(--primary);
    color: var(--white);
}

/* ============================================
   Loading & Spinners
   ============================================ */
.spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* ============================================
   Utilities
   ============================================ */
.text-primary {
    color: var(--primary) !important;
}

.text-secondary {
    color: var(--secondary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
}

.border-primary {
    border-color: var(--primary) !important;
}

.fw-500 {
    font-weight: 500 !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fs-sm {
    font-size: 0.875rem !important;
}

.fs-xs {
    font-size: 0.75rem !important;
}

/* ============================================
   Mobile Card List (replaces tables on small screens)
   ============================================ */

/* Hide table on mobile, show cards */
.table-desktop {
    display: block;
}
.mobile-card-list {
    display: none;
}

@media (max-width: 767.98px) {
    .table-desktop {
        display: none !important;
    }
    .mobile-card-list {
        display: block !important;
    }
}

.mobile-card-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-light);
    transition: background-color 0.15s ease;
}

.mobile-card-item:last-child {
    border-bottom: none;
}

.mobile-card-item:active {
    background-color: var(--primary-light);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.mobile-card-title {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.mobile-card-title a {
    color: var(--dark);
    text-decoration: none;
}

.mobile-card-title a:hover {
    color: var(--primary);
}

.mobile-card-amount {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    white-space: nowrap;
    margin-left: 0.75rem;
}

.mobile-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.mobile-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.mobile-card-meta-item i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-light);
}

.mobile-card-actions .btn {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
}

.mobile-card-label {
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 500;
}

.mobile-card-value {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--dark);
    text-align: right;
}

/* Collapsible details toggle */
.mobile-card-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--gray);
    font-size: 0.75rem;
    padding: 0.25rem 0;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    transition: color 0.2s ease;
}

.mobile-card-toggle:hover {
    color: var(--primary);
}

.mobile-card-toggle i {
    transition: transform 0.2s ease;
}

.mobile-card-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.mobile-card-details {
    padding-top: 0.25rem;
}

/* ============================================
   Mobile Filter Improvements
   ============================================ */
@media (max-width: 767.98px) {
    .filter-collapse-btn {
        display: flex !important;
    }
    .filter-body {
        display: none;
    }
    .filter-body.show {
        display: block;
    }
}

@media (min-width: 768px) {
    .filter-collapse-btn {
        display: none !important;
    }
    .filter-body {
        display: block !important;
    }
}

.filter-collapse-btn {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    background: none;
    border: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.filter-collapse-btn i {
    transition: transform 0.2s ease;
    color: var(--gray);
}

.filter-collapse-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .mobile-header,
    .mobile-nav,
    .offcanvas,
    .offcanvas-backdrop,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-bottom: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }
}

/* ============================================
   Chat Quick Add
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
    max-width: 800px;
    margin: 0 auto;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.chat-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray);
}

.chat-welcome-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.chat-welcome-icon-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.chat-welcome h5 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.chat-message {
    margin-bottom: 1rem;
}

.chat-message-bubble {
    display: inline-block;
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-message-user .chat-message-bubble {
    background: var(--primary);
    color: white;
    margin-left: auto;
    display: block;
}

.chat-message-ai .chat-message-bubble {
    background: white;
    border: 1px solid var(--gray-light);
    color: var(--dark);
}

.chat-confirmation {
    margin-bottom: 1rem;
}

.chat-input-area {
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-lg);
}

.chat-product-suggestions {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 0.25rem;
    max-height: 180px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.chat-product-suggestions .suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-light);
    transition: background 0.15s ease;
}

.chat-product-suggestions .suggestion-item:last-child {
    border-bottom: none;
}

.chat-product-suggestions .suggestion-item:hover,
.chat-product-suggestions .suggestion-item.suggestion-active {
    background: var(--primary-light);
    color: var(--primary);
}

.chat-input {
    flex: 1;
    border: none;
    resize: none;
    max-height: 120px;
}

.chat-input:focus {
    box-shadow: none;
    outline: none;
}

.chat-input-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid var(--gray-light);
    background: white;
    color: var(--gray);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--light);
    color: var(--primary);
}

.btn-mic.recording {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-send {
    width: 44px;
    height: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* POS Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.product-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    background: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.product-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.product-price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
}

.cart-item {
    font-size: 0.9rem;
}
