/* ScanDukaan Modern Clean CSS */
:root {
    --brand-dark: #0f172a;
    --brand-slate: #1e293b;
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-success: #059669;
    --brand-warning: #d97706;
    --brand-danger: #dc2626;
    --brand-bg: #f8fafc;
    --nav-height-mobile: 65px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--brand-bg);
    color: #334155;
    -webkit-font-smoothing: antialiased;
}

.bg-dark-slate {
    background-color: var(--brand-slate) !important;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    color: #ffffff;
}

/* User Avatar */
.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Hover effects */
.hover-light:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.hover-bg:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height-mobile);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 0;
    min-height: 48px; /* Minimum 44px touch target rule */
    transition: color 0.15s ease-in-out;
}

.bottom-nav-item i {
    line-height: 1;
    margin-bottom: 2px;
}

.bottom-nav-item:hover, .bottom-nav-item:focus {
    color: var(--brand-primary);
}

.bottom-nav-item.active-nav {
    color: var(--brand-primary);
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .mb-mobile-nav {
        margin-bottom: calc(var(--nav-height-mobile) + 15px) !important;
    }
}

/* Touch friendly buttons */
.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.btn-lg {
    min-height: 48px;
}

/* Card Styling */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
    font-weight: 600;
}

/* Custom Badges */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Tables in mobile cards */
.table-responsive {
    border-radius: 8px;
}

/* ==========================================================================
   MOBILE ERGONOMICS & COMFORTABLE RESPONSIVE TYPOGRAPHY (Screens < 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
    /* Scale root rem by 15% so all fonts, paddings & margins scale gracefully */
    html {
        font-size: 13.5px !important;
    }

    body {
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
    }

    /* Headings tuned for smartphone displays */
    h1, .h1 { font-size: 1.35rem !important; }
    h2, .h2 { font-size: 1.2rem !important; }
    h3, .h3 { font-size: 1.08rem !important; }
    h4, .h4 { font-size: 0.98rem !important; }
    h5, .h5 { font-size: 0.9rem !important; }
    h6, .h6 { font-size: 0.82rem !important; }

    /* Scaled Display helpers */
    .fs-1 { font-size: 1.55rem !important; }
    .fs-2 { font-size: 1.3rem !important; }
    .fs-3 { font-size: 1.15rem !important; }
    .fs-4 { font-size: 1.0rem !important; }
    .fs-5 { font-size: 0.9rem !important; }
    .fs-6 { font-size: 0.8rem !important; }

    /* Comfortable Container padding - avoids cramped borders */
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-top: 8px !important;
    }

    /* Compact, modern cards on phone */
    .card {
        border-radius: 10px !important;
        margin-bottom: 0.65rem !important;
    }
    .card-body {
        padding: 0.75rem !important;
    }
    .card-header {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.88rem !important;
    }
    .card-footer {
        padding: 0.5rem 0.75rem !important;
    }

    /* Ergonomic Buttons - comfortable touch targets without excessive height */
    .btn {
        min-height: 36px !important;
        padding: 0.35rem 0.7rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    .btn-sm {
        min-height: 28px !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.75rem !important;
        border-radius: 6px !important;
    }
    .btn-lg {
        min-height: 42px !important;
        padding: 0.5rem 0.95rem !important;
        font-size: 0.95rem !important;
    }

    /* Compact Form Inputs & Selects */
    .form-control, .form-select {
        font-size: 0.88rem !important;
        padding: 0.35rem 0.6rem !important;
        min-height: 36px !important;
        border-radius: 7px !important;
    }
    .form-control-sm, .form-select-sm {
        font-size: 0.78rem !important;
        padding: 0.25rem 0.45rem !important;
        min-height: 30px !important;
    }
    .form-control-lg, .form-select-lg {
        font-size: 0.95rem !important;
        padding: 0.45rem 0.75rem !important;
        min-height: 40px !important;
    }
    .form-label {
        font-size: 0.78rem !important;
        margin-bottom: 0.2rem !important;
        font-weight: 600 !important;
    }
    .input-group-text {
        font-size: 0.85rem !important;
        padding: 0.35rem 0.6rem !important;
    }

    /* Compact Tables for phone screens */
    .table th {
        font-size: 0.76rem !important;
        padding: 0.4rem 0.45rem !important;
    }
    .table td {
        font-size: 0.82rem !important;
        padding: 0.4rem 0.45rem !important;
    }

    /* Badges */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.22em 0.5em !important;
    }

    /* Modals - comfortable spacing on mobile screens */
    .modal-dialog {
        margin: 0.5rem !important;
    }
    .modal-header {
        padding: 0.65rem 0.85rem !important;
    }
    .modal-header .modal-title {
        font-size: 1.05rem !important;
    }
    .modal-body {
        padding: 0.85rem !important;
    }
    .modal-footer {
        padding: 0.5rem 0.75rem !important;
    }

    /* Top navbar slim on mobile for more content room */
    .navbar {
        padding-top: 0.35rem !important;
        padding-bottom: 0.35rem !important;
    }
    .navbar-brand {
        font-size: 1rem !important;
    }
    .brand-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.85rem !important;
    }
    .user-avatar-circle {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
    }

    /* Slim, ergonomic Bottom Navigation */
    .mobile-bottom-nav {
        height: 56px !important;
    }
    .bottom-nav-item {
        font-size: 0.7rem !important;
        padding: 3px 0 !important;
        min-height: 44px !important;
    }
    .bottom-nav-item i {
        font-size: 1.15rem !important;
        margin-bottom: 1px !important;
    }
    .mb-mobile-nav {
        margin-bottom: 68px !important;
    }

    /* Fixed Top-Right positioning for Mobile Profile Card */
    .profile-dropdown-card {
        position: fixed !important;
        top: 52px !important;
        right: 8px !important;
        left: auto !important;
        width: calc(100vw - 16px) !important;
        max-width: 320px !important;
        transform: none !important;
        max-height: calc(100vh - 110px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px !important;
    }
}

/* ==========================================================================
   PREMIUM USER PROFILE DROPDOWN CARD (GLOBAL & DESKTOP)
   ========================================================================== */
.no-caret::after {
    display: none !important;
}

.profile-avatar-btn {
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50rem;
    transition: all 0.2s ease-in-out;
}
.profile-avatar-btn:hover, .profile-avatar-btn:focus, .nav-item.dropdown.show .profile-avatar-btn {
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.profile-dropdown-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 8px 16px -6px rgba(15, 23, 42, 0.12) !important;
    padding: 0 !important;
    min-width: 300px;
    max-width: 330px;
    overflow: hidden;
    background: #ffffff !important;
    animation: profileDropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes profileDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-card-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.profile-menu-list {
    padding: 6px;
    list-style: none;
    margin: 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #1e293b;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}
.profile-menu-item:hover, .profile-menu-item:focus {
    background-color: #f8fafc;
    color: #0f172a;
    transform: translateX(2px);
}

.profile-menu-item .menu-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.profile-menu-item:hover .menu-icon-box {
    transform: scale(1.08);
}

.profile-menu-item .menu-item-text {
    flex-grow: 1;
    min-width: 0;
}

.profile-menu-item .menu-item-title {
    font-weight: 600;
    line-height: 1.25;
    color: #1e293b;
    font-size: 0.85rem;
}

.profile-menu-item .menu-item-subtitle {
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.2;
    margin-top: 2px;
}

.profile-menu-item .menu-chevron {
    color: #cbd5e1;
    font-size: 0.72rem;
    transition: transform 0.15s ease, color 0.15s ease;
}
.profile-menu-item:hover .menu-chevron {
    color: #2563eb;
    transform: translateX(2px);
}

.profile-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    padding: 6px 10px 2px;
}

.profile-logout-btn:hover {
    background-color: #fef2f2 !important;
}
.profile-logout-btn:hover .menu-item-title {
    color: #dc2626 !important;
}