/* ==========================================================================
   OmniBiz ERP & POS - Professional Human-Crafted Design System
   Color Palette: Deep Royal Blue, Sky Light Blue, Emerald Green, Light Green
   ========================================================================== */

:root {
    /* Primary Colors - Blue & Sky Blue */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-dark: #1e3a8a;
    --primary-light: #eff6ff;
    
    --sky: #0ea5e9;
    --sky-hover: #0284c7;
    --sky-light: #f0f9ff;
    --sky-border: #bae6fd;

    /* Accent & Action Colors - Green & Light Green */
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-dark: #047857;
    --accent-light: #ecfdf5;
    --accent-border: #a7f3d0;
    --accent-text: #065f46;

    /* Status Colors */
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    --info: #3b82f6;
    --info-light: #eff6ff;

    /* Neutral & Background Tones */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-header: #ffffff;

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --shadow-blue: 0 4px 14px 0 rgba(37, 99, 235, 0.25);
    --shadow-green: 0 4px 14px 0 rgba(16, 185, 129, 0.25);

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & General Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

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

/* Sidebar Navigation - Fixed Left Drawer */
.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    background-color: var(--bg-sidebar);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--sky) 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: var(--shadow-blue);
}

.brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.725rem;
    color: var(--sky);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.sidebar-nav {
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    font-weight: 700;
    padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: var(--transition);
}

.nav-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-item:hover i {
    color: var(--sky);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.25) 0%, rgba(14, 165, 233, 0.15) 100%);
    border-left: 3.5px solid var(--sky);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--sky);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, #34d399 100%);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.user-role {
    font-size: 0.725rem;
    color: var(--sky);
}

/* Main Content Wrapper - Shifted for Fixed Sidebar */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 260px;
    max-width: calc(100vw - 260px);
    box-sizing: border-box;
}

/* Top Header Bar - Fixed Sticky Top */
/* Top Header Bar - Fixed Sticky Top */
.top-header {
    height: 60px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 90;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex-shrink: 1;
    flex-wrap: nowrap;
}

.business-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--sky-light);
    border: 1px solid var(--sky-border);
    color: var(--sky-hover);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 0;
    max-width: none;
    flex-shrink: 0;
}

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

.business-name-text {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-block;
    letter-spacing: -0.01em;
}

.business-type-tag {
    background-color: var(--accent-light);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
    padding: 0.12rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 1;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-clock-widget {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 0 12px;
    border-radius: 9999px;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
    font-size: 0.775rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    flex-shrink: 0;
}

.clock-live-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #10b981;
    flex-shrink: 0;
}

.clock-loc-tag {
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.2px;
}

.clock-date-text {
    font-weight: 600;
    color: #334155;
}

.clock-time-text {
    font-family: 'Plus Jakarta Sans', monospace, sans-serif;
    font-size: 0.86rem;
    font-weight: 800;
    color: #0284c7;
    letter-spacing: 0.3px;
}

.clock-sep-dot {
    color: #cbd5e1;
    font-size: 0.7rem;
}

.clock-sep-bar {
    color: #94a3b8;
    font-weight: 300;
    margin: 0 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.btn-badge-mobile {
    display: none;
}

.btn-header-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    color: var(--text-primary);
    white-space: nowrap;
}

.btn-header-action:hover {
    background-color: var(--bg-main);
    border-color: var(--sky);
    color: var(--primary);
}

/* Main Body Container */
.content-container {
    padding: 1.75rem;
    flex-grow: 1;
}

.page-title-block {
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Metric Cards & KPI Grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

@media (min-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary);
    border-radius: 4px 0 0 4px;
}

.stat-card.stat-green::before {
    background-color: var(--accent);
}

.stat-card.stat-sky::before {
    background-color: var(--sky);
}

.stat-card.stat-blue::before {
    background-color: var(--primary);
}

.stat-card.stat-amber::before {
    background-color: var(--warning);
}

.stat-card.stat-purple::before {
    background-color: #8b5cf6;
}

.stat-card.stat-teal::before {
    background-color: #0d9488;
}

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

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stat-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

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

.icon-sky {
    background-color: var(--sky-light);
    color: var(--sky);
}

.icon-green {
    background-color: var(--accent-light);
    color: var(--accent);
}

.icon-amber {
    background-color: var(--warning-light);
    color: var(--warning);
}

.icon-purple {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.icon-teal {
    background-color: #ccfbf1;
    color: #0d9488;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-footer {
    margin-top: 0.5rem;
    font-size: 0.775rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.trend-up {
    color: var(--accent);
    font-weight: 700;
}

/* UI Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

/* Dashboard Main Grid Layout */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.dashboard-shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.dashboard-shortcuts-list .btn {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    justify-content: flex-start;
    gap: 0.6rem;
}

.dashboard-shortcuts-list .btn i {
    width: 22px;
    font-size: 0.95rem;
    text-align: center;
}

.card-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
}

/* Table Styles */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.8875rem;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-green {
    background-color: var(--accent-light);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
}

.badge-sky {
    background-color: var(--sky-light);
    color: var(--sky-hover);
    border: 1px solid var(--sky-border);
}

.badge-blue {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid #bfdbfe;
}

.badge-amber {
    background-color: var(--warning-light);
    color: #92400e;
    border: 1px solid var(--warning-border);
}

.badge-red {
    background-color: var(--danger-light);
    color: #991b1b;
    border: 1px solid var(--danger-border);
}

/* Button Component Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-green {
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-green);
}

.btn-green:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-sky {
    background-color: var(--sky);
    color: #ffffff;
}

.btn-sky:hover {
    background-color: var(--sky-hover);
    transform: translateY(-1px);
}

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

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

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
}

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

.form-label {
    display: block;
    font-size: 0.8375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.8875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.form-select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.8875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: #ffffff;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

/* Alerts */
.alert {
    padding: 0.9rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: var(--accent-light);
    color: var(--accent-text);
    border: 1px solid var(--accent-border);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border: 1px solid var(--danger-border);
}

.alert-info {
    background-color: var(--sky-light);
    color: var(--sky-hover);
    border: 1px solid var(--sky-border);
}

/* Modal Popup */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-main);
}

/* Mobile Drawer Navigation Components */
.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

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

.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    margin-left: auto;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Table Wrapper with Touch Momentum & Indicators */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Card & Title Blocks Responsive */
.page-title-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Global Responsive Breakpoints */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
}

/* Top Header 3-Line Menu Toggle Button */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    color: #334155;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Desktop Icon-Only Collapsed Sidebar & Hover Expansion */
@media (min-width: 993px) {
    .sidebar {
        transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease !important;
    }

    .main-wrapper {
        transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .lubpos-fixed-ticker-footer {
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Collapsed Sidebar State (Icon-Only Mode) */
    body.sidebar-collapsed .sidebar {
        width: 70px !important;
        overflow-x: hidden;
    }

    body.sidebar-collapsed .sidebar .sidebar-header {
        padding: 1.25rem 0.5rem;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar .brand-text,
    body.sidebar-collapsed .sidebar .brand-subtitle,
    body.sidebar-collapsed .sidebar .nav-section-title,
    body.sidebar-collapsed .sidebar .user-info,
    body.sidebar-collapsed .sidebar .sidebar-close-btn {
        display: none !important;
        opacity: 0;
    }

    body.sidebar-collapsed .sidebar .nav-item {
        justify-content: center;
        padding: 0.75rem 0.5rem;
        gap: 0;
        border-left: none !important;
    }

    body.sidebar-collapsed .sidebar .nav-item span {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar .nav-item i {
        font-size: 1.25rem;
        width: auto;
        margin: 0;
    }

    body.sidebar-collapsed .sidebar .badge-expiry-count {
        position: absolute;
        top: 4px;
        right: 4px;
        margin-left: 0 !important;
    }

    body.sidebar-collapsed .sidebar .sidebar-footer {
        padding: 0.85rem 0.5rem;
        justify-content: center;
        gap: 0.5rem;
    }

    body.sidebar-collapsed .sidebar .user-profile-summary {
        justify-content: center;
    }

    body.sidebar-collapsed .main-wrapper {
        margin-left: 70px !important;
        max-width: calc(100vw - 70px) !important;
    }

    body.sidebar-collapsed .lubpos-fixed-ticker-footer {
        left: 70px !important;
    }

    /* Hover Expansion on Collapsed Sidebar */
    body.sidebar-collapsed .sidebar:hover {
        width: 260px !important;
        z-index: 1000;
        box-shadow: 8px 0 30px rgba(0, 0, 0, 0.45);
    }

    body.sidebar-collapsed .sidebar:hover .sidebar-header {
        padding: 1.5rem 1.25rem;
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar:hover .brand-text,
    body.sidebar-collapsed .sidebar:hover .brand-subtitle,
    body.sidebar-collapsed .sidebar:hover .nav-section-title,
    body.sidebar-collapsed .sidebar:hover .user-info {
        display: block !important;
        opacity: 1;
    }

    body.sidebar-collapsed .sidebar:hover .nav-item {
        justify-content: flex-start;
        padding: 0.7rem 0.85rem;
        gap: 0.75rem;
    }

    body.sidebar-collapsed .sidebar:hover .nav-item span {
        display: inline !important;
    }

    body.sidebar-collapsed .sidebar:hover .nav-item i {
        font-size: 1.1rem;
        width: 22px;
    }

    body.sidebar-collapsed .sidebar:hover .badge-expiry-count {
        position: static;
        margin-left: auto !important;
    }

    body.sidebar-collapsed .sidebar:hover .sidebar-footer {
        padding: 1rem 1.25rem;
        justify-content: space-between;
    }
}

@media (max-width: 992px) {
    .sidebar-toggle-btn {
        display: inline-flex;
    }

    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 270px;
        z-index: 9999;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open {
        left: 0;
    }

    .main-wrapper {
        margin-left: 0 !important;
        max-width: 100vw !important;
        width: 100% !important;
    }

    .top-header {
        padding: 0 1rem;
    }

    .content-container {
        padding: 1.25rem 1rem 4rem 1rem;
    }

    .lubpos-fixed-ticker-footer {
        left: 0 !important;
    }

    /* Collapse 2-column sidebar layouts (permissions, stock history, etc.) */
    .two-col-layout,
    div[style*="grid-template-columns: 360px 1fr"],
    div[style*="grid-template-columns: 320px 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 992px) {
    .top-header {
        padding: 0 1rem;
        height: 56px;
    }
    .clock-loc-tag {
        display: none !important;
    }
    .business-type-tag {
        display: none !important;
    }

    /* Dashboard Layout on Tablet & Mobile: Full-width Recent Sales & Compact Shortcuts */
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .dashboard-sales-card {
        width: 100% !important;
    }

    .dashboard-shortcuts-list {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }

    .dashboard-shortcuts-list .btn {
        padding: 0.48rem 0.65rem !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        gap: 0.4rem !important;
        justify-content: flex-start !important;
    }

    .dashboard-shortcuts-list .btn i {
        width: auto !important;
        font-size: 0.85rem !important;
    }
}

@media (max-width: 768px) {
    .top-header {
        height: 54px;
        padding: 0 0.75rem;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
    }

    .header-left {
        gap: 0.45rem;
        min-width: 0;
        flex-wrap: nowrap !important;
    }

    .sidebar-toggle-btn {
        width: 36px;
        height: 36px;
        font-size: 1.05rem;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
    }

    .business-badge {
        max-width: 150px;
        padding: 0.22rem 0.55rem;
        font-size: 0.75rem;
        gap: 0.35rem;
    }

    .header-clock-widget {
        height: 28px;
        padding: 0 7px;
        gap: 4px;
        font-size: 0.72rem;
    }

    .clock-date-text,
    .clock-sep-dot,
    .clock-sep-bar {
        display: none !important;
    }

    .clock-time-text {
        font-size: 0.78rem;
    }

    .header-right {
        gap: 0.35rem;
        flex-wrap: nowrap !important;
    }

    .btn-text-responsive {
        display: none !important;
    }

    .btn-badge-mobile {
        display: inline-block;
        background: rgba(0,0,0,0.15);
        border-radius: 9999px;
        padding: 1px 5px;
        font-size: 0.7rem;
        font-weight: 800;
        margin-left: 2px;
    }

    .btn-header-action {
        padding: 0.38rem 0.65rem;
        font-size: 0.82rem;
    }

    .btn-quick-pos {
        padding: 0.38rem 0.7rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .page-subtitle {
        font-size: 0.78rem;
    }

    .content-container {
        padding: 0.85rem 0.75rem 4.5rem 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 0.85rem 1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-icon-wrapper {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    /* Auto-collapse inline form grids on tablets/phones */
    form[style*="grid-template-columns: 2fr 1fr 120px"],
    form[style*="grid-template-columns: 1fr 1fr 140px"],
    form[style*="grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) 120px"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1.2fr 1fr"],
    div[style*="grid-template-columns: 1.4fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .card-body {
        padding: 0.85rem;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 88vh;
        border-radius: var(--border-radius);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.85rem 1rem;
    }
}

@media (max-width: 480px) {
    .top-header {
        height: 52px;
        padding: 0 0.5rem;
        gap: 0.25rem;
    }

    .header-left {
        gap: 0.3rem;
    }

    .business-badge {
        max-width: 120px;
        padding: 0.18rem 0.45rem;
        font-size: 0.72rem;
    }

    .biz-logo-img {
        width: 18px;
        height: 18px;
    }

    .header-clock-widget {
        display: none !important; /* Conceal on <480px phone viewports to keep single-row header neat & ultra-organized */
    }

    .sidebar-toggle-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

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

    .btn-header-action {
        padding: 0.35rem 0.55rem;
    }

    .btn-quick-pos {
        padding: 0.35rem 0.6rem;
    }

    .btn-lg {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .card {
        border-radius: var(--border-radius-sm);
        margin-bottom: 0.85rem;
    }

    .dashboard-shortcuts-list {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.4rem !important;
    }

    .dashboard-shortcuts-list .btn {
        padding: 0.38rem 0.5rem !important;
        font-size: 0.74rem !important;
        border-radius: 7px !important;
        gap: 0.3rem !important;
    }

    .dashboard-shortcuts-list .btn i {
        font-size: 0.78rem !important;
    }

    .table th, .table td {
        padding: 0.55rem 0.65rem;
        font-size: 0.8rem;
    }
}

/* Professional Toast Notification System */
.toast-container {
    position: fixed;
    top: 60px;
    right: 12px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}

.toast {
    pointer-events: auto;
    min-width: 270px;
    max-width: 380px;
    background: #ffffff;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: all 0.3s ease;
}

.toast.toast-warning {
    border-left-color: var(--warning);
    background: #fffbeb;
}

.toast.toast-danger {
    border-left-color: var(--danger);
    background: #fef2f2;
}

.toast.toast-success {
    border-left-color: var(--accent);
    background: #ecfdf5;
}

.toast.toast-info {
    border-left-color: var(--sky);
    background: #f0f9ff;
}

.toast-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: #0f172a;
}

.toast-msg {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 0.1rem;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}
