/* ========================================
   GLOBAL SCROLLBAR & SELECTION
   ======================================== */

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 10px;
    border: 2px solid var(--neutral-100);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-300) var(--neutral-100);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: var(--primary-100);
    color: var(--primary-900);
}


/* Modern Color System - CSS Custom Properties */
:root {
    /* Primary Brand Blues - Organization Colors */
    --primary-50: #f1f6fb;
    --primary-100: #dceaf5;
    --primary-200: #bad4e8;
    --primary-300: #89b3d1;
    --primary-400: #4f86ad;
    --primary-500: #173863;
    /* Main Brand Blue */
    --primary-600: #173863;
    --primary-700: #123154;
    --primary-800: #0d2745;
    --primary-900: #081d34;
    --shopmaster-orange: #f89820;

    /* Neutral Colors - Professional Whites & Grays */
    --neutral-50: #ffffff;
    --neutral-100: #f8fafc;
    --neutral-200: #f1f5f9;
    --neutral-300: #e2e8f0;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;


    /* Glassmorphic Effects */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(26, 56, 98, 0.07);


    /* Success Colors */
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;

    /* Warning Colors */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;

    /* Error/Danger Colors */
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    /* Semantic Colors */
    --background: var(--neutral-100);
    --surface: #ffffff;
    --text-primary: var(--neutral-900);
    --text-secondary: var(--neutral-600);
    --text-tertiary: var(--neutral-500);
    --border: var(--neutral-300);
    --border-light: var(--neutral-200);


    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}


/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: flex;
}

/* Login Screen - 50/50 Split */
#loginScreen.active {
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.login-split-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Left Side - Elite Blue Branding */
.login-branding {
    flex: 1;
    background: linear-gradient(135deg, #102A43 0%, #1A3862 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}


.login-branding::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.branding-content {
    width: 100%;
    max-width: 480px;
    text-align: center;
    z-index: 1;
}


.branding-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: 0;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.branding-subtitle {
    font-size: 17px;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.4;
    margin-bottom: 32px;
    color: #ffffff;
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.feature-item {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}


.feature-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(10px) translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-text strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    letter-spacing: 0;
}

.feature-text span {
    font-size: 13.5px;
    opacity: 0.85;
    color: #ffffff;
    line-height: 1.4;
    font-weight: 400;
}




/* Right Side - White Login Form */
.login-form-section {
    flex: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px;
    position: relative;
    overflow-y: hidden;
}


/* Restored & Scaled Brand Logo */
.login-logo-top {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
}

.login-logo-top img {
    width: 220px;
    max-width: min(220px, 32vw);
    height: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.95;
}

.login-logo-top img:hover {
    transform: scale(1.05);
    opacity: 1;
}



.login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-form-wrapper h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: 12px;
    letter-spacing: 0;
    text-align: center;
}



.login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.login-form .form-group label {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 1px;
}

.login-form .form-group small {
    font-size: 10px;
    margin-top: 1px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--neutral-50);
    color: var(--neutral-900);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--primary-50);
}


.login-form input::placeholder {
    color: #94a3b8;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ffab2d 0%, #f7941d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(247, 148, 29, 0.24);
}


.btn-login:hover {
    background: linear-gradient(135deg, #ffb642 0%, #f79f31 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 148, 29, 0.25);
}


.btn-login:active {
    transform: translateY(0);
}

/* Registration Screen Optimizations */
#registrationScreen .login-form-section {
    padding: 60px 40px;
    align-items: flex-start;
    overflow-y: hidden;
}

#registrationScreen .login-form-wrapper {
    max-width: 650px;
}

#registrationScreen .login-form-wrapper h2 {
    margin-bottom: 25px;
    font-size: 30px;
}

.registration-grid-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 15px 25px !important;
}

.registration-grid-container .full-width {
    grid-column: span 2;
    margin-top: 10px;
}

#registrationScreen .login-form .form-group {
    gap: 6px;
}

#registrationScreen .login-form label {
    font-size: 13px;
    font-weight: 600;
}

#registrationScreen .login-form input {
    padding: 12px 16px;
    font-size: 14px;
}

/* Mobile Responsive Login */
@media (max-width: 768px) {
    .login-split-container {
        flex-direction: column;
    }

    .login-branding {
        padding: 30px 20px;
        min-height: 40vh;
    }

    .branding-content h1 {
        font-size: 28px;
    }

    .branding-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .branding-features {
        gap: 10px;
    }

    .feature-item {
        padding: 12px 16px;
    }

    .feature-text strong {
        font-size: 14px;
    }

    .feature-text span {
        font-size: 12px;
    }

    .login-form-section {
        padding: 30px 20px;
    }

    .login-logo-top {
        top: 20px;
        right: 20px;
    }

    .login-logo-top img {
        max-width: 120px;
    }

    .login-form-wrapper h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    /* Enable scrolling on login screen for mobile */
    #loginScreen.active,
    #registrationScreen.active {
        overflow-y: auto !important;
        height: auto !important;
        display: block !important;
        /* Allow normal block flow for scrolling */
    }

    .login-split-container {
        height: auto !important;
        /* Allow container to grow */
        min-height: 100vh;
    }

    .login-form-section {
        padding: 30px 20px;
        overflow-y: visible !important;
        /* Allow content to overflow/scroll within parent */
        height: auto !important;
    }

    /* Force registration to single column on mobile */
    .registration-grid-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .registration-grid-container .full-width {
        grid-column: auto !important;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-form button:active {
    transform: translateY(0);
}

.demo-credentials {
    margin-top: 24px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #1A3862;
}

.demo-credentials p {
    margin: 6px 0;
    color: #475569;
}

.demo-credentials strong {
    color: #1e293b;
}

/* Premium Loader Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--primary-100);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-900);
    letter-spacing: 0;
    animation: pulse 2s ease-in-out infinite;
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* Skeleton Screens & Shimmer */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }

    100% {
        background-position: 468px 0;
    }
}

.skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: shimmer 1.2s linear infinite forwards;
    border-radius: 4px;
}

.skeleton-card {
    height: 120px;
    width: 100%;
    border-radius: 16px;
    margin-bottom: 20px;
}

.skeleton-row {
    height: 50px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 14px;
    width: 70%;
    margin-bottom: 8px;
    border-radius: 2px;
}

/* Staggered Entry Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.1s;
}

.stagger-3 {
    animation-delay: 0.15s;
}

.stagger-4 {
    animation-delay: 0.2s;
}

.stagger-5 {
    animation-delay: 0.25s;
}


/* Micro-animations & Glassmorphism */
.sidebar {
    backdrop-filter: blur(10px);
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
}

.metric-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.nav-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    transform: translateX(4px);
}

.btn-primary,
.btn-login {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:active,
.btn-login:active {
    transform: scale(0.98);
}


.error-message {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 14px;
}

/* Main App Layout */
#mainApp {
    display: none;
    height: 100vh;
}

#mainApp.active {
    display: flex;
}

/* ========================================
/* ========================================
   SIDEBAR NAVIGATION - Premium Dark Design
   ======================================== */

/* Sidebar Container */
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}


/* Brand Header */
.nav-brand {
    padding: 26px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    background: linear-gradient(180deg, rgba(240, 247, 255, 0.9) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.sidebar-logo {
    height: 32px;
    width: auto;
}

.sidebar-brand-app {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-500);
    letter-spacing: 0;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-800) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand-logo-shell {
    width: 126px;
    height: 126px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.sidebar-brand-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 999px;
}

.sidebar-brand-logo-fallback {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: var(--primary-600);
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 0;
}

@media (max-width: 768px) {
    .nav-brand {
        padding: 22px 18px 18px;
        gap: 10px;
    }

    .sidebar-brand-logo-shell {
        width: 104px;
        height: 104px;
        border-radius: 999px;
    }

    .sidebar-brand-logo,
    .sidebar-brand-logo-fallback {
        width: 100%;
        height: 100%;
    }

    .sidebar-brand-logo-fallback {
        font-size: 34px;
    }
}


/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 4px;
}

/* Scrollbar styling for sidebar */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--neutral-200);
    border-radius: 2px;
}

/* Section Labels */
.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
    padding: 20px 12px 10px 12px;
    margin: 0;
}

.nav-section-label:first-child {
    padding-top: 0;
}

/* Collapsible Section Label */
.collapsible-section {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

.collapsible-section:hover {
    color: #94a3b8;
}

.section-arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
    color: #64748b;
}

/* Collapsible Items Container */
.collapsible-items {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.collapsible-items.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Navigation Buttons */
.nav-btn {
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--neutral-600);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    min-height: 44px;
    margin-bottom: 2px;
}

.nav-btn:hover {
    background-color: var(--neutral-50);
    color: var(--primary-700);
}

.nav-btn.active {
    background-color: var(--accent-50);
    color: var(--primary-700);
    font-weight: 700;
    border-left: 4px solid var(--accent-500);
    border-radius: 0 8px 8px 0;
}


/* Icons */
.nav-icon {
    display: block;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.nav-text {
    flex: 1;
    line-height: normal;
}

.nav-tooltip {
    background: var(--primary-900);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    position: absolute;
    left: 270px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.nav-btn:hover .nav-tooltip {
    opacity: 1;
    left: 250px;
}


/* Hover State */
/* Conflicting dark theme styles removed */

/* User Section */
/* User Section */
/* User Section */
.nav-user {
    padding: 16px 16px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--neutral-50);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: default;
    transition: none;
}

.nav-user-info:hover {
    border-color: transparent;
    box-shadow: none;
}

.nav-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-100);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: none;
    border: 1px solid var(--primary-200);
}

.nav-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--neutral-900);
    line-height: 1.2;
}

.nav-user-role {
    font-size: 11px;
    color: var(--neutral-500);
    line-height: 1.2;
}

/* Logout Button */
.nav-logout-btn {
    width: 100%;
    padding: 8px 0 4px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #ef4444;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-top: 4px;
    opacity: 0.8;
}

.nav-logout-btn:hover {
    color: #f87171;
    opacity: 1;
}

.nav-logout-btn .nav-icon {
    display: block;
}

/* ========================================
   OFFLINE STATUS INDICATORS
   ======================================== */

.offline-status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    margin: 0;
    border-top: 1px solid var(--neutral-200);
    border-bottom: 1px solid var(--neutral-200);
}

.offline-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    animation: pulse-offline 2s ease-in-out infinite;
}

.offline-indicator svg {
    flex-shrink: 0;
}

@keyframes pulse-offline {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.offline-queue-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.offline-queue-badge:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #f87171, #ef4444);
}



/* Offline Queue Modal Styles */
.offline-queue-list {
    max-height: 400px;
    overflow-y: auto;
}

.offline-queue-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--neutral-200);
}

.offline-queue-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offline-queue-item {
    padding: 12px;
    background: var(--neutral-50);
    border-radius: 8px;
    border-left: 4px solid var(--primary-500);
}

.offline-queue-item.status-failed {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.offline-queue-item.status-pending {
    border-left-color: #f59e0b;
}

.oqi-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.oqi-type {
    font-weight: 600;
    color: var(--neutral-800);
    text-transform: uppercase;
    font-size: 11px;
    padding: 2px 8px;
    background: var(--primary-100);
    border-radius: 4px;
}

.oqi-amount {
    font-weight: 700;
    color: var(--neutral-900);
    font-size: 14px;
}

.oqi-date {
    font-size: 11px;
    color: var(--neutral-500);
    margin-left: auto;
}

.oqi-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.oqi-status-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.oqi-status-badge.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.oqi-status-badge.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.oqi-error {
    font-size: 11px;
    color: #dc2626;
    font-style: italic;
}

.oqi-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.oqi-actions .btn-sm {
    padding: 4px 12px;
    font-size: 11px;
}

.offline-queue-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    justify-content: flex-end;
}

/* Offline Mode Toggle */
.offline-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    margin-bottom: 0;
}

.offline-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--neutral-600);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--neutral-300);
    transition: 0.3s;
    border-radius: 22px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(18px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    background: #f8fafc;
}

/* Fix for User Management and Subscription scroll issues */
#users,
#settings-team,
#settings-subscription {
    overflow-x: hidden;
    height: auto;
    /* Ensure no fixed height causes double scroll */
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */

/* Mobile Menu Button - Hidden (using bottom nav instead) */
.mobile-menu-btn {
    display: none !important;
    visibility: hidden;
}

.mobile-menu-btn span {
    display: none;
}

/* Mobile Overlay - Hidden (using bottom nav instead) */
.mobile-overlay {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Media Queries */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        /* Slightly wider on mobile for better touch */
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 25px rgba(0, 0, 0, 0.2);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 60px;
        /* Space for hidden header/button */
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* Tab Content */
[hidden] {
    display: none !important;
}

.tab-content {
    display: none;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-header h2 {
    color: #333;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Custom Dashboard Layout: 2 cards on top, 3 below */
.dashboard-grid-custom {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

/* User View: Simple 3-column layout */
.dashboard-grid-custom.user-view {
    grid-template-columns: repeat(3, 1fr) !important;
}

.dashboard-grid-custom.user-view .metric-card {
    grid-column: span 1 !important;
}

/* Profit Metrics Layout: 2 cards on top, 3 below */
.profit-metrics-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profit-metrics-top {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.profit-metrics-bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Large cards span 3 columns each (2 cards = 6 columns) */
.metric-card-large {
    grid-column: span 3;
    padding: 50px 40px;
    min-height: 180px;
}

/* Large card values - bigger font size */
.metric-card-large .metric-value {
    font-size: 56px;
}

.metric-card-large h3 {
    font-size: 15px;
}

/* Small cards span 2 columns each (3 cards = 6 columns) */
.metric-card-small {
    grid-column: span 2;
    padding: 35px 30px;
    min-height: 140px;
}

/* Small card values - standard size */
.metric-card-small .metric-value {
    font-size: 44px;
}

.metric-card {
    background: white;
    padding: 40px 35px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.metric-card h3 {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 48px;
    font-weight: 700;
    background: linear-gradient(135deg, #1A3862 0%, #102A43 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    word-break: break-word;
}

.metric-card.alert .metric-value {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.dashboard-section h3 {
    margin-bottom: 15px;
    color: #333;
}

.restaurant-dashboard-shell,
.restaurant-order-actions,
.restaurant-dashboard-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.restaurant-dashboard-grid,
.restaurant-orders-grid {
    grid-template-columns: repeat(4, 1fr);
}

.restaurant-dashboard-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.restaurant-order-feed-item {
    cursor: pointer;
}

.restaurant-order-feed-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.restaurant-order-queue-item {
    align-items: center;
}

.restaurant-order-settlement-item {
    gap: 24px;
    padding: 18px 20px;
    align-items: center;
}

.restaurant-order-settlement-main {
    flex: 1 1 auto;
    min-width: 0;
}

.restaurant-order-settlement-main strong {
    display: block;
    margin-bottom: 6px;
}

.restaurant-order-settlement-main small {
    display: block;
    color: #64748b;
    line-height: 1.45;
}

.restaurant-order-settlement-side {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.restaurant-order-settlement-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 120px;
}

.restaurant-order-settlement-total {
    color: #22c55e;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.restaurant-order-settlement-actions .restaurant-ticket-actions {
    width: auto;
    min-width: 220px;
    max-width: 220px;
    gap: 8px;
}

.restaurant-order-settlement-actions .restaurant-order-inline-action {
    min-height: 38px;
    padding: 8px 12px;
}

.restaurant-order-inline-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 132px;
    min-height: 42px;
    padding: 10px 14px;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    line-height: 1;
    text-decoration: none;
    user-select: none;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.restaurant-order-inline-action:hover {
    transform: translateY(-1px);
    border-color: #94a3b8;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.restaurant-order-inline-action:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.18);
    outline-offset: 2px;
}

.restaurant-order-inline-action:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.1);
}

.restaurant-order-feed-meta .restaurant-order-inline-action {
    align-self: flex-end;
    min-height: 40px;
    padding: 8px 16px;
}

.restaurant-ticket-actions {
    width: 100%;
    max-width: 250px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    justify-self: end;
}

.restaurant-ticket-actions .restaurant-order-inline-action {
    width: 100%;
    min-width: 0;
}

.restaurant-ticket-actions-has-primary .restaurant-order-inline-primary,
.restaurant-ticket-actions .restaurant-order-inline-danger:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.restaurant-order-inline-primary {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #ffffff;
    box-shadow: 0 10px 18px rgba(249, 115, 22, 0.22);
}

.restaurant-order-inline-subtle {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #334155;
    border-color: #d7dee7;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.restaurant-order-inline-danger {
    color: #be123c;
    border-color: #fecdd3;
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
    box-shadow: 0 6px 14px rgba(190, 24, 93, 0.08);
}

.kitchen-ticket-list {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
}

.kitchen-ticket-list-head,
.kitchen-ticket-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(240px, 1.3fr) minmax(120px, 0.6fr) minmax(110px, 0.5fr) minmax(210px, 0.9fr);
    gap: 16px;
    padding: 16px 18px;
}

.kitchen-ticket-list-head {
    background: #f8fafc;
    border-bottom: 1px solid #dbe4f0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.kitchen-ticket-row {
    border-bottom: 1px solid #e2e8f0;
    align-items: start;
}

.kitchen-ticket-row:last-child {
    border-bottom: none;
}

.kitchen-ticket-ticket,
.kitchen-ticket-items,
.kitchen-ticket-status,
.kitchen-ticket-timer,
.kitchen-ticket-action {
    min-width: 0;
}

.kitchen-ticket-ticket {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kitchen-ticket-ticket strong {
    color: #0f172a;
    font-size: 16px;
}

.kitchen-ticket-ticket small {
    color: #64748b;
    line-height: 1.5;
}

.kitchen-ticket-notes {
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

.kitchen-ticket-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kitchen-ticket-items li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #1e293b;
    line-height: 1.5;
}

.kitchen-ticket-items li strong {
    min-width: 42px;
    color: #0f172a;
}

.kitchen-ticket-item-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kitchen-ticket-item-copy small {
    color: #92400e;
    font-size: 12px;
}

.kitchen-ticket-status,
.kitchen-ticket-timer,
.kitchen-ticket-action {
    display: flex;
    align-items: center;
}

.kitchen-ticket-timer span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 700;
}

.kitchen-ticket-action {
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}

.kitchen-ticket-finished {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.restaurant-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.restaurant-action-card {
    appearance: none;
    width: auto;
    min-width: 260px;
    min-height: 44px;
    border: none;
    background: var(--accent-500);
    border-radius: 10px;
    padding: 13px 28px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(247, 148, 29, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.restaurant-action-card::after {
    display: none;
}

.restaurant-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(247, 148, 29, 0.3);
    background: var(--accent-600);
}

.restaurant-action-card:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(247, 148, 29, 0.22);
}

.restaurant-action-card:focus-visible {
    outline: 3px solid rgba(247, 148, 29, 0.28);
    outline-offset: 3px;
}

.restaurant-action-card strong {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.restaurant-action-card span {
    display: none;
}

.restaurant-plan-banner {
    border: 1px solid #fdba74;
    background: linear-gradient(135deg, #fffaf0 0%, #fff7ed 100%);
}

.restaurant-plan-banner-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.restaurant-plan-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.restaurant-plan-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

@media (max-width: 768px) {
    .onboarding-card-header,
    .onboarding-compact,
    .onboarding-complete {
        flex-direction: column;
        align-items: stretch;
    }

    .restaurant-dashboard-columns,
    .restaurant-order-actions,
    .restaurant-plan-banner-head {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .restaurant-order-actions {
        align-items: stretch;
    }

    .restaurant-action-card {
        width: 100%;
        min-width: 0;
    }

    .restaurant-dashboard-grid,
    .restaurant-orders-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .restaurant-order-feed-meta {
        align-items: flex-start;
    }

    .restaurant-order-settlement-item,
    .restaurant-order-settlement-side {
        flex-direction: column;
        align-items: stretch;
    }

    .restaurant-order-settlement-side {
        margin-left: 0;
        gap: 14px;
    }

    .restaurant-order-settlement-summary {
        align-items: flex-start;
        min-width: 0;
    }

    .restaurant-order-settlement-actions .restaurant-ticket-actions {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .kitchen-ticket-list-head,
    .kitchen-ticket-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .kitchen-ticket-list-head {
        display: none;
    }

    .kitchen-ticket-row {
        padding: 18px 16px;
    }

    .kitchen-ticket-action {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .restaurant-ticket-actions {
        max-width: none;
        justify-self: stretch;
    }

    .onboarding-step-list {
        grid-template-columns: 1fr;
    }
}

#onboardingChecklistPanel {
    margin-bottom: 20px;
}

.onboarding-shell {
    margin-bottom: 20px;
}

.onboarding-card {
    background: linear-gradient(145deg, #fffaf2 0%, #ffffff 62%);
    border: 1px solid #f6d7a8;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.onboarding-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 12px;
}

.onboarding-card-header h3 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #102a43;
}

.onboarding-card-header p {
    margin: 0;
    color: #52606d;
}

.onboarding-card-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.onboarding-progress {
    padding: 0 24px 18px;
}

.onboarding-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #52606d;
}

.onboarding-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}

.onboarding-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}

.onboarding-step-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0 24px 24px;
}

.onboarding-step {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.onboarding-step.is-complete {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.onboarding-step.is-locked {
    opacity: 0.7;
}

.onboarding-step-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.onboarding-step-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
    flex-shrink: 0;
}

.onboarding-step.is-complete .onboarding-step-icon {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.onboarding-step-title {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.onboarding-step-title strong {
    color: #102a43;
}

.onboarding-step p {
    margin: 0;
    color: #52606d;
    font-size: 14px;
    line-height: 1.5;
}

.onboarding-step-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.onboarding-compact,
.onboarding-complete {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.onboarding-complete {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.onboarding-compact strong,
.onboarding-complete strong {
    display: block;
    margin-bottom: 4px;
    color: #102a43;
}

.onboarding-compact p,
.onboarding-complete p {
    margin: 0;
    color: #52606d;
}

.onboarding-import-note {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    line-height: 1.5;
    margin-bottom: 16px;
}

.onboarding-import-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.onboarding-import-selected,
.onboarding-import-status {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    margin-bottom: 12px;
}

.onboarding-import-results {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    max-height: 260px;
    overflow-y: auto;
}

.onboarding-import-results h4 {
    margin: 0 0 10px;
    color: #102a43;
}

.onboarding-import-results ul {
    margin: 0;
    padding-left: 18px;
    color: #475569;
}

.inventory-import-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.inventory-import-step {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    color: #64748b;
}

.inventory-import-step.is-active {
    border-color: #f59e0b;
    background: #fff7ed;
    color: #9a3412;
}

.inventory-import-step strong {
    display: block;
    color: #102a43;
    margin-bottom: 4px;
}

.inventory-import-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inventory-import-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.inventory-import-field {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.inventory-import-field label {
    display: block;
    font-weight: 600;
    color: #102a43;
    margin-bottom: 8px;
}

.inventory-import-field select {
    width: 100%;
}

.inventory-import-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #334155;
}

.inventory-import-badge.required {
    background: #fee2e2;
    color: #b91c1c;
}

.inventory-import-badge.optional {
    background: #dbeafe;
    color: #1d4ed8;
}

.inventory-import-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.inventory-import-summary-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
}

.inventory-import-summary-card strong {
    display: block;
    font-size: 24px;
    color: #102a43;
}

.inventory-import-table-wrap {
    max-height: 360px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.inventory-import-table {
    width: 100%;
    border-collapse: collapse;
}

.inventory-import-table th,
.inventory-import-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
    text-align: left;
}

.inventory-import-row-meta {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.inventory-import-warning {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #fde68a;
    background: #fef3c7;
    color: #92400e;
}

.inventory-import-error {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.inventory-import-actions-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.inventory-import-primary-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .inventory-import-stepper,
    .inventory-import-summary,
    .inventory-import-grid {
        grid-template-columns: 1fr;
    }

    .inventory-import-actions-row {
        align-items: stretch;
    }
}

.alert-list,
.recent-list {
    max-height: 300px;
    overflow-y: auto;
}

.alert-item,
.recent-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-item:last-child,
.recent-item:last-child {
    border-bottom: none;
}

.alert-item.critical {
    background: #ffe6e6;
    border-left: 4px solid #e74c3c;
}

/* Buttons */
.btn-primary {
    padding: 11px 22px;
    background: var(--accent-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--accent-600);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 148, 29, 0.25);
}

.btn-secondary {
    padding: 11px 22px;
    background: var(--neutral-200);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--neutral-300);
    color: var(--text-primary);
}

.btn-success {
    padding: 8px 16px;
    background: var(--success-600);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: var(--success-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
}

.btn-danger {
    padding: 8px 16px;
    background: var(--error-500);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--error-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.btn-info {
    padding: 8px 16px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-info:hover {
    background: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(26, 56, 98, 0.3);
}

.btn-warning {
    padding: 8px 16px;
    background: var(--warning-500);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: var(--warning-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* Button loading spinner for preventing double-clicks */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

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

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Sub-tab Buttons */
/* Sub-Navigation Tabs */
.sub-nav-tabs {
    display: flex;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.sub-nav-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sub-nav-btn:hover {
    color: var(--primary-700);
    background: var(--primary-50);
}

.sub-nav-btn.active {
    background: var(--primary-600) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(26, 56, 98, 0.2);
}

.sub-nav-btn .notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    /* Red */
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}

/* Mobile: scrollable sub-nav tabs */
@media (max-width: 768px) {
    .sub-nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 10px;
        margin-bottom: 16px;
        scrollbar-width: none;
    }

    .sub-nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .sub-nav-btn {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 12px;
        padding: 7px 12px;
    }
}

/* Profit Section Visibility */
.profit-section {
    display: none !important;
}

.profit-section.active {
    display: block !important;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
}

th {
    padding: 10px 12px;
    /* Compact padding */
    text-align: center;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

th.sortable:hover {
    background: #e2e8f0;
    color: #1A3862;
}

td {
    padding: 10px 12px;
    /* Compact padding */
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
    vertical-align: middle;
    height: 48px;
    /* Compact row height */
    line-height: 1.2;
    text-align: center;
}

tbody tr:hover {
    background: #f8fafc;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.status-badge.low-stock {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.in-stock {
    background: #d1fae5;
    color: #059669;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.approved {
    background: #d1fae5;
    color: #059669;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.completed,
.status-badge.settled {
    background: #d1fae5;
    color: #059669;
}

.status-badge.partial-return {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.returned {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.paid {
    background: #d1fae5;
    color: #059669;
}

.status-badge.partial {
    background: #dbeafe;
    color: #173863;
}

.status-badge.credit {
    background: #fef3c7;
    color: #d97706;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1200;
}

.modal-overlay.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 1201;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    padding: 32px;
    min-width: 500px;
}

.modal-content.large {
    min-width: 900px;
    max-width: 95vw;
    /* Prevent overflow on slightly smaller screens */
}

@media (max-width: 768px) {
    .modal-content.large {
        min-width: 0 !important;
        /* Allow shrinking on mobile */
    }
}

.modal-content h2 {
    margin-bottom: 24px;
    color: #1e293b;
    font-size: 24px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 15px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: var(--neutral-900);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-50);
    background: #ffffff;
}

/* ========================================
   FIELD-LEVEL VALIDATION FEEDBACK
   ======================================== */

/* Invalid field state */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: var(--error-500);
    background: var(--error-50);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
    border-color: var(--error-500);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group.has-error label {
    color: var(--error-600);
}

/* Error hint text below fields */
.field-error {
    display: none;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--error-600);
    margin-top: 4px;
    line-height: 1.3;
    align-items: center;
    gap: 4px;
}

.field-error::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--error-500);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
}

.form-group.has-error .field-error {
    display: flex;
}

/* Valid field state (only after interaction) */
.form-group.has-success input,
.form-group.has-success select,
.form-group.has-success textarea {
    border-color: var(--success-500);
}

.form-group.has-success input:focus,
.form-group.has-success select:focus,
.form-group.has-success textarea:focus {
    border-color: var(--success-500);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
}

.restaurant-stock-kind-picker,
.purchase-restaurant-stock-kind {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.restaurant-stock-kind-option {
    appearance: none;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, var(--neutral-100) 100%);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.restaurant-stock-kind-option:hover {
    transform: translateY(-1px);
    border-color: rgba(247, 148, 29, 0.45);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.restaurant-stock-kind-option:focus-visible {
    outline: none;
    border-color: var(--accent-500);
    box-shadow: 0 0 0 4px rgba(247, 148, 29, 0.14);
}

.restaurant-stock-kind-option strong {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.restaurant-stock-kind-option span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.restaurant-stock-kind-option.is-active {
    border-color: var(--accent-500);
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    box-shadow: 0 14px 28px rgba(247, 148, 29, 0.14);
}

.restaurant-stock-kind-option.is-active strong {
    color: var(--accent-600);
}

.restaurant-stock-kind-option.is-active span {
    color: #c2410c;
}

.restaurant-stock-kind-option-compact {
    padding: 12px 14px;
    border-radius: 14px;
}

.restaurant-stock-kind-option-compact strong {
    font-size: 13px;
}

.restaurant-stock-kind-option-compact span {
    font-size: 11px;
}

/* Shake animation for invalid submit */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.form-group.shake {
    animation: shake 0.4s ease;
}

/* Login form specific overrides */
.login-form .form-group.has-error input {
    border-color: var(--error-500);
    background: var(--error-50);
}

.login-form .form-group.has-error input:focus {
    border-color: var(--error-500);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.login-form .field-error {
    font-size: 11px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.purchase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .purchase-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Sale Items */
#saleItems {
    margin-bottom: 15px;
}

.sale-item {
    display: grid;
    grid-template-columns: 2fr 0.7fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

/* Ensure grid children respect their column sizes */
.sale-item>* {
    min-width: 0;
}

/* Desktop: Flatten the row structure into grid */
.sale-item .sale-item-row-1 {
    display: contents;
}

.sale-item .sale-item-row-2 {
    display: contents;
}

.sale-item .price-group,
.sale-item .subtotal-group {
    display: contents;
}

/* Hide labels on desktop */
.sale-item .price-label,
.sale-item .subtotal-label {
    display: none;
}

/* Desktop: Hide qty stepper buttons, show simple input */
.sale-item .qty-stepper {
    display: contents;
}

.sale-item .qty-btn {
    display: none;
}

.sale-item select,
.sale-item input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.item-subtotal {
    font-weight: 600;
    color: #173863;
}

.sale-total {
    text-align: right;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
}

.sale-total h3 {
    color: #173863;
    font-size: 24px;
}

.info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.info-box p {
    margin: 5px 0;
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

/* Purchase item dropdowns — fixed position to escape scroll container */
.purchase-suggestions.autocomplete-dropdown {
    position: fixed;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: 320px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 4px;
}

.purchase-suggestions .autocomplete-item {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 2px;
    border-bottom: none;
    font-size: 13px;
    line-height: 1.4;
}

.purchase-suggestions .autocomplete-item:last-child {
    margin-bottom: 0;
}

.purchase-suggestions .autocomplete-item:hover {
    background: var(--primary-50);
}

.purchase-suggestions .autocomplete-item strong {
    color: #1e293b;
    font-weight: 600;
}

.purchase-suggestions .autocomplete-item span {
    color: #64748b !important;
    font-size: 11px !important;
    margin-top: 2px;
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    color: var(--text-primary);
}

.autocomplete-item:hover {
    background: var(--hover-bg);
}

.autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 8px 8px;
}

.autocomplete-item span {
    color: var(--text-secondary);
}

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

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    transition: background 0.2s;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

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

.suggestion-name {
    font-weight: 600;
    color: #333;
}

.suggestion-details {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-wrap: wrap;
    }

    .nav-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

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

    .modal-content {
        min-width: 90vw;
    }

    .table-container {
        overflow-x: scroll;
    }

    .sale-item {
        grid-template-columns: 1fr;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state h3 {
    margin-bottom: 10px;
}

.empty-state-guided {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-state-guided p {
    margin: 0;
    color: #64748b;
}

.empty-state-guided-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========================================
   ENHANCED MOBILE RESPONSIVENESS
   ======================================== */

/* Viewport meta tag reminder - add to index.html if not present:
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0">
*/

/* ========================================
   TABLET OPTIMIZATION (768px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {

    /* ==========================================
       LOGIN & REGISTER - TABLET OPTIMIZED
       ========================================== */

    /* Keep side-by-side layout on tablet */
    .login-split-container {
        flex-direction: row;
    }

    /* Branding section - narrower on tablet */
    .login-branding {
        flex: 0.45;
        padding: 32px 28px;
        min-height: 100vh;
    }

    .branding-content {
        max-width: 100%;
    }

    .branding-content h1 {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .branding-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .branding-features {
        gap: 10px;
    }

    .feature-item {
        padding: 12px 16px;
    }

    .feature-text strong {
        font-size: 14px;
    }

    .feature-text span {
        font-size: 12px;
    }

    /* Form section - wider on tablet */
    .login-form-section {
        flex: 0.55;
        padding: 32px 40px;
        overflow-y: auto;
    }

    .login-logo-top {
        top: 20px;
        right: 20px;
    }

    .login-logo-top img {
        width: 140px;
    }

    .login-form-wrapper {
        max-width: 380px;
    }

    .login-form-wrapper h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    /* Touch-friendly form inputs */
    .login-form .form-group {
        margin-bottom: 16px;
    }

    .login-form .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .login-form input {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 50px;
        border-radius: 10px;
    }

    .btn-login {
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 10px;
        margin-top: 8px;
    }

    /* Registration - Keep side-by-side but stack form fields */
    #registrationScreen .login-form-section {
        padding: 32px 36px;
        align-items: center;
        overflow-y: auto;
    }

    #registrationScreen .login-form-wrapper {
        max-width: 420px;
        width: 100%;
    }

    #registrationScreen .login-form-wrapper h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    /* Stack registration form fields on tablet */
    .registration-grid-container {
        display: flex !important;
        flex-direction: column;
        gap: 12px !important;
    }

    .registration-grid-container .form-group {
        width: 100%;
    }

    .registration-grid-container .full-width {
        margin-top: 8px;
    }

    #registrationScreen .login-form input {
        padding: 14px 16px;
        font-size: 16px;
        min-height: 50px;
    }

    #registrationScreen .btn-login {
        padding: 16px;
        font-size: 16px;
        min-height: 52px;
    }

    /* Success message and shop number display */
    .shop-number-display {
        padding: 16px;
        border-radius: 12px;
    }

    /* Links below form */
    .login-form-wrapper a,
    .login-form-wrapper .form-link {
        font-size: 14px;
        padding: 8px 0;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Sidebar - Hidden by default, hamburger menu triggers it */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 20px;
    }

    /* Show hamburger menu on tablet */
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
    }

    /* Tab content */
    .tab-content {
        padding: 20px;
    }

    /* Dashboard grid - 2 columns */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .dashboard-grid-custom {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .metric-card-large,
    .metric-card-small {
        grid-column: span 1;
    }

    .metric-card {
        padding: 24px 20px;
        min-height: 120px;
    }

    .metric-value {
        font-size: 36px;
    }

    /* ==========================================
       CARD-BASED SALE ITEMS FOR TABLET
       ========================================== */
    .sale-item {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border-radius: 16px;
        border: 1px solid var(--border-light);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        margin-bottom: 16px;
        transition: all 0.2s ease;
    }

    .sale-item:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border-color: var(--primary-200);
    }

    /* Row 1: Search + Quantity Stepper + Remove */
    .sale-item .sale-item-row-1 {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .sale-item .searchable-dropdown {
        flex: 1;
    }

    .sale-item .item-select {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
        min-height: 52px;
        border-radius: 12px;
        border: 2px solid var(--border);
        background: #ffffff;
        transition: all 0.2s ease;
    }

    .sale-item .item-select:focus {
        border-color: var(--primary-500);
        box-shadow: 0 0 0 4px var(--primary-100);
    }

    /* Quantity Stepper */
    .sale-item .qty-stepper {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--neutral-100);
        border-radius: 12px;
        padding: 4px;
    }

    .sale-item .qty-btn {
        width: 48px;
        height: 48px;
        border: none;
        background: #ffffff;
        color: var(--primary-600);
        font-size: 24px;
        font-weight: 600;
        cursor: pointer;
        border-radius: 10px;
        transition: all 0.15s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .sale-item .qty-btn:hover {
        background: var(--primary-50);
        color: var(--primary-700);
    }

    .sale-item .qty-btn:active {
        transform: scale(0.95);
        background: var(--primary-100);
    }

    .sale-item .item-quantity {
        width: 60px;
        text-align: center;
        font-size: 18px;
        font-weight: 700;
        color: var(--text-primary);
        border: none;
        background: transparent;
        padding: 8px 4px;
        -moz-appearance: textfield;
    }

    .sale-item .item-quantity::-webkit-outer-spin-button,
    .sale-item .item-quantity::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* Remove button */
    .sale-item .btn-remove {
        width: 48px;
        height: 48px;
        font-size: 24px;
        border-radius: 12px;
        flex-shrink: 0;
    }

    /* Row 2: Price + Subtotal (right-aligned) */
    .sale-item .sale-item-row-2 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 12px;
        border-top: 1px solid var(--border-light);
    }

    .sale-item .price-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .sale-item .price-label {
        font-size: 14px;
        color: var(--text-tertiary);
        font-weight: 500;
    }

    .sale-item .item-price {
        width: 120px;
        padding: 10px 12px;
        font-size: 16px;
        font-weight: 600;
        text-align: right;
        border-radius: 8px;
        border: 1.5px solid var(--border);
        background: #ffffff;
        min-height: 44px;
    }

    .sale-item .item-price:focus {
        border-color: var(--primary-500);
        box-shadow: 0 0 0 3px var(--primary-100);
    }

    .sale-item .subtotal-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .sale-item .subtotal-label {
        font-size: 14px;
        color: var(--text-tertiary);
        font-weight: 500;
    }

    .sale-item .item-subtotal {
        font-size: 20px;
        font-weight: 700;
        color: var(--primary-700);
        background: var(--primary-50);
        padding: 10px 16px;
        border-radius: 10px;
        min-width: 120px;
        text-align: right;
    }

    /* Modals - Better use of tablet space */
    .modal-content {
        width: 80%;
        max-width: 600px;
        min-width: auto;
        padding: 24px;
        max-height: 85vh;
    }

    .modal-content.large {
        width: 90%;
        max-width: 800px;
        min-width: auto;
    }

    /* Forms - Keep 2 columns on tablet */
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 15px;
        min-height: 44px;
    }

    /* Tables - Touch-friendly */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 14px 12px;
    }

    /* Action buttons - Horizontal but larger */
    .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 6px;
    }

    .action-buttons button {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    /* Buttons - Touch-friendly sizes */
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-info,
    .btn-warning {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Search bar */
    .search-bar input {
        padding: 12px 16px;
        font-size: 15px;
        min-height: 44px;
    }

    /* Pagination */
    .pagination-controls {
        padding: 16px;
    }

    .btn-pagination {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
    }

    /* Profit cards */
    .profit-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Searchable dropdown - Touch optimized */
    .searchable-dropdown .dropdown-option {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Nav buttons in sidebar */
    .nav-btn {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* Tablets and Small Laptops - Legacy support */
@media (max-width: 1024px) {
    .main-container {
        padding: 15px;
    }
}

/* Tablets Portrait */
@media (max-width: 768px) {

    /* Login Screen - Stack vertically on mobile */
    .login-split-container {
        flex-direction: column;
    }

    .login-branding {
        min-height: 40vh;
        padding: 40px 24px;
    }

    .branding-content h1 {
        font-size: 32px;
    }

    .branding-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .branding-features {
        gap: 16px;
    }

    .feature-item {
        padding: 16px 20px;
    }

    .feature-icon {
        font-size: 28px;
    }

    .feature-item span:last-child {
        font-size: 14px;
    }

    .login-logo img {
        max-width: 200px;
    }

    .login-form-section {
        padding: 40px 24px;
        min-height: 60vh;
    }

    .login-form-container h2 {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 14px;
        margin-bottom: 32px;
    }

    /* Sidebar becomes overlay/drawer */
    .sidebar {
        position: fixed;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .content,
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Header adjustments */
    .header {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .header h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    /* User info responsive */
    .nav-user {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        justify-content: space-between;
    }

    /* Dashboard cards */
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    /* Tab content on tablets */
    .tab-content {
        padding: 20px 16px;
    }

    .dashboard-grid-custom {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    /* Profit Metrics - Keep 2 on top, stack 3 below on tablet */
    .profit-metrics-top {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .profit-metrics-bottom {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .profit-metrics-bottom .metric-card:nth-child(3) {
        grid-column: 1 / -1;
        /* Make 3rd card full width */
    }

    .metric-card-large {
        grid-column: span 1;
        padding: 35px 28px;
        min-height: 150px;
    }

    .metric-card-large .metric-value {
        font-size: 46px;
    }

    .metric-card-small {
        grid-column: span 1;
        padding: 28px 22px;
        min-height: 120px;
    }

    .metric-card-small .metric-value {
        font-size: 38px;
    }

    .metric-card {
        padding: 30px 25px;
        min-height: 130px;
    }

    .metric-value {
        font-size: 42px;
    }

    .stat-card h3 {
        font-size: 14px;
    }

    .stat-card .value {
        font-size: 24px;
    }

    /* Tables */
    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 8px 8px;
        /* Even tighter on tablet */
    }

    /* Hide less important columns on tablet */
    th:nth-child(5),
    td:nth-child(5),
    /* Discount */
    th:nth-child(7),
    td:nth-child(7)

    /* Payment Method */
        {
        display: none;
    }

    /* Action buttons in tables */
    .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 5px;
        align-items: center;
        flex-wrap: nowrap;
    }

    .action-buttons button {
        width: 100%;
        font-size: 12px;
        padding: 6px 10px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 500px;
        padding: 24px 16px;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Search and filter bars */
    .search-bar {
        flex-direction: column;
        gap: 10px;
    }

    .search-bar input {
        width: 100%;
    }

    .search-bar button {
        width: 100%;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {

    /* Login Screen */
    .login-branding {
        min-height: 35vh;
        padding: 32px 20px;
    }

    .branding-content h1 {
        font-size: 28px;
    }

    .branding-subtitle {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .login-logo img {
        max-width: 160px;
    }

    .login-form-section {
        padding: 32px 20px;
    }

    .login-form-container h2 {
        font-size: 24px;
    }

    .login-form input {
        padding: 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .btn-login {
        padding: 16px;
        font-size: 16px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 16px;
    }

    /* Header */
    .header {
        padding: 10px 12px;
    }

    .header h2 {
        font-size: 18px;
    }

    .user-info {
        font-size: 12px;
    }

    /* Dashboard - Single column on mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-custom {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Profit Metrics - Stack all vertically on mobile */
    .profit-metrics-top {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .profit-metrics-bottom {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .metric-card-large,
    .metric-card-small {
        grid-column: 1 / -1;
        padding: 25px 20px;
        min-height: 120px;
    }

    .metric-card-large .metric-value,
    .metric-card-small .metric-value {
        font-size: 36px;
    }

    .metric-card {
        padding: 25px 20px;
        min-height: 120px;
    }

    .metric-value {
        font-size: 36px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h3 {
        font-size: 13px;
    }

    .stat-card .value {
        font-size: 22px;
    }

    /* Tables - Horizontal scroll with better touch support */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        /* Extend to screen edges */
        padding: 0 16px;
    }

    table {
        min-width: 100%;
        /* Responsive width */
        font-size: 12px;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 12px;
        min-width: 80px;
        /* Minimum column width */
    }

    /* Make action buttons stay horizontal on mobile */
    td .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 4px;
        align-items: center;
        flex-wrap: nowrap;
        min-width: 100px;
    }

    td .action-buttons button {
        width: 100%;
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Alternative: Card view for tables on mobile */
    .table-card-view {
        display: none;
    }

    /* Buttons */
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-danger {
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Modals - Full screen on mobile for better UX */
    .modal {
        padding: 0;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        /* Let modal-content handle scroll */
        display: none;
        /* Keep hidden by default */
    }

    .modal.active {
        display: block !important;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 0;
        /* Remove padding from container, move to children */
        overflow: hidden;
        /* Prevent container scroll, use flex children */
        display: flex;
        flex-direction: column;
    }

    /* Wrap form content in a scrollable area */
    .modal-content form {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    /* The actual scrollable part */
    .modal-content .form-scroll-area,
    /* Fallback for forms without the wrapper class checking direct children could be risky,
       so we will target the scrollable middle part universally */
    .modal-content form>div:not(.modal-header):not(.modal-actions):not(.modal-footer),
    /* Or better, make the detailed form rows scroll */
    .form-row,
    .form-group,
    #saleItems {
        /* This strategy is tricky because structure varies.
            Better strategy: Make the form itself the flex container
            and the actions strictly at bottom. */
    }

    /* NEW STRATEGY:
       Header fixed at top.
       Footer (modal-actions) fixed at bottom.
       Everything in between scrolls.
    */

    .modal-header {
        flex-shrink: 0;
        padding: 16px;
        background: white;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 0;
    }

    /* Create a scrollable container for the form inputs */
    .modal-content form {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        padding-bottom: 80px;
        /* Space for fixed footer */
        -webkit-overflow-scrolling: touch;
        display: block;
        /* Reset flex if it was set */
    }

    /* Fix the actions to the bottom */
    .modal-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 12px 16px;
        border-top: 1px solid #e2e8f0;
        z-index: 20;
        margin-top: 0;
        display: flex;
        gap: 12px;
        box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .modal-actions button {
        flex: 1;
        /* Make buttons verify full width/equal width */
        margin: 0;
        height: 48px;
        /* Touch friendly height */
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        padding-bottom: 12px;
        margin-bottom: 16px;
        border-bottom: 1px solid #e2e8f0;
    }

    .modal-header h3 {
        font-size: 18px;
        padding-right: 40px;
        /* Space for close button */
    }

    .modal-body {
        padding-bottom: 80px;
        /* Space for fixed footer if any */
    }

    /* Forms */
    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Tab content padding adjustment */
    .tab-content {
        padding: 16px;
    }

    /* Sale items in forms */
    .sale-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }

    .sale-item select,
    .sale-item input {
        width: 100%;
    }

    /* Search bars and filters */
    .search-bar,
    .filters {
        flex-direction: column;
        gap: 10px;
    }

    .search-bar input,
    .search-bar select,
    .search-bar button {
        width: 100%;
    }

    /* Cards and sections */
    .card,
    .section {
        margin: 0 0 16px 0;
        border-radius: 8px;
    }

    /* Better touch targets for all interactive elements */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        /* iOS recommended touch target */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: rgba(16, 185, 129, 0.3);
        /* Visual feedback on tap */
        touch-action: manipulation;
        /* Disable double-tap zoom on buttons */
    }

    /* Ensure clickable elements are accessible */
    button,
    .btn,
    input[type="button"],
    input[type="submit"],
    select,
    .nav-btn {
        cursor: pointer;
        pointer-events: auto;
    }

    /* Responsive images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Status badges */
    .status-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Navigation */
    .nav-btn {
        padding: 10px;
        font-size: 13px;
    }

    .nav-btn i {
        font-size: 16px;
    }

    /* Pagination on mobile */
    .pagination-controls {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }

    .pagination-buttons {
        width: 100%;
        justify-content: center;
    }

    .btn-pagination {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 44px;
        /* Better touch target */
    }

    /* Receipt and print styles on mobile */
    .receipt-container {
        width: 100%;
        padding: 16px;
        font-size: 12px;
    }

    /* Better spacing for form groups */
    .form-group {
        margin-bottom: 16px;
    }

    /* Improve modal close button visibility */
    .close-btn {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        font-size: 24px;
        z-index: 10;
    }
}

/* Very Small Phones */
@media (max-width: 360px) {
    .login-branding {
        padding: 24px 16px;
    }

    .login-form-section {
        padding: 24px 16px;
    }

    .branding-content h1 {
        font-size: 24px;
    }

    .login-form-container h2 {
        font-size: 22px;
    }

    .header h2 {
        font-size: 16px;
    }

    .stat-card .value {
        font-size: 20px;
    }

    table {
        font-size: 11px;
    }

    .btn-primary,
    .btn-success {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets for touch devices */
    button,
    .btn-primary,
    .btn-success,
    .btn-info,
    .btn-danger {
        min-height: 44px;
        /* Apple's recommended minimum */
        min-width: 44px;
    }

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

    /* Remove hover effects on touch devices */
    button:hover,
    .nav-btn:hover {
        transform: none;
    }

    /* Better focus states for accessibility */
    button:active,
    .nav-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
}

/* Landscape mode for phones */
@media (max-width: 768px) and (orientation: landscape) {
    .login-split-container {
        flex-direction: row;
    }

    .login-branding {
        min-height: 100vh;
        flex: 0.4;
    }

    .login-form-section {
        flex: 0.6;
        overflow-y: auto;
    }

    .branding-features {
        display: none;
        /* Hide features in landscape to save space */
    }

    .modal-content {
        max-height: 85vh;
    }
}

/* Print styles */
@media print {

    .sidebar,
    .header,
    .action-buttons,
    .search-bar,
    .btn-primary,
    .btn-success {
        display: none !important;
    }

    .content {
        margin-left: 0;
        width: 100%;
    }

    table {
        page-break-inside: avoid;
    }

    .pagination-controls {
        display: none !important;
    }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface, white);
    border-top: 1px solid var(--border-light, #f1f5f9);
    border-radius: 0 0 12px 12px;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-pagination {
    padding: 8px 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 40px;
}

.btn-pagination:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #173863;
    color: #173863;
    transform: translateY(-1px);
}

.btn-pagination:active:not(:disabled) {
    transform: translateY(0);
}

.btn-pagination.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
    font-weight: 700;
}


.btn-pagination:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .pagination-info {
        text-align: center;
        order: 1;
    }

    .pagination-buttons {
        justify-content: center;
        order: 2;
    }

    .btn-pagination {
        padding: 10px 12px;
        min-width: 35px;
        font-size: 13px;
    }
}

/* Loading spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   MOBILE MENU BUTTON & OVERLAY
   ======================================== */

/* Mobile Menu Button (Hamburger) */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #173863;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #0d2745;
    transform: scale(1.05);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Hamburger animation when menu is open */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-overlay.active {
    opacity: 1;
}

/* Show mobile menu button and overlay on mobile devices */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
    }

    /* Ensure sidebar is above overlay */
    .sidebar {
        z-index: 1000;
    }
}

/* Tablet size - keep menu button but adjust size */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-menu-btn {
        display: flex;
        width: 40px;
        height: 40px;
    }

    .mobile-menu-btn span {
        width: 20px;
    }
}

/* ============================
   PROFIT ANALYSIS SECTION
   ============================ */

.profit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.profit-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: all 0.2s ease;
}

.profit-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.profit-card.primary {
    border-color: var(--primary-500);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(23, 56, 99, 0.05);
}


.profit-card.success {
    border-color: var(--success-500);
    background: white;
}

.profit-card.info {
    border-color: var(--info-500);
    background: white;
}

.profit-card.warning {
    border-color: var(--warning-500);
    background: white;
}

.profit-content {
    flex: 1;
}

.profit-content h3 {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profit-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.profit-subtitle {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* Analysis Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.analysis-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.analysis-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 700;
}

.analysis-badge {
    padding: 4px 12px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--neutral-50);
    border-radius: 12px;
    border-left: 4px solid var(--primary-500);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-500);
}


.item-row:hover {
    background: var(--primary-50);
    transform: translateX(4px);
}

.item-row.top {
    border-left-color: var(--success-500);
}

.item-row.low {
    border-left-color: var(--error-500);
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.item-sku {
    font-size: 12px;
    color: var(--text-tertiary);
}

.item-stats {
    text-align: right;
}

.item-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-600);
}

.item-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* Analysis Table Section */
.analysis-table-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.analysis-table-section h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 700;
}

.profit-positive {
    color: var(--success-600);
    font-weight: 600;
}

.profit-negative {
    color: var(--error-600);
    font-weight: 600;
}

.margin-high {
    background: var(--success-50);
    color: var(--success-700);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.margin-medium {
    background: var(--warning-50);
    color: var(--warning-700);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.margin-low {
    background: var(--error-50);
    color: var(--error-700);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.period-select {
    padding: 8px 16px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-select:hover {
    border-color: var(--primary-500);
}

.period-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ========================================
   P&L REPORTS & EXPENSE MANAGEMENT STYLES
   ======================================== */

/* Sub-tabs styling */
.sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--neutral-200);
    padding-bottom: 0;
}

.sub-tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--neutral-600);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.sub-tab-btn:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.sub-tab-btn.active {
    color: var(--primary-700);
    border-bottom-color: var(--primary-700);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* Section container for grouped content */
.section-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.section-container h3 {
    margin: 0 0 16px 0;
    color: var(--neutral-800);
    font-size: 18px;
    font-weight: 600;
}

.section-header {
    margin-bottom: 24px;
}

/* Expense form styling */
#expenseCategory {
    width: 100%;
}

#expenseDescription {
    width: 100%;
    resize: vertical;
    font-family: inherit;
    padding: 10px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    font-size: 14px;
}

#expenseDescription:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Button icon styling */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Period select styling enhancement */
.period-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--neutral-200);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.period-select:hover {
    background: var(--neutral-300);
    color: var(--text-primary);
    border-color: var(--neutral-400);
}

/* Status badge enhancements for expense categories */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    /* Prevent wrapping */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status variants */
.status-badge.completed,
.status-badge.in-stock,
.status-badge.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.returned,
.status-badge.out-of-stock,
.status-badge.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.partial-return,
.status-badge.low-stock,
.status-badge.status-trial {
    background: #ffedd5;
    color: #9a3412;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allow clicks to pass through container */
}

.notification {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    /* Re-enable clicks on notifications */
    border-left: 4px solid #333;
    font-size: 14px;
    color: #333;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #22c55e;
}

.notification.success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.error::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.notification.info {
    border-left-color: #3b82f6;
}

.notification.info::before {
    content: 'i';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #dbeafe;
    color: #173863;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification.warning::before {
    content: '⚠';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #fef3c7;
    color: #d97706;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

/* ========================================
   PURCHASE ITEMS UI
   ======================================== */
.purchase-items-section {
    margin-top: 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.purchase-items-title,
.purchase-items-header,
.btn-add-purchase-item {
    flex-shrink: 0;
}

.purchase-items-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: transparent;
    border-bottom: 1px solid #e2e8f0;
}

.purchase-items-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--neutral-800);
    letter-spacing: 0.3px;
}

.purchase-item-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-700);
    background: var(--primary-50);
    padding: 3px 10px;
    border-radius: 12px;
}

.purchase-items-header {
    display: grid;
    grid-template-columns: 36px 1.2fr 2fr 0.8fr 1.2fr 1.2fr 1.2fr 36px;
    gap: 8px;
    padding: 10px 16px;
    background: #eef2f7;
    font-weight: 600;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

#purchaseItems,
#poItemsBody {
    padding: 8px;
    max-height: 38vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Purchase modal flex layout — items scroll, header/footer stay fixed */
#addPurchaseModal {
    overflow: hidden !important;
}

#addPurchaseModal .modal-content.large {
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#addPurchaseModal #addPurchaseForm {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    flex: 1;
}

#addPurchaseModal .purchase-grid {
    flex-shrink: 0;
}

#addPurchaseModal .purchase-items-section {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#addPurchaseModal .purchase-grand-total,
#addPurchaseModal .modal-actions,
#addPurchaseModal #purchaseError {
    flex-shrink: 0;
}

/* Subtle scroll hint when overflowing */
#purchaseItems::-webkit-scrollbar,
#poItemsBody::-webkit-scrollbar {
    width: 5px;
}

#purchaseItems::-webkit-scrollbar-track,
#poItemsBody::-webkit-scrollbar-track {
    background: transparent;
}

#purchaseItems::-webkit-scrollbar-thumb,
#poItemsBody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#purchaseItems::-webkit-scrollbar-thumb:hover,
#poItemsBody::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.purchase-item-row {
    display: grid;
    grid-template-columns: 36px 1.2fr 2fr 0.8fr 1.2fr 1.2fr 1.2fr 36px;
    gap: 8px;
    padding: 10px 8px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 6px;
    align-items: center;
    transition: all 0.2s ease;
}

.purchase-field {
    min-width: 0;
}

.purchase-field-label {
    display: none;
}

.purchase-field-inline-label {
    display: block;
}

.purchase-field-inline-label .purchase-field-label {
    display: none;
}

.purchase-input-wrap {
    position: relative;
}

.purchase-restaurant-stock-kind {
    margin-top: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.purchase-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.purchase-stock-kind-stack {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.purchase-restaurant-stock-kind .restaurant-stock-kind-option {
    min-height: 46px;
    padding: 10px 14px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    gap: 0;
    box-shadow: none;
}

.purchase-restaurant-stock-kind .restaurant-stock-kind-option:hover {
    transform: none;
    box-shadow: none;
}

.purchase-restaurant-stock-kind .restaurant-stock-kind-option strong {
    font-size: 13px;
}

.purchase-restaurant-stock-kind .restaurant-stock-kind-option.is-active {
    background: linear-gradient(180deg, #ffab3d 0%, #f7941d 100%);
    border-color: #f7941d;
    box-shadow: 0 10px 20px rgba(247, 148, 29, 0.2);
}

.purchase-restaurant-stock-kind .restaurant-stock-kind-option.is-active strong {
    color: #ffffff;
}

.purchase-stock-kind-hint {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.purchase-item-row:hover {
    border-color: var(--primary-300);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.purchase-item-row:focus-within {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.purchase-row-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 700;
    font-size: 12px;
    border-radius: 6px;
}

.purchase-item-row input {
    margin: 0 !important;
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.15s ease;
    background: #fff;
    color: #1e293b;
}

.purchase-item-row input:hover {
    border-color: var(--primary-300);
}

.purchase-item-row input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.purchase-item-row input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.purchase-item-row input[type="number"] {
    font-variant-numeric: tabular-nums;
}

/* Hide number input spinners for cleaner look */
.purchase-item-row input[type="number"]::-webkit-outer-spin-button,
.purchase-item-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.purchase-subtotal-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 6px;
    background: #f0fdf4;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
    min-height: 36px;
}

.purchase-subtotal {
    font-weight: 700;
    font-size: 12px;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}

/* Remove button */
.btn-remove-item {
    width: 30px;
    height: 30px;
    padding: 0;
    background: transparent;
    color: #cbd5e1;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s;
}

.btn-remove-item:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Add Item button */
.btn-add-purchase-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin: 0;
    background: transparent;
    border: 2px dashed #cbd5e1;
    border-radius: 0 0 10px 10px;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-purchase-item:hover {
    background: #fff;
    border-color: var(--primary-400);
    color: var(--primary-700);
}

.btn-add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s;
}

.btn-add-purchase-item:hover .btn-add-icon {
    background: var(--primary-600);
    color: #fff;
}

/* Grand total */
.purchase-grand-total {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
}

.purchase-grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-grand-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.purchase-grand-total-amount {
    font-size: 22px;
    font-weight: 800;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}

.purchase-mobile-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.purchase-mobile-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.purchase-mobile-item strong {
    color: var(--neutral-800);
    font-size: 13px;
    line-height: 1.35;
}

.purchase-mobile-item span,
.purchase-mobile-more {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.purchase-mobile-more {
    font-weight: 600;
}

/* ========================================
   PURCHASE CONFIRMATION MODAL
   ======================================== */
#confirmPurchaseModal {
    z-index: 1300;
}

#confirmPurchaseModal.active~.modal-overlay,
#confirmPurchaseModal.active+.modal-overlay {
    z-index: 1299;
}

.confirm-purchase-header {
    text-align: center;
    margin-bottom: 24px;
}

.confirm-purchase-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: 50%;
    margin-bottom: 12px;
}

.confirm-purchase-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.confirm-purchase-subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.confirm-purchase-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.confirm-purchase-info {
    padding: 14px 18px;
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.confirm-info-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.confirm-info-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.confirm-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.confirm-purchase-items-table {
    border-bottom: 1px solid #e2e8f0;
}

/* ========================================
   PURCHASE ORDER ITEMS UI
   ======================================== */
.po-items-section {
    margin-top: 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.po-items-header {
    display: grid;
    grid-template-columns: 2.5fr 0.8fr 1.2fr 1.2fr 36px;
    gap: 0;
    padding: 10px 16px;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.po-item-row {
    display: grid;
    grid-template-columns: 2.5fr 0.8fr 1.2fr 1.2fr 36px;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
}

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

.po-item-row:hover {
    background: #f8fafc;
}

.po-item-row:focus-within {
    background: #fafbff;
}

.po-item-row select,
.po-item-row input[type="number"] {
    margin: 0 !important;
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.po-item-row select:hover,
.po-item-row input[type="number"]:hover {
    border-color: var(--primary-300);
}

.po-item-row select:focus,
.po-item-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.po-item-row input[type="number"]::-webkit-outer-spin-button,
.po-item-row input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.po-item-row input[type="number"] {
    font-variant-numeric: tabular-nums;
}

.po-row-total {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
    .po-items-header { display: none; }
    .po-item-row {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        padding: 12px 16px;
    }
    .po-item-row select,
    .po-item-row input[type="number"] { width: 100% !important; }
}

.confirm-items-head {
    display: grid;
    grid-template-columns: 2fr 0.7fr 1fr 1fr;
    gap: 8px;
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    background: #f1f5f9;
}

.confirm-items-body {
    max-height: 200px;
    overflow-y: auto;
}

.confirm-item-row {
    display: grid;
    grid-template-columns: 2fr 0.7fr 1fr 1fr;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

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

.confirm-item-name {
    font-weight: 500;
}

.confirm-item-name small {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.confirm-item-total {
    font-weight: 600;
    color: #1e293b;
}

.confirm-purchase-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.confirm-purchase-total span:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.confirm-purchase-total span:last-child {
    font-size: 20px;
    font-weight: 800;
    color: #15803d;
    font-variant-numeric: tabular-nums;
}

/* Make read-only total input look distinct */
.item-total {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    font-weight: 600;
    color: #334155 !important;
}

/* Purchase table group separator */
#purchasesTable td[rowspan] {
    border-top: 2px solid var(--border);
    background: var(--neutral-100);
    vertical-align: middle;
    text-align: center;
}

#purchasesTable .purchase-group-start td {
    border-top: 2px solid var(--border);
}

/* Supplier Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

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

.suggestion-item:hover {
    background: #f1f5f9;
    color: #173863;
}

#addPurchaseModal .modal-content {
    padding: 15px 25px;
    max-height: 85vh;
}

#addPurchaseForm .form-row {
    margin-bottom: 8px;
}

#addPurchaseForm .form-group label {
    font-size: 0.9rem;
    margin-bottom: 3px;
}

#addPurchaseForm input,
#addPurchaseForm select {
    padding: 8px 10px;
    font-size: 0.9rem;
}

#addPurchaseForm h3 {
    margin-top: 10px !important;
    margin-bottom: 6px !important;
    font-size: 1rem;
}

/* Hide scrollbar but allow content to fit */
#addPurchaseModal .modal-content {
    overflow-y: hidden !important;
}

/* Filter Section Layout */
.filter-section {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-section .btn-secondary {
    margin-left: auto;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.success-pulse {
    animation: successPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#notificationContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    padding: 16px 24px;
    border-radius: 12px;
    background: white;
    color: var(--neutral-900);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary-500);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

/* ========================================
   ENHANCED DROPDOWN & SELECT STYLES
   ======================================== */

/* Base select styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.22 4.22a.75.75 0 0 1 1.06 0L6 6.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L2.22 5.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 36px !important;
    cursor: pointer;
}

select:hover {
    border-color: var(--primary-400);
}

/* Enhanced form select styling */
.form-group select {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%234f46e5' d='M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 40px !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.form-group select:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

.form-group select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
    background-color: #ffffff;
}

/* Select option styling */
select option {
    padding: 12px 16px;
    background: #ffffff;
    color: var(--neutral-900);
    font-weight: 400;
}

select option:hover,
select option:focus,
select option:checked {
    background: var(--primary-50);
    color: var(--primary-700);
}


/* Sale item grid children sizing */
.sale-item .searchable-dropdown {
    width: 100%;
    min-width: 0;
}

/* Sale item select (item picker in sales modal) */
.sale-item .item-select {
    width: 100%;
    min-width: 0;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-800);
    transition: all 0.2s ease;
}

.sale-item .item-select:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

.sale-item .item-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
    background-color: #ffffff;
}

.sale-item .item-select::placeholder {
    color: var(--neutral-400);
    font-weight: 400;
}

/* Enhanced sale item inputs */
.sale-item input[type="number"] {
    width: 100%;
    min-width: 0;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-800);
    transition: all 0.2s ease;
    text-align: center;
}

.sale-item input[type="number"]:hover {
    border-color: var(--primary-400);
}

.sale-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

/* Enhanced period select styling override */
.period-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 40px 10px 16px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.period-select:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

.period-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
    background-color: white;
}

/* Return invoice select */
#returnInvoice {
    padding: 12px 40px 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

#returnInvoice:hover {
    border-color: var(--primary-400);
}

#returnInvoice:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

/* Report modal selects */
#reportType,
#dateRange,
#exportFormat {
    padding: 12px 40px 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reportType:hover,
#dateRange:hover,
#exportFormat:hover {
    border-color: var(--primary-400);
    background-color: var(--primary-50);
}

#reportType:focus,
#dateRange:focus,
#exportFormat:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
    background-color: white;
}

/* Purchase form selects */
#addPurchaseForm select,
#purchasePaymentMethod {
    appearance: none;
    -webkit-appearance: none;
    padding: 12px 40px 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#addPurchaseForm select:hover,
#purchasePaymentMethod:hover {
    border-color: var(--primary-400);
}

#addPurchaseForm select:focus,
#purchasePaymentMethod:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

/* User role select */
#newUserRole {
    padding: 12px 40px 12px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

/* Payment method selects */
#salePaymentMethod,
#expensePaymentMethod {
    padding: 12px 40px 12px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%236366f1' d='M3.22 5.22a.75.75 0 0 1 1.06 0L7 7.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L3.22 6.28a.75.75 0 0 1 0-1.06z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

.sale-item:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: var(--primary-200);
}

/* Remove button styling */
.sale-item .btn-remove {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--error-50);
    color: var(--error-600);
    border: 1px solid var(--error-200);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sale-item .btn-remove:hover {
    background: var(--error-100);
    border-color: var(--error-300);
    color: var(--error-700);
    transform: scale(1.05);
}

/* Enhanced subtotal display */
.item-subtotal {
    font-weight: 700;
    color: var(--primary-700);
    font-size: 15px;
    background: var(--primary-50);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    min-width: 100px;
}

/* ========================================
   SEARCHABLE DROPDOWN COMPONENT
   ======================================== */

.searchable-dropdown {
    position: relative;
    width: 100%;
}

.searchable-dropdown input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--neutral-50);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.searchable-dropdown input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(23, 56, 99, 0.1);
}

.searchable-dropdown input::placeholder {
    color: var(--neutral-400);
    font-weight: 400;
}

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

.searchable-dropdown .dropdown-options.show {
    display: block;
}

.searchable-dropdown .dropdown-option {
    padding: 6px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.1s ease;
    line-height: 1.3;
}

.searchable-dropdown .dropdown-option:last-child {
    border-bottom: none;
}

.searchable-dropdown .dropdown-option:hover {
    background: var(--primary-50);
}

.searchable-dropdown .dropdown-option.selected {
    background: var(--primary-100);
    font-weight: 600;
}

.searchable-dropdown .no-options {
    padding: 10px;
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 13px;
}

/* Return Items List Styling */
.return-item-row {
    background: white;
    border: 1px solid transparent;
}

.return-item-checkbox {
    width: 18px;
    height: 18px;
}

.item-details {
    flex: 1;
}

.return-qty-label {
    font-size: 12px;
    margin-right: 5px;
}

.return-qty-input {
    width: 60px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Clickable Dashboard Cards */
.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Non-clickable Dashboard Cards (for non-admin users) */
.non-clickable-card {
    cursor: default !important;
    pointer-events: none;
}

.non-clickable-card:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   MOBILE ENHANCEMENTS - SMARTPHONE OPTIMIZATION
   ======================================== */

/* Bottom Navigation Bar */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
    min-height: 56px;
    border-radius: 12px;
    -webkit-tap-highlight-color: rgba(23, 56, 99, 0.2);
    touch-action: manipulation;
    user-select: none;
    position: relative;
    z-index: 1;
}

.bottom-nav-btn svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    stroke-width: 1.8;
    pointer-events: none;
}

.bottom-nav-btn span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    pointer-events: none;
}

.bottom-nav-btn.active {
    color: var(--primary-500);
    background: var(--primary-50);
}

.bottom-nav-btn:active {
    transform: scale(0.92);
    background: var(--primary-100);
}

/* Settings — Sign Out section (mobile/tablet only — desktop uses sidebar logout) */
.settings-signout-section {
    display: none;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border-light);
    flex-direction: column;
    gap: 16px;
}


.settings-signout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--error-500);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(239, 68, 68, 0.2);
}

.settings-signout-btn:hover {
    background: var(--error-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.settings-signout-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

.settings-signout-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: none;
}

/* Mobile Table Card View */
@media (max-width: 768px) {

    /* Show sign-out section on mobile (hidden on desktop — sidebar has logout there) */
    .settings-signout-section {
        display: flex;
    }

    /* Show bottom navigation - managed by JS to show only after login */
    .bottom-nav {
        display: none;
    }

    /* Hide FAB on mobile as it duplicates bottom nav functionality */
    .fab {
        display: none !important;
    }

    /* Ensure body and html allow scrolling */
    html,
    body {
        overflow-x: hidden;
        overflow-y: auto !important;
        height: auto;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }

    /* Add padding to main content to account for bottom nav */
    .main-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        height: auto;
        min-height: 100vh;
    }

    /* Tab content should scroll */
    .tab-content {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        max-height: none;
    }

    /* Screen containers */
    .screen {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* Allow mainApp to expand beyond viewport */
    #mainApp {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mainApp.active {
        display: block !important;
    }

    /* Hide scrollbar on mobile for cleaner look */
    .table-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container::-webkit-scrollbar {
        display: none;
    }

    /* Table to Card Transformation */
    .data-table.mobile-cards,
    #inventoryTable.mobile-cards,
    #salesTable.mobile-cards,
    #customersTable.mobile-cards,
    #returnsTable.mobile-cards,
    #purchasesTable.mobile-cards {
        display: block;
    }

    .data-table.mobile-cards thead,
    #inventoryTable.mobile-cards thead,
    #salesTable.mobile-cards thead,
    #customersTable.mobile-cards thead,
    #returnsTable.mobile-cards thead,
    #purchasesTable.mobile-cards thead {
        display: none;
    }

    .data-table.mobile-cards tbody,
    #inventoryTable.mobile-cards tbody,
    #salesTable.mobile-cards tbody,
    #customersTable.mobile-cards tbody,
    #returnsTable.mobile-cards tbody,
    #purchasesTable.mobile-cards tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .data-table.mobile-cards tr,
    #inventoryTable.mobile-cards tr,
    #salesTable.mobile-cards tr,
    #customersTable.mobile-cards tr,
    #returnsTable.mobile-cards tr,
    #purchasesTable.mobile-cards tr {
        display: block;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 16px;
        box-shadow: var(--shadow-sm);
    }

    .data-table.mobile-cards td,
    #inventoryTable.mobile-cards td,
    #salesTable.mobile-cards td,
    #customersTable.mobile-cards td,
    #returnsTable.mobile-cards td,
    #purchasesTable.mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-light);
        font-size: 14px;
    }

    .data-table.mobile-cards td:last-child,
    #inventoryTable.mobile-cards td:last-child,
    #salesTable.mobile-cards td:last-child,
    #customersTable.mobile-cards td:last-child,
    #returnsTable.mobile-cards td:last-child,
    #purchasesTable.mobile-cards td:last-child {
        border-bottom: none;
        padding-top: 12px;
    }

    .data-table.mobile-cards td::before,
    #inventoryTable.mobile-cards td::before,
    #salesTable.mobile-cards td::before,
    #customersTable.mobile-cards td::before,
    #returnsTable.mobile-cards td::before,
    #purchasesTable.mobile-cards td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 16px;
    }

    /* Action buttons in card view */
    .data-table.mobile-cards td .btn-group,
    .data-table.mobile-cards td .action-buttons,
    .mobile-cards .action-buttons {
        display: flex;
        gap: 8px;
        width: 100%;
        justify-content: stretch;
        flex-wrap: wrap;
    }

    .data-table.mobile-cards td .btn-group .btn,
    .data-table.mobile-cards td .action-buttons button,
    .mobile-cards .action-buttons button,
    .action-buttons button {
        flex: 1;
        min-width: 80px;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        cursor: pointer;
    }

    /* Card header styling for first cell */
    .data-table.mobile-cards td:first-child {
        font-weight: 600;
        font-size: 15px;
        color: var(--text-primary);
        padding-bottom: 12px;
        margin-bottom: 4px;
        border-bottom: 2px solid var(--primary-100);
    }

    .data-table.mobile-cards td:first-child::before {
        display: none;
    }

    /* Global mobile button improvements */
    button,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-info,
    .btn-warning,
    [type="button"],
    [type="submit"] {
        min-height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(23, 56, 99, 0.2);
        cursor: pointer;
    }

    /* Ensure buttons in tables are clickable */
    table button,
    .table-container button,
    td button {
        position: relative;
        z-index: 1;
        min-height: 36px;
        padding: 8px 12px;
    }

    /* Nav buttons in sidebar */
    .nav-btn {
        min-height: 48px;
        touch-action: manipulation;
    }

    /* Hide company name in dashboard header on mobile, show only 'Dashboard' */
    #dashboardBusinessName {
        display: none !important;
    }
}

/* Purchase/Inventory Form Mobile Optimization */
@media (max-width: 768px) {

    #purchases .tab-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #purchases .tab-header .btn-primary {
        width: 100%;
    }

    #purchases .search-bar input {
        min-height: 48px;
        font-size: 16px;
    }

    #purchasesTable.mobile-cards td {
        align-items: flex-start;
    }

    #purchasesTable.mobile-cards td[data-label="Product"] {
        display: block;
    }

    .purchase-items-header {
        display: none !important;
    }

    .purchase-items-section {
        margin-top: 18px;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .purchase-items-title {
        padding: 0 0 12px;
        border-bottom: none;
    }

    .purchase-row-num {
        display: none !important;
    }

    .purchase-subtotal-inline {
        grid-column: 1 / -1;
        justify-content: space-between;
        padding: 12px 0 0;
        background: transparent;
        border: none;
        border-top: 1px solid var(--border-light);
        border-radius: 0;
        min-height: 0;
    }

    .purchase-subtotal-inline::before {
        content: 'Subtotal:';
        font-size: 12px;
        font-weight: 500;
        color: #64748b;
    }

    .purchase-item-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
        margin-bottom: 16px;
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border: 1px solid var(--border-light);
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    }

    .purchase-field {
        width: 100%;
    }

    .purchase-field-label {
        display: block;
        margin-bottom: 6px;
        color: var(--text-tertiary);
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .purchase-field-inline-label {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .purchase-field-inline-label .purchase-field-label {
        display: block;
        margin-bottom: 0;
    }

    .purchase-item-row .btn-remove-item {
        align-self: flex-end;
        order: 0;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: #ffffff;
    }

    .purchase-item-row:hover,
    .purchase-item-row:focus-within {
        border-color: var(--primary-200);
        box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    }

    /* Purchase item grid - stack on mobile */
    .inventory-form-grid,
    .sale-item-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 16px !important;
        background: var(--neutral-50);
        border-radius: 12px;
        margin-bottom: 12px;
        border: 1px solid var(--border);
    }

    .purchase-item-row input,
    .purchase-item-row select,
    .inventory-form-grid input,
    .inventory-form-grid select {
        width: 100% !important;
        min-height: 48px;
        font-size: 16px !important;
    }

    #purchaseItems {
        padding: 0;
        max-height: none;
        overflow: visible;
    }

    #addPurchaseModal .modal-content.large {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: 100%;
        margin: 0;
        border-radius: 0;
        padding: 0;
        overflow: hidden;
    }

    #addPurchaseModal h2 {
        margin: 0 !important;
        padding: 18px 16px 0;
        font-size: 22px;
        flex-shrink: 0;
    }

    #addPurchaseModal #addPurchaseForm {
        display: block;
        overflow-y: auto;
        min-height: 0;
        padding: 16px 16px calc(104px + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
    }

    #addPurchaseModal .purchase-grid {
        margin-bottom: 18px;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        gap: 16px;
    }

    #addPurchaseModal .purchase-items-section {
        flex: none;
        min-height: auto;
        overflow: visible;
    }

    #addPurchaseModal .purchase-items-title {
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }

    #addPurchaseModal .btn-add-purchase-item {
        justify-content: center;
        width: 100%;
        padding: 14px 16px;
        margin-top: 4px;
        border: 1.5px dashed var(--border);
        border-radius: 14px;
        background: var(--neutral-50);
    }

    #addPurchaseModal .purchase-grand-total {
        margin-top: 8px;
        padding: 16px;
    }

    #addPurchaseModal .purchase-grand-total-row {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    #addPurchaseModal .purchase-grand-total-amount {
        font-size: 20px;
    }

    #addPurchaseModal .modal-actions {
        margin-top: 0;
        flex-direction: row;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    #addPurchaseModal .modal-actions button {
        width: auto;
    }

    /* Form sections */
    .form-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .form-section h3,
    .form-section h4 {
        font-size: 16px;
        margin-bottom: 16px;
    }

    /* Form grid single column on mobile */
    .form-grid,
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Input groups */
    .input-group {
        flex-direction: column;
    }

    .input-group label {
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary);
    }

    .input-group input,
    .input-group select,
    .input-group textarea {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
        padding: 12px 14px;
        border-radius: 10px;
    }

    /* Remove item button in forms */
    .remove-item-btn,
    .delete-row-btn {
        position: static !important;
        width: 100% !important;
        margin-top: 8px;
        min-height: 44px;
    }

    /* Quantity steppers */
    .quantity-stepper,
    .qty-stepper {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .quantity-stepper button,
    .qty-stepper button {
        min-width: 48px;
        min-height: 48px;
        font-size: 20px;
    }

    .quantity-stepper input,
    .qty-stepper input {
        width: 80px;
        text-align: center;
        font-size: 18px;
        font-weight: 600;
    }
}

/* Very Small Screen Optimizations (360px and below) */
@media (max-width: 360px) {
    .bottom-nav-btn {
        padding: 6px 5px;
        min-width: 48px;
    }

    .bottom-nav-btn svg {
        width: 22px;
        height: 22px;
    }

    .bottom-nav-btn span {
        font-size: 9px;
    }

    /* Smaller card padding */
    .data-table.mobile-cards tr {
        padding: 12px;
    }

    .data-table.mobile-cards td {
        font-size: 13px;
    }

    /* Compact form inputs */
    .input-group input,
    .input-group select {
        min-height: 44px;
        padding: 10px 12px;
    }
}

/* Touch Device Specific Enhancements */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .bottom-nav-btn {
        min-height: 56px;
    }

    /* Disable hover effects */
    .bottom-nav-btn:hover {
        background: transparent;
    }

    .bottom-nav-btn.active:hover {
        background: var(--primary-50);
    }

    /* Better tap feedback */
    .data-table.mobile-cards tr:active {
        background: var(--neutral-100);
        transform: scale(0.99);
    }

    /* Ensure all buttons are easily tappable */
    button,
    .btn,
    [type="button"],
    [type="submit"],
    a.btn {
        min-height: 44px;
        min-width: 44px;
        position: relative;
    }

    /* Active state feedback for all buttons */
    button:active,
    .btn:active,
    [type="button"]:active,
    [type="submit"]:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    /* Prevent text selection on buttons */
    button,
    .btn {
        user-select: none;
        -webkit-user-select: none;
    }

    /* Swipe hint for tables not in card mode */
    .table-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, var(--surface), transparent);
        pointer-events: none;
        opacity: 0.8;
    }

    .table-container.scrolled-right::after {
        opacity: 0;
    }
}

/* Landscape Orientation Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav {
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .bottom-nav-btn svg {
        width: 20px;
        height: 20px;
        margin-bottom: 2px;
    }

    .bottom-nav-btn span {
        font-size: 9px;
    }

    /* Reduce main content bottom padding in landscape */
    .main-content {
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
    }
}

/* Mobile Modal Improvements */
@media (max-width: 768px) {
    .modal-content {
        border-radius: 20px 20px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        max-height: 90vh !important;
        width: 100% !important;
        animation: slideUpModal 0.3s ease-out;
        overflow-y: auto !important;
        /* Ensure content is scrollable */
    }

    @keyframes slideUpModal {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .modal-header {
        padding: 20px 16px 16px;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        background: var(--surface);
        z-index: 1;
        border-radius: 20px 20px 0 0;
    }

    .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--neutral-300);
        border-radius: 2px;
    }

    .modal-body {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        max-height: calc(90vh - 140px);
        overscroll-behavior: contain;
    }

    .modal-footer {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        position: sticky;
        bottom: 0;
        background: var(--surface);
    }

    .modal-footer .btn {
        width: 100%;
        min-height: 48px;
        margin: 4px 0;
    }
}

/* Mobile Search and Filter Improvements */
@media (max-width: 768px) {

    .search-filters,
    .filter-bar,
    .toolbar {
        flex-direction: column !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .search-filters input,
    .search-filters select,
    .filter-bar input,
    .filter-bar select {
        width: 100% !important;
        min-height: 48px;
    }

    .search-box {
        width: 100% !important;
    }

    .search-box input {
        width: 100%;
        padding-left: 44px;
    }

    /* Action buttons in toolbar */
    .toolbar .btn,
    .filter-bar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Dashboard Cards */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .stat-card,
    .dashboard-card {
        padding: 16px !important;
    }

    .stat-card h3,
    .card-value {
        font-size: 24px !important;
    }

    .stat-card p,
    .card-label {
        font-size: 12px !important;
    }

    /* Ensure all scrollable containers work on mobile */
    .dashboard-grid-custom,
    .card-content,
    .table-wrapper,
    .form-container,
    .content-wrapper {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tab header should not block scrolling */
    .tab-header {
        position: relative;
        z-index: 1;
    }

    /* Ensure cards and lists are scrollable */
    .metric-card,
    .stat-card,
    .dashboard-card {
        overflow: visible;
    }

    /* Fix any height constraints */
    .tab-content.active {
        display: block;
        height: auto;
        min-height: auto;
    }
}

/* Pull to Refresh Indicator (visual only - JS required for functionality) */
.pull-to-refresh {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-50);
    justify-content: center;
    align-items: center;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.pull-to-refresh.active {
    transform: translateY(0);
}

.pull-to-refresh .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Floating Action Button for Quick Actions */
.fab {
    display: none;
    position: fixed;
    bottom: calc(85px + env(safe-area-inset-bottom));
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-500);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(23, 56, 99, 0.4);
    cursor: pointer;
    z-index: 998;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
}

.fab svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.fab:active {
    transform: scale(0.9);
    background: var(--primary-600);
}

@media (max-width: 768px) {
    .fab {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hide sidebar completely on mobile - using bottom nav instead */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
        visibility: hidden;
    }

    /* Adjust main content to take full width */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* ========================================
   OFFLINE MODE STYLES
   ======================================== */

/* Persistent Offline Banner */
.offline-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

.offline-banner.show {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.offline-banner svg {
    flex-shrink: 0;
}

.offline-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-banner-dismiss {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.offline-banner-dismiss:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Adjust body padding when banner is visible */
body.offline-banner-visible {
    padding-top: 44px;
}

body.offline-banner-visible .sidebar {
    top: 44px;
    height: calc(100vh - 44px);
}

/* Disabled Navigation Items (Offline) */
.nav-btn.offline-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.nav-btn.offline-disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='1' y1='1' x2='23' y2='23'%3E%3C/line%3E%3Cpath d='M16.72 11.06A10.94 10.94 0 0 1 19 12.55'%3E%3C/path%3E%3Cpath d='M5 12.55a10.94 10.94 0 0 1 5.17-2.39'%3E%3C/path%3E%3Cpath d='M10.71 5.05A16 16 0 0 1 22.58 9'%3E%3C/path%3E%3Cpath d='M1.42 9a15.91 15.91 0 0 1 4.7-2.88'%3E%3C/path%3E%3Cpath d='M8.53 16.11a6 6 0 0 1 6.95 0'%3E%3C/path%3E%3Cline x1='12' y1='20' x2='12.01' y2='20'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Offline Tooltip */
.nav-btn.offline-disabled .offline-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 8px 12px;
    background: #333;
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-btn.offline-disabled .offline-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #333;
}

.nav-btn.offline-disabled:hover .offline-tooltip {
    display: block;
}

/* Bottom nav offline disabled state */
.bottom-nav-btn.offline-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.bottom-nav-btn.offline-disabled .bottom-nav-icon {
    position: relative;
}

.bottom-nav-btn.offline-disabled::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 50%;
    transform: translateX(50%) translateX(12px);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='1' y1='1' x2='23' y2='23'%3E%3C/line%3E%3Cpath d='M16.72 11.06A10.94 10.94 0 0 1 19 12.55'%3E%3C/path%3E%3Cpath d='M5 12.55a10.94 10.94 0 0 1 5.17-2.39'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

/* Disabled buttons within content */
.btn.offline-disabled,
button.offline-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

/* Card/Section disabled state */
.card.offline-disabled,
.section.offline-disabled {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.card.offline-disabled::before,
.section.offline-disabled::before {
    content: 'Requires Internet';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    white-space: nowrap;
}

/* Dark mode adjustments */
[data-theme="dark"] .offline-banner {
    background: linear-gradient(135deg, #d35400 0%, #c0392b 100%);
}

[data-theme="dark"] .nav-btn.offline-disabled .offline-tooltip {
    background: #1a1a2e;
    border: 1px solid #333;
}

[data-theme="dark"] .nav-btn.offline-disabled .offline-tooltip::before {
    border-right-color: #1a1a2e;
}

/* Subscription Status Badges */
.status-badge.status-active {
    background: #d1fae5;
    color: #059669;
}

.status-badge.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.status-badge.status-trial {
    background: #dbeafe;
    color: #173863;
}

.status-badge.status-overdue {
    background: #fef3c7;
    color: #92400e;
}

/* Grace period warning banner */
.grace-period-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #92400e;
}

.grace-period-banner svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.grace-period-banner .grace-banner-title {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.grace-period-banner span {
    font-size: 13px;
}

.grace-period-banner .grace-renew-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.grace-period-banner .grace-renew-btn:hover {
    background: #d97706;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn:hover {
    background-color: var(--hover-bg);
    color: var(--primary-600);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.notification-modal {
    width: 400px;
    max-width: min(400px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    max-height: min(80vh, calc(100vh - 88px));
    position: fixed;
    top: 72px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.notification-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

.notification-modal .modal-header::before {
    display: none;
}

.notification-modal .modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.notification-modal .modal-body {
    padding: 0;
    background: var(--surface);
}

.notification-modal .modal-actions {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-modal .modal-actions button {
    flex: none;
    height: auto;
    min-height: auto;
}

@media (max-width: 640px) {
    .notification-modal {
        top: 72px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 84px);
    }
}

.notification-list {
    overflow-y: auto;
    max-height: min(60vh, calc(100vh - 160px));
    padding: 0;
    background: var(--surface);
}

.notification-item {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    transition: background 0.2s ease, border-color 0.2s ease;
}

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

.notification-item.unread {
    background-color: var(--primary-50);
    border-left: 3px solid var(--primary-500);
}

.notification-item:hover {
    background-color: var(--neutral-50);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.notification-time {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 8px;
}

.notification-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-type {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-bottom: 4px;
}

.notification-type.info {
    background: var(--primary-50);
    color: var(--primary-600);
}

.notification-type.warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.notification-type.critical {
    background: var(--error-50);
    color: var(--error-600);
}

.notification-type.success {
    background: var(--success-50);
    color: var(--success-600);
}

.modal-header .modal-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.btn-text:hover {
    color: var(--primary-800);
}



/* ========================================
   SUBSCRIPTION EXPIRED MODAL
   ======================================== */

.expired-modal-content {
    max-width: 500px;
    text-align: center;
    border-top: 4px solid #ef4444;
}

.expired-modal-header {
    justify-content: center;
    border: none;
    padding-bottom: 0;
}

.expired-modal-icon {
    background: #fee2e2;
    padding: 16px;
    border-radius: 50%;
    display: inline-flex;
}

.expired-modal-title {
    color: var(--neutral-900, #1f2937);
    margin: 16px 0 8px;
}

.expired-modal-desc {
    color: var(--neutral-600, #4b5563);
    font-size: 16px;
    line-height: 1.5;
}

.expired-modal-info {
    background: var(--neutral-100, #f3f4f6);
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
}

.expired-modal-info-label {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--neutral-500, #6b7280);
}

.expired-modal-list {
    margin: 0;
    padding-left: 20px;
    color: var(--neutral-700, #374151);
}

.expired-modal-list li {
    margin-bottom: 4px;
}

.expired-modal-contact {
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.expired-modal-footer {
    justify-content: center;
    gap: 12px;
    border: none;
    padding-top: 0;
}

.debt-primary-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.debt-primary-ref {
    font-weight: 700;
    color: var(--text-primary);
}

.debt-primary-subtitle,
.debt-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.debt-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.debt-balance.due {
    background: var(--error-50, #fee2e2);
    color: var(--error-700, #b91c1c);
}

.debt-balance.settled {
    background: var(--success-50, #dcfce7);
    color: var(--success-700, #15803d);
}

.debt-actions {
    gap: 8px;
}

.statement-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.statement-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 16px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--surface) 0%, var(--neutral-50, #f8fafc) 100%);
}

.statement-hero.due {
    border-color: rgba(220, 38, 38, 0.2);
}

.statement-hero.settled {
    border-color: rgba(22, 163, 74, 0.18);
}

.statement-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--primary-700);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.statement-hero-copy h3 {
    margin: 10px 0 8px;
    font-size: 26px;
    line-height: 1.1;
    color: var(--text-primary);
}

.statement-party-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.statement-meta-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

.statement-meta-chip.muted {
    color: var(--text-muted, #64748b);
}

.statement-balance-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.statement-balance-card.due {
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.92) 0%, rgba(255, 255, 255, 1) 100%);
}

.statement-balance-card.settled {
    background: linear-gradient(180deg, rgba(220, 252, 231, 0.88) 0%, rgba(255, 255, 255, 1) 100%);
}

.statement-balance-label,
.statement-balance-caption {
    color: var(--text-secondary);
    font-size: 12px;
}

.statement-balance-card strong {
    font-size: 24px;
    line-height: 1.1;
    color: var(--text-primary);
}

.statement-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.statement-kpi-card {
    padding: 16px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.statement-kpi-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.statement-kpi-card strong {
    font-size: 20px;
    color: var(--text-primary);
}

.statement-section {
    padding: 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.statement-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.statement-section-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
}

.statement-section-header p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.statement-entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.statement-entry-card {
    padding: 14px;
    border-radius: 16px;
    background: var(--neutral-50, #f8fafc);
    border: 1px solid var(--border);
}

.statement-entry-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.statement-entry-top h5 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--text-primary);
}

.statement-entry-top p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.statement-entry-date {
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.statement-entry-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.statement-entry-metrics div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.statement-entry-metrics span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.statement-entry-metrics strong {
    font-size: 15px;
    color: var(--text-primary);
}

.statement-entry-metrics strong.is-due {
    color: var(--error-700, #b91c1c);
}

.statement-entry-metrics strong.is-settled {
    color: var(--success-700, #15803d);
}

.statement-empty {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed var(--border);
    color: var(--text-secondary);
    text-align: center;
    background: var(--neutral-50, #f8fafc);
}

.statement-actions-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    padding-top: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--surface) 35%);
}

@media (max-width: 900px) {
    .statement-hero {
        grid-template-columns: 1fr;
    }

    .statement-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .debt-actions {
        width: 100%;
    }

    .debt-actions .btn-small {
        flex: 1;
        min-width: 120px;
    }

    .statement-view {
        gap: 14px;
    }

    .statement-hero,
    .statement-section {
        padding: 14px;
        border-radius: 16px;
    }

    .statement-hero-copy h3 {
        font-size: 22px;
    }

    .statement-kpis {
        grid-template-columns: 1fr;
    }

    .statement-entry-top,
    .statement-entry-metrics {
        grid-template-columns: 1fr;
        display: grid;
    }

    .statement-entry-date {
        white-space: normal;
    }

    .statement-actions-bar {
        flex-direction: column;
    }

    .statement-actions-bar .btn-primary,
    .statement-actions-bar .btn-secondary {
        width: 100%;
    }
}

/* Fix for Sales, Inventory, and Purchases Scroll Issue - keeping header fixed */
#sales.active,
#inventory.active,
#purchases.active {
    height: 100vh;
    /* Fill full viewport height */
    padding-bottom: 0;
    /* Remove bottom padding to extend to bottom edge */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent container from causing main-content scroll */
}

#sales .table-container,
#inventory .table-container,
#purchases .table-container {
    flex: 1;
    /* Take all remaining vertical space */
    overflow-y: auto;
    /* Scroll internally */
    min-height: 0;
    /* Required for flex child scrolling */
}

#sales .sub-nav-tabs,
#sales .tab-header,
#sales .search-bar,
#inventory .sub-nav-tabs,
#inventory .tab-header,
#inventory .search-bar,
#purchases .sub-nav-tabs,
#purchases .tab-header,
#purchases .search-bar {
    flex-shrink: 0;
    /* Prevent header elements from shrinking */
}

/* ========================================
   SEARCHABLE DROPDOWN COMPONENT
   ======================================== */

.custom-dropdown-container {
    background: var(--surface);
    /* Fallback */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--neutral-400) transparent;
}

/* Scrollbar tweaks for dropdown */
.custom-dropdown-container::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-container::-webkit-scrollbar-thumb {
    background-color: var(--neutral-400);
    border-radius: 4px;
}

/* Dropdown Items */
.dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 6px;
    transition: all 0.15s ease;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-item:hover,
.dropdown-item.selected {
    background: var(--primary-100);
    color: var(--primary-900);
}

.dropdown-item .sub-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Dark Mode Specific overrides */
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item.selected {
    background: rgba(26, 56, 98, 0.2);
    color: var(--primary-400);
    border: 1px solid rgba(26, 56, 98, 0.3);
}

[data-theme="dark"] .dropdown-item .sub-text {
    color: var(--neutral-400);
}

/* Loading & Empty States */
.dropdown-loading,
.dropdown-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
}

/* Animations */
.dropdown-enter {
    opacity: 0;
    transform: translateY(-5px);
}

.dropdown-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Input enhancements when dropdown attached */
input[data-dropdown-attached="true"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

/* Clickable table rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.clickable-row:hover {
    background-color: var(--primary-50) !important;
}

/* Ensure empty state is not clickable if it gets the class somehow */
.clickable-row .empty-state {
    cursor: default;
}

/* ========================================
   BUSINESS BRANDING SECTION
   ======================================== */

.branding-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.migration-hub {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
}

.migration-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.migration-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    min-height: 220px;
}

.migration-card-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.migration-card-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.branding-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.branding-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.branding-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.branding-readonly-note {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--primary-200);
    background: var(--primary-50);
    color: var(--primary-700);
    font-size: 13px;
    line-height: 1.5;
}

.logo-upload-area {
    position: relative;
}

/* Dropzone */
.logo-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: var(--neutral-50);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.logo-dropzone:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.logo-dropzone.drag-over {
    border-color: var(--primary-500);
    background: var(--primary-100);
    transform: scale(1.01);
}

.logo-dropzone svg {
    color: var(--text-tertiary);
    margin-bottom: 16px;
    transition: color 0.2s ease;
}

.logo-dropzone:hover svg {
    color: var(--primary-500);
}

.dropzone-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .migration-grid {
        grid-template-columns: 1fr;
    }
}

.dropzone-link {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.dropzone-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

/* Logo Preview */
.logo-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--neutral-50);
}

.logo-preview-img {
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.logo-preview-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo-readonly-state {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--neutral-50);
    text-align: center;
    color: var(--text-secondary);
}

.logo-readonly-state strong {
    color: var(--text-primary);
    font-size: 15px;
}

.logo-readonly-state span {
    max-width: 320px;
    font-size: 13px;
    line-height: 1.5;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-height: 36px !important;
    border-radius: 8px;
}

/* Upload Status */
.upload-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.upload-status.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.upload-status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.upload-status.loading {
    background: #eff6ff;
    color: #173863;
    border: 1px solid #bfdbfe;
}

.branding-settings-divider {
    margin: 24px 0;
    border-top: 1px solid var(--border);
}

.branding-feature-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.branding-feature-copy {
    flex: 1 1 280px;
}

.branding-feature-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.branding-feature-description {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.branding-feature-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-theme-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.language-segmented-control {
    display: inline-grid;
    grid-template-columns: minmax(92px, 1fr) minmax(92px, 1fr);
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--neutral-100);
    min-width: 196px;
}

.language-option {
    min-height: 36px;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.language-option:hover {
    color: var(--text-primary);
}

.language-option.active {
    background: var(--surface);
    color: var(--primary-700);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.branding-feature-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.branding-feature-status.enabled {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.branding-feature-status.disabled {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.currency-settings-rows {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.currency-settings-row {
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(160px, 1.3fr) minmax(130px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.currency-settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.currency-settings-field input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.currency-settings-field input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-50);
    background: #ffffff;
}

.currency-settings-field input[readonly] {
    background: var(--neutral-100);
    color: var(--text-secondary);
    cursor: default;
}

.currency-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.currency-settings-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.inventory-currency-prices-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.inventory-currency-prices-heading label {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.inventory-currency-prices-heading small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.inventory-currency-price-rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.inventory-currency-price-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.inventory-currency-price-row input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--neutral-50);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.inventory-currency-price-row input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-50);
    background: #ffffff;
}

@media (max-width: 768px) {
    .branding-feature-toggle {
        align-items: stretch;
    }

    .restaurant-stock-kind-picker {
        grid-template-columns: 1fr;
    }

    .purchase-restaurant-stock-kind {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .branding-feature-control {
        width: 100%;
        justify-content: space-between;
    }

    .language-segmented-control {
        width: 100%;
    }

    .currency-settings-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .currency-active-toggle {
        justify-content: space-between;
    }
}

.hospitality-pos-modal {
    width: min(1180px, 96vw);
    max-width: 96vw;
    height: min(86vh, 900px);
    max-height: min(86vh, 900px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#hospitalityPosRoot {
    flex: 1;
    min-height: 0;
    display: flex;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: contain;
}

.hospitality-pos-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.hospitality-pos-header h2 {
    margin: 0 0 6px;
}

.hospitality-pos-header p {
    margin: 0;
    color: var(--text-secondary);
}

.hospitality-pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 20px;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hospitality-pos-browser,
.hospitality-pos-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    height: 100%;
}

.hospitality-pos-browser {
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
}

.hospitality-pos-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.hospitality-pos-search {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    background: var(--neutral-50);
}

.hospitality-pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
    align-content: start;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.hospitality-pos-grid::-webkit-scrollbar {
    width: 12px;
}

.hospitality-pos-grid::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: 999px;
}

.hospitality-pos-grid::-webkit-scrollbar-thumb {
    background: var(--neutral-400);
    border-radius: 999px;
    border: 3px solid var(--neutral-100);
}

.hospitality-pos-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

.hospitality-pos-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, var(--neutral-50) 100%);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hospitality-pos-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

.hospitality-pos-card:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hospitality-pos-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.hospitality-pos-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.hospitality-pos-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.hospitality-pos-card-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-700);
}

.hospitality-pos-card-stock {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
}

.hospitality-pos-summary {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
}

.hospitality-pos-summary h3 {
    margin: 0;
    font-size: 18px;
}

.hospitality-pos-receipt-card {
    border: 1px solid rgba(22, 163, 74, 0.18);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98) 0%, rgba(220, 252, 231, 0.9) 100%);
}

.hospitality-pos-receipt-title {
    font-size: 14px;
    font-weight: 800;
    color: #166534;
}

.hospitality-pos-receipt-meta {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: #166534;
}

.hospitality-pos-receipt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hospitality-pos-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hospitality-pos-field {
    min-width: 0;
}

.hospitality-pos-field-span-2 {
    grid-column: 1 / -1;
}

.hospitality-pos-fields-finalize {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.03);
}

.hospitality-pos-fields input,
.hospitality-pos-fields select,
.hospitality-pos-fields textarea,
.hospitality-pos-item-note {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    font-size: 14px;
    background: var(--neutral-50);
}

.hospitality-pos-fields textarea,
.hospitality-pos-item-note {
    padding: 12px 14px;
    resize: vertical;
    font-family: inherit;
}

.hospitality-pos-editing-banner {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
}

.hospitality-pos-queued-banner {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(249, 115, 22, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.98) 0%, rgba(255, 237, 213, 0.92) 100%);
}

.hospitality-pos-queued-copy {
    color: #9a3412;
    font-size: 13px;
    line-height: 1.5;
}

.hospitality-pos-queued-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.hospitality-pos-order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.hospitality-pos-empty {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--neutral-50);
}

.hospitality-pos-order-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: #fff;
}

.hospitality-pos-order-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.hospitality-pos-order-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.hospitality-pos-order-sku {
    font-size: 12px;
    color: var(--text-secondary);
}

.hospitality-pos-order-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
}

.hospitality-pos-qty {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hospitality-pos-qty button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--neutral-50);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.hospitality-pos-qty span {
    min-width: 26px;
    text-align: center;
    font-weight: 700;
}

.hospitality-pos-order-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    justify-self: end;
}

.hospitality-pos-remove {
    border: none;
    background: transparent;
    color: #b91c1c;
    font-weight: 700;
    cursor: pointer;
}

.hospitality-pos-summary-footer {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--surface) 18px);
    position: sticky;
    bottom: 0;
}

.hospitality-pos-saving {
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(30, 64, 175, 0.08);
    color: var(--primary-700);
    font-size: 13px;
    font-weight: 700;
}

.hospitality-pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.hospitality-pos-total-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 700;
}

.hospitality-pos-total-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.hospitality-pos-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .hospitality-pos-layout {
        grid-template-columns: 1fr;
    }

    .hospitality-pos-order-list {
        max-height: none;
    }
}

@media (max-width: 1100px) {
    #hospitalitySaleModal {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        transform: none !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        background: var(--neutral-50);
    }

    #hospitalitySaleModal .hospitality-pos-modal {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        padding: 16px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #hospitalityPosRoot {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .hospitality-pos-header {
        flex-shrink: 0;
        align-items: center;
        margin-bottom: 12px;
    }

    .hospitality-pos-header h2 {
        font-size: 20px;
    }

    .hospitality-pos-header p {
        font-size: 13px;
    }

    .hospitality-pos-layout {
        height: 100%;
        min-height: 0;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
        gap: 14px;
    }

    .hospitality-pos-browser,
    .hospitality-pos-summary {
        min-height: 0;
        overflow: hidden;
        border-radius: 12px;
    }

    .hospitality-pos-browser {
        display: flex;
        flex-direction: column;
        padding: 14px;
    }

    .hospitality-pos-toolbar {
        flex-shrink: 0;
    }

    .hospitality-pos-grid {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        align-content: start;
        padding-right: 2px;
        -webkit-overflow-scrolling: touch;
    }

    .hospitality-pos-summary {
        padding: 14px;
    }

    .hospitality-pos-order-list {
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 980px) {
    #hospitalitySaleModal .hospitality-pos-modal {
        padding: 12px;
    }

    .hospitality-pos-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .hospitality-pos-browser {
        min-height: 0;
    }

    .hospitality-pos-summary {
        max-height: 48vh;
        overflow: auto;
    }

    .hospitality-pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    .hospitality-pos-header {
        gap: 10px;
    }

    .hospitality-pos-header p {
        display: none;
    }

    .hospitality-pos-toolbar {
        grid-template-columns: 1fr;
    }

    .hospitality-pos-card {
        padding: 12px;
        border-radius: 12px;
    }

    .hospitality-pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 10px;
    }

    .hospitality-pos-summary {
        max-height: 52vh;
    }

    .hospitality-pos-actions,
    .hospitality-pos-receipt-actions,
    .hospitality-pos-queued-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .hospitality-pos-actions button,
    .hospitality-pos-receipt-actions button,
    .hospitality-pos-queued-actions button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .hospitality-pos-fields {
        grid-template-columns: 1fr;
    }

    .hospitality-pos-field-span-2 {
        grid-column: auto;
    }

    .hospitality-pos-order-controls {
        grid-template-columns: 1fr;
        justify-items: flex-start;
    }

    .hospitality-pos-order-total {
        justify-self: flex-start;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pharmacy parity: consistent compact action buttons on mobile table cards */
td.action-buttons,
.action-buttons,
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px !important;
    flex-wrap: wrap;
    white-space: nowrap;
}

td.action-buttons {
    min-width: max-content;
}

.action-buttons > button,
.action-buttons > a,
.table-actions > button,
.table-actions > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px !important;
    min-width: 72px;
    padding: 6px 10px !important;
    margin: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.action-buttons > button:hover,
.action-buttons > a:hover,
.table-actions > button:hover,
.table-actions > a:hover {
    box-shadow: none !important;
    transform: none !important;
    filter: brightness(0.97);
}

.action-buttons .btn-primary,
.action-buttons .btn-info,
.table-actions .btn-primary,
.table-actions .btn-info {
    background: var(--primary-600) !important;
    color: #fff !important;
    border-color: var(--primary-600) !important;
}

.action-buttons .btn-secondary,
.table-actions .btn-secondary {
    background: var(--neutral-100) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.action-buttons .btn-success,
.table-actions .btn-success {
    background: var(--success-600) !important;
    color: #fff !important;
    border-color: var(--success-600) !important;
}

.action-buttons .btn-danger,
.action-buttons .btn-danger-outline,
.table-actions .btn-danger,
.table-actions .btn-danger-outline {
    background: var(--error-500) !important;
    color: #fff !important;
    border-color: var(--error-500) !important;
}

.action-buttons .btn-warning,
.table-actions .btn-warning {
    background: var(--warning-600, #d97706) !important;
    color: #fff !important;
    border-color: var(--warning-600, #d97706) !important;
}

@media (max-width: 768px) {
    td.action-buttons,
    .action-buttons,
    .table-actions {
        justify-content: stretch;
        width: 100%;
    }

    .action-buttons > button,
    .action-buttons > a,
    .table-actions > button,
    .table-actions > a {
        flex: 0 1 auto;
        min-height: 38px !important;
        min-width: 0;
        width: auto;
    }

    .table-container table.mobile-cards tbody td.action-buttons {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 8px !important;
        width: 100%;
    }

    .table-container table.mobile-cards tbody td.action-buttons::before {
        flex: 0 0 100%;
    }

    .table-container table.mobile-cards tbody td.action-buttons > button,
    .table-container table.mobile-cards tbody td.action-buttons > a {
        align-self: center;
        flex: 0 1 auto;
        height: auto !important;
        min-height: 40px !important;
        min-width: 0;
        padding: 8px 12px !important;
        border-radius: 6px !important;
    }
}

/* Shopmaster auth shell tuned to the pharmacy sizing and fixed viewport */
#loginScreen.active,
#registrationScreen.active {
    min-height: 100vh;
    min-height: 100svh;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

#loginScreen.active {
    background:
        linear-gradient(180deg, #eef2f6 0%, #e6ebf1 100%);
}

#registrationScreen.active {
    display: flex;
    background: #ffffff;
}

#loginScreen .enterprise-login-layout,
#registrationScreen .enterprise-register-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    height: 100vh;
    height: 100svh;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #0d2137;
}

#loginScreen .enterprise-login-left,
#registrationScreen .enterprise-register-left {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 24%),
        linear-gradient(160deg, #11263b 0%, #0d1f31 74%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 30px;
    padding: 44px 48px;
    overflow: hidden;
}

#loginScreen .enterprise-login-left::before,
#registrationScreen .enterprise-register-left::before,
#loginScreen .enterprise-login-left::after,
#registrationScreen .enterprise-register-left::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

#loginScreen .enterprise-login-left::before,
#registrationScreen .enterprise-register-left::before {
    inset: auto 52px 40px 52px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 78%);
}

#loginScreen .enterprise-login-left::after,
#registrationScreen .enterprise-register-left::after {
    top: 0;
    right: 0;
    width: 28%;
    height: 100%;
    background: linear-gradient(180deg, rgba(42, 143, 163, 0.08) 0%, rgba(42, 143, 163, 0) 44%);
}

#loginScreen .enterprise-login-brand,
#registrationScreen .enterprise-login-brand,
#loginScreen .enterprise-login-left-body,
#registrationScreen .enterprise-register-left-body,
#loginScreen .enterprise-login-left-footer,
#registrationScreen .enterprise-login-left-footer {
    position: relative;
    z-index: 1;
}

#loginScreen .enterprise-login-brand,
#registrationScreen .enterprise-login-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

#loginScreen .enterprise-login-brand-logo,
#registrationScreen .enterprise-login-brand-logo {
    display: block;
    width: clamp(164px, 18vw, 230px);
    height: auto;
    object-fit: contain;
}

#loginScreen .enterprise-login-brand-meta,
#registrationScreen .enterprise-login-brand-meta {
    display: flex;
    align-items: center;
}

#loginScreen .enterprise-login-brand-sub,
#registrationScreen .enterprise-login-brand-sub {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0;
}

#loginScreen .enterprise-login-left-body,
#registrationScreen .enterprise-register-left-body {
    max-width: 400px;
}

#loginScreen .enterprise-login-badge,
#registrationScreen .enterprise-login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(201, 147, 58, 0.45);
    border-radius: 20px;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e0aa52;
    margin-bottom: 22px;
}

#loginScreen .enterprise-login-badge-dot,
#registrationScreen .enterprise-login-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c9933a;
}

#loginScreen .enterprise-login-headline,
#registrationScreen .enterprise-login-headline {
    font-size: clamp(30px, 2.8vw, 40px);
    line-height: 1.12;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -0.035em;
    margin-bottom: 14px;
}

#loginScreen .enterprise-login-desc,
#registrationScreen .enterprise-login-desc {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.66);
    max-width: 34ch;
    margin-bottom: 18px;
}

#loginScreen .enterprise-login-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#loginScreen .enterprise-login-feature-item {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#loginScreen .enterprise-login-feature-text strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

#loginScreen .enterprise-login-feature-text span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.56);
    line-height: 1.55;
}

#registrationScreen .enterprise-register-side-notes {
    width: 100%;
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#registrationScreen .enterprise-register-side-note {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#registrationScreen .enterprise-register-side-note strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

#registrationScreen .enterprise-register-side-note span {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.56);
}

#loginScreen .enterprise-login-left-footer,
#registrationScreen .enterprise-login-left-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#loginScreen .enterprise-login-security-badge,
#registrationScreen .enterprise-login-security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.44);
    letter-spacing: 0.03em;
}

#loginScreen .enterprise-login-right,
#registrationScreen .enterprise-register-right {
    background: linear-gradient(180deg, #f8fafc 0%, #f2f5f8 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

#loginScreen .enterprise-login-form-area,
#registrationScreen .enterprise-register-form-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 32px;
    overflow: hidden;
}

#registrationScreen .enterprise-register-right {
    overflow-y: auto;
}

#registrationScreen .enterprise-register-form-area {
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
}

#loginScreen .enterprise-login-form-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(13, 33, 55, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

#registrationScreen .enterprise-register-form-card {
    width: 100%;
    max-width: 760px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(13, 33, 55, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

#loginScreen .enterprise-login-form-header,
#registrationScreen .enterprise-login-form-header {
    margin-bottom: 22px;
}

#loginScreen .enterprise-login-form-eyebrow,
#registrationScreen .enterprise-login-form-eyebrow {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #1a6b7c;
    font-weight: 600;
    margin-bottom: 8px;
}

#loginScreen .enterprise-login-form-title,
#registrationScreen .enterprise-login-form-title {
    font-size: clamp(25px, 2.4vw, 32px);
    line-height: 1.12;
    color: #0d2137;
    letter-spacing: -0.04em;
    margin-bottom: 8px;
}

#loginScreen .enterprise-login-form-subtitle,
#registrationScreen .enterprise-login-form-subtitle {
    font-size: 13.5px;
    color: #5a7080;
    line-height: 1.55;
}

#loginScreen .enterprise-login-divider,
#registrationScreen .enterprise-login-divider {
    height: 1px;
    background: rgba(13, 33, 55, 0.12);
    margin: 18px 0 20px;
}

#loginScreen .enterprise-login-form {
    display: block;
}

#loginScreen .enterprise-login-field {
    margin-bottom: 14px;
}

#loginScreen .enterprise-login-field:last-of-type {
    margin-bottom: 0;
}

#registrationScreen .enterprise-register-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

#registrationScreen .enterprise-register-form-grid .full-width {
    grid-column: 1 / -1;
}

#loginScreen .enterprise-login-field-label,
#registrationScreen .enterprise-login-field-label {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0d2137;
    margin-bottom: 5px;
}

#loginScreen .enterprise-login-field-hint,
#registrationScreen .enterprise-login-field-hint {
    font-size: 12px;
    color: #5a7080;
    margin-bottom: 6px;
    line-height: 1.4;
}

#loginScreen .enterprise-login-input-wrap,
#registrationScreen .enterprise-login-input-wrap {
    position: relative;
}

#loginScreen .enterprise-login-field-input,
#registrationScreen .enterprise-login-field-input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 16px;
    border: 1px solid rgba(13, 33, 55, 0.14);
    border-radius: 10px;
    font-size: 15px;
    color: #0d2137;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    letter-spacing: 0.2px;
}

#registrationScreen .enterprise-login-field-input {
    padding-right: 16px;
}

#loginScreen .enterprise-login-field-input::placeholder,
#registrationScreen .enterprise-login-field-input::placeholder {
    color: rgba(90, 112, 128, 0.45);
    font-size: 14px;
}

#loginScreen .enterprise-login-field-input:focus,
#registrationScreen .enterprise-login-field-input:focus {
    border-color: #1a6b7c;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(26, 107, 124, 0.08);
}

#loginScreen .enterprise-login-pin-input {
    letter-spacing: 3px;
    font-size: 18px;
    font-weight: 600;
}

#loginScreen .enterprise-login-pin-input::placeholder {
    letter-spacing: 1px;
    font-size: 14px;
    font-weight: 400;
}

#registrationScreen .enterprise-login-pin-input {
    letter-spacing: 1px;
    font-size: 15px;
    font-weight: 500;
}

#loginScreen .enterprise-login-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #5a7080;
    opacity: 0.45;
    pointer-events: none;
    display: inline-flex;
}

#loginScreen .enterprise-login-toggle-pin {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #5a7080;
    opacity: 0.5;
    transition: opacity 0.2s;
}

#loginScreen .enterprise-login-toggle-pin:hover {
    opacity: 0.9;
}

#loginScreen .enterprise-login-cta,
#registrationScreen .enterprise-login-cta {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: #0d2137;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

#loginScreen .enterprise-login-cta:hover,
#registrationScreen .enterprise-login-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 33, 55, 0.22);
}

#loginScreen .enterprise-login-cta[disabled] {
    cursor: wait;
}

#loginScreen .enterprise-login-error {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.45;
    color: #c62828;
}

#loginScreen .enterprise-login-links {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

#loginScreen .enterprise-login-link {
    font-size: 13px;
    color: #1a6b7c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

#loginScreen .enterprise-login-link:hover {
    color: #0d2137;
}

#loginScreen .enterprise-login-link-muted {
    color: #5a7080;
    font-weight: 400;
}

#loginScreen .enterprise-login-link-muted strong {
    color: #0d2137;
    font-weight: 600;
}

#registrationScreen .enterprise-register-section {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding-top: 12px;
    border-top: 1px solid rgba(13, 33, 55, 0.12);
}

#registrationScreen .enterprise-register-form-grid .enterprise-register-section:first-child {
    padding-top: 0;
    border-top: none;
}

#registrationScreen .enterprise-register-section span {
    font-size: 14px;
    font-weight: 700;
    color: #0d2137;
    line-height: 1.3;
}

#registrationScreen .enterprise-register-section p {
    font-size: 12.5px;
    color: #5a7080;
    line-height: 1.5;
    max-width: 42ch;
}

#registrationScreen .enterprise-register-error {
    margin-top: 2px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(185, 28, 28, 0.18);
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.45;
}

#registrationScreen .enterprise-register-success {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(21, 128, 61, 0.18);
    background: #f0fdf4;
    color: #166534;
    font-size: 12px;
    line-height: 1.45;
}

#registrationScreen .enterprise-register-result {
    padding: 18px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f7f4ef 0%, #ffffff 100%);
    border: 1px solid rgba(201, 147, 58, 0.22);
}

#registrationScreen .enterprise-register-result-label {
    margin-bottom: 8px;
    color: #1a6b7c;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#registrationScreen .enterprise-register-result-caption {
    color: #5a7080;
    font-size: 13px;
    font-weight: 600;
}

#registrationScreen .enterprise-register-result-number {
    margin: 8px 0 10px;
    color: #0d2137;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
}

#registrationScreen .enterprise-register-result-helper {
    color: #5a7080;
    font-size: 12.5px;
    line-height: 1.5;
}

#registrationScreen .enterprise-register-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    text-align: center;
}

#registrationScreen .enterprise-register-footer p {
    font-size: 12.5px;
    color: #5a7080;
}

#registrationScreen .enterprise-register-footer a {
    color: #0d2137;
    font-weight: 600;
    text-decoration: none;
}

#registrationScreen .enterprise-register-footer a:hover {
    color: #1a6b7c;
}

#registrationScreen .enterprise-register-footer-note {
    font-size: 12px;
}

@media (max-width: 1080px) {
    #loginScreen .enterprise-login-layout,
    #registrationScreen .enterprise-register-layout {
        grid-template-columns: minmax(290px, 0.86fr) minmax(0, 1fr);
    }

    #loginScreen .enterprise-login-left,
    #registrationScreen .enterprise-register-left {
        padding: 32px 26px;
        gap: 22px;
    }

    #loginScreen .enterprise-login-brand-logo,
    #registrationScreen .enterprise-login-brand-logo {
        width: clamp(148px, 16vw, 188px);
    }

    #loginScreen .enterprise-login-headline,
    #registrationScreen .enterprise-login-headline {
        font-size: clamp(26px, 2.6vw, 34px);
    }

    #loginScreen .enterprise-login-form-area,
    #registrationScreen .enterprise-register-form-area {
        padding: 22px 22px;
    }

    #loginScreen .enterprise-login-desc,
    #registrationScreen .enterprise-login-desc {
        margin-bottom: 14px;
    }

    #registrationScreen .enterprise-register-side-notes {
        gap: 0;
    }
}

@media (max-width: 900px) {
    #loginScreen .enterprise-login-layout,
    #registrationScreen .enterprise-register-layout {
        grid-template-columns: 1fr;
    }

    #loginScreen .enterprise-login-left,
    #registrationScreen .enterprise-register-left {
        display: none;
    }

    #loginScreen .enterprise-login-form-area,
    #registrationScreen .enterprise-register-form-area {
        padding: 32px 28px;
    }
}

@media (max-width: 640px) {
    #loginScreen .enterprise-login-form-area,
    #registrationScreen .enterprise-register-form-area {
        padding: 24px 18px;
    }

    #loginScreen .enterprise-login-form-header {
        margin-bottom: 26px;
    }

    #loginScreen .enterprise-login-form-title,
    #registrationScreen .enterprise-login-form-title {
        font-size: 30px;
    }

    #loginScreen .enterprise-login-divider,
    #registrationScreen .enterprise-login-divider {
        margin: 22px 0;
    }

    #registrationScreen .enterprise-register-form-grid {
        grid-template-columns: 1fr;
    }

    #registrationScreen .enterprise-register-section {
        grid-template-columns: 1fr;
        gap: 6px;
        padding-top: 14px;
    }

    #registrationScreen .enterprise-register-result-number {
        font-size: 28px;
    }

    #loginScreen .enterprise-login-links {
        flex-direction: column;
        align-items: flex-start;
    }

    #registrationScreen .enterprise-register-result {
        padding: 16px;
    }
}

.section-subtitle {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.menu-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.menu-status-badge.active {
    background: rgba(16, 185, 129, 0.14);
    color: #0f8a63;
}

.menu-status-badge.inactive {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-secondary);
}

.menu-recipe-section {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.menu-recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.menu-recipe-header h3 {
    margin: 0 0 6px;
}

.menu-recipe-rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.menu-recipe-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
}

.menu-recipe-row-action {
    min-width: 110px;
}

@media (max-width: 768px) {
    .menu-recipe-header,
    .menu-recipe-row {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
}
