@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Inter:ital,opsz,wght@0,14..32,300..800;1,14..32,400..700&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

/* ==========================================================================
   KVINA ORDERFOODS ENTERPRISE DESIGN SYSTEM (BOOTSTRAP 5.3)
   ========================================================================== */

:root, [data-bs-theme="light"] {
    --font-primary: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Native Bootstrap 5.3 Color Overrides */
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-primary-text-emphasis: #4338ca;
    --bs-primary-bg-subtle: #eef2ff;
    --bs-primary-border-subtle: #c7d2fe;

    --bs-success: #059669;
    --bs-success-rgb: 5, 150, 105;
    --bs-success-bg-subtle: #ecfdf5;
    --bs-success-border-subtle: #a7f3d0;

    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-warning-bg-subtle: #fffbeb;
    --bs-warning-border-subtle: #fde68a;

    --bs-danger: #dc2626;
    --bs-danger-rgb: 220, 38, 38;
    --bs-danger-bg-subtle: #fef2f2;
    --bs-danger-border-subtle: #fecaca;

    --bs-info: #0284c7;
    --bs-info-rgb: 2, 132, 199;
    --bs-info-bg-subtle: #e0f2fe;
    --bs-info-border-subtle: #bae6fd;

    --bs-body-font-family: var(--font-primary);
    --bs-body-font-size: 0.86rem;
    --bs-body-line-height: 1.48;
    --bs-body-bg: #f8fafc;
    --bs-body-color: #0f172a;
    --bs-secondary-color: #64748b;
    --bs-tertiary-color: #94a3b8;
    --bs-border-color: #e2e8f0;
    --bs-border-color-translucent: rgba(226, 232, 240, 0.8);
    --bs-card-bg: #ffffff;
    --bs-border-radius: 6px;
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: 8px;
    --bs-border-radius-xl: 10px;

    /* Custom Extended Tokens (Light Mode: Clean Slate / White) */
    --bg-sidebar: #ffffff;
    --bg-sidebar-hover: #f1f5f9;
    --bg-sidebar-active: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --border-sidebar: #e2e8f0;
    --text-sidebar: #475569;
    --text-sidebar-title: #94a3b8;
    --text-sidebar-brand: #0f172a;
    --text-sidebar-icon: #64748b;
    --sidebar-footer-bg: #f8fafc;

    --sidebar-width: 250px;
    --header-height: 56px;
    --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Native & Custom Harmonization */
[data-bs-theme="dark"], [data-theme="dark"] {
    --bs-body-bg: #080c14;
    --bs-body-color: #f1f5f9;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-color: #64748b;
    --bs-border-color: #1e293b;
    --bs-border-color-translucent: rgba(30, 41, 59, 0.8);
    --bs-card-bg: #0f172a;

    --bs-primary-bg-subtle: rgba(79, 70, 229, 0.15);
    --bs-success-bg-subtle: rgba(5, 150, 105, 0.15);
    --bs-warning-bg-subtle: rgba(217, 119, 6, 0.15);
    --bs-danger-bg-subtle: rgba(220, 38, 38, 0.15);
    --bs-info-bg-subtle: rgba(2, 132, 199, 0.15);

    /* Dark Mode Sidebar */
    --bg-sidebar: #0b1324;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    --border-sidebar: #1e293b;
    --text-sidebar: #94a3b8;
    --text-sidebar-title: #64748b;
    --text-sidebar-brand: #ffffff;
    --text-sidebar-icon: #94a3b8;
    --sidebar-footer-bg: rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--bs-body-font-family);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: var(--bs-body-font-size);
    line-height: var(--bs-body-line-height, 1.48);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'tnum';
    font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.012em;
    color: var(--bs-body-color);
    margin-bottom: 0.35rem;
    text-rendering: optimizeLegibility;
}

h1, .h1 { font-size: 1.25rem; }
h2, .h2 { font-size: 1.15rem; }
h3, .h3 { font-size: 1.05rem; }
h4, .h4 { font-size: 0.95rem; }
h5, .h5 { font-size: 0.88rem; }
h6, .h6 { font-size: 0.8rem; }

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

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

/* ==========================================================================
   UNIFIED BOOTSTRAP 5 INPUT GROUP FOCUS STATE & SEAMLESS INPUTS
   ========================================================================== */
.input-group {
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.input-group .input-group-text {
    background-color: var(--bs-body-bg);
    border-color: var(--bs-border-color);
    border-right: none !important;
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.input-group .form-control {
    border-color: var(--bs-border-color);
    border-left: none !important;
    transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.input-group:focus-within {
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.18);
    border-radius: 8px;
}

.input-group:focus-within .input-group-text,
.input-group:focus-within .form-control,
.input-group:focus-within .btn-outline-secondary {
    border-color: var(--bs-primary) !important;
}

.input-group:focus-within .input-group-text i {
    color: var(--bs-primary) !important;
    transition: color 0.2s ease;
}

.input-group .form-control:focus,
.input-group .btn-outline-secondary:focus {
    box-shadow: none !important;
    border-color: var(--bs-primary) !important;
}

/* ==========================================================================
   SEAMLESS INPUT CONTAINER (MODERN POS STANDARD)
   ========================================================================== */
.input-group-seamless {
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease-in-out;
    padding: 2px 4px;
}

[data-bs-theme="dark"] .input-group-seamless, [data-theme="dark"] .input-group-seamless {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}

.input-group-seamless:focus-within {
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3.5px rgba(79, 70, 229, 0.18) !important;
}

[data-bs-theme="dark"] .input-group-seamless:focus-within, [data-theme="dark"] .input-group-seamless:focus-within {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.25) !important;
}

.input-group-seamless .input-icon-left {
    background: transparent !important;
    border: none !important;
    color: #94a3b8;
    padding: 0.45rem 0.4rem 0.45rem 0.65rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.input-group-seamless:focus-within .input-icon-left i {
    color: #4f46e5 !important;
    transition: color 0.2s ease;
}

[data-bs-theme="dark"] .input-group-seamless:focus-within .input-icon-left i {
    color: #818cf8 !important;
}

.input-group-seamless .form-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
    color: #0f172a;
    width: 100%;
}

[data-bs-theme="dark"] .input-group-seamless .form-control, [data-theme="dark"] .input-group-seamless .form-control {
    color: #f8fafc !important;
}

.input-group-seamless .form-control::placeholder {
    color: #94a3b8;
}

[data-bs-theme="dark"] .input-group-seamless .form-control::placeholder {
    color: #64748b !important;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

.app-wrapper {
    display: flex;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

/* SIDEBAR */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-sidebar);
    transition: width var(--transition-base), transform var(--transition-base);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-sidebar);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-sidebar-brand);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #eab308 100%);
    border-radius: var(--bs-border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    box-shadow: 0 0 10px rgba(234, 88, 12, 0.4);
}

.brand-badge {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: var(--bs-border-radius-sm);
    background: rgba(234, 88, 12, 0.15);
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.3);
}

[data-bs-theme="dark"] .brand-badge,
[data-theme="dark"] .brand-badge {
    color: #fb923c;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

.sidebar-section-title {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-sidebar-title);
    margin: 12px 8px 4px 8px;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: var(--text-sidebar);
    border-radius: var(--bs-border-radius);
    font-size: 0.835rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    position: relative;
}

.nav-item-link i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    color: var(--text-sidebar-icon);
    transition: color var(--transition-fast);
}

.nav-item-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--bs-primary);
}

.nav-item-link:hover i {
    color: var(--bs-primary);
}

.nav-item-link.active {
    background: var(--bg-sidebar-active);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
}

.nav-item-link.active i {
    color: #ffffff !important;
}

.sidebar-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-sidebar);
    background: var(--sidebar-footer-bg);
}

.user-quick-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--bs-border-radius);
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
}

.user-info-text h6 {
    font-size: 0.8rem;
    color: var(--text-sidebar-brand);
    margin: 0;
    line-height: 1.2;
}

.user-info-text span {
    font-size: 0.7rem;
    color: var(--text-sidebar-title);
}

.btn-logout {
    color: var(--text-sidebar-icon) !important;
    transition: color var(--transition-fast);
}

.btn-logout:hover {
    color: var(--bs-danger) !important;
}

/* MAIN CONTENT WRAPPER */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--transition-base), width var(--transition-base);
}

/* TOPBAR (GLOBAL UTILITY HEADER) */
.app-topbar {
    height: var(--header-height);
    background: var(--bs-card-bg);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    gap: 16px;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-breadcrumb {
    font-size: 0.76rem;
    color: var(--bs-secondary-color);
}

.topbar-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--bs-tertiary-color);
    padding: 0 6px;
}

.topbar-search {
    position: relative;
    width: 300px;
}

.topbar-search input {
    width: 100%;
    height: 34px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    padding: 0 36px 0 32px;
    font-size: 0.8rem;
    color: var(--bs-body-color);
    outline: none;
    transition: all var(--transition-fast);
}

.topbar-search input:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
    background: var(--bs-card-bg);
}

.topbar-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-tertiary-color);
    font-size: 0.85rem;
}

.topbar-search .search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bs-border-color);
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: var(--bs-border-radius-sm);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
    border: 1px solid var(--bs-success-border-subtle);
    padding: 4px 10px;
    border-radius: var(--bs-border-radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--bs-success);
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background-color: rgba(5, 150, 105, 0.35);
    animation: pulse 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(0.9); opacity: 0; }
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.icon-btn:hover {
    background: var(--bs-card-bg);
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--bs-danger);
    border-radius: 50%;
    border: 1.5px solid var(--bs-card-bg);
}

/* ==========================================================================
   PAGE CONTAINER & PAGE HEADER COMPONENT (Tabler / Metronic 9 Standard)
   ========================================================================== */
.page-container {
    padding: 18px 20px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.page-pretitle {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    margin-bottom: 2px;
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--bs-body-color);
    line-height: 1.2;
    margin: 0 0 3px 0;
    letter-spacing: -0.015em;
}

.page-subtitle {
    font-size: 0.78rem;
    color: var(--bs-secondary-color);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Standardized Card */
.card, .dash-card {
    background-color: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    padding: 16px 18px;
    margin-bottom: 16px;
    transition: border-color var(--transition-fast);
}

.card-header, .dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 0 12px 0;
    margin-bottom: 14px;
}

.card-title, .dash-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ==========================================================================
   AVATARS & BADGES (ENTERPRISE STANDARD)
   ========================================================================== */
.avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    border-radius: var(--bs-border-radius);
    text-align: center;
    letter-spacing: -0.01em;
    user-select: none;
    transition: all var(--transition-fast);
}

.avatar-xs {
    width: 22px;
    height: 22px;
    font-size: 0.65rem;
    border-radius: var(--bs-border-radius-sm);
}

.avatar-sm {
    width: auto !important;
    min-width: 34px;
    height: 30px;
    padding: 0 8px;
    font-size: 0.78rem;
    border-radius: var(--bs-border-radius-sm);
    white-space: nowrap;
}

.table-code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 38px;
    height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--bs-border-radius);
    white-space: nowrap;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
}

.avatar-md {
    width: 42px;
    height: 42px;
    font-size: 1rem;
    border-radius: var(--bs-border-radius);
}

.avatar-lg {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
    border-radius: var(--bs-border-radius-lg);
}

.avatar-xl {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    border-radius: var(--bs-border-radius-xl);
}

/* Soft Badges */
.badge-soft-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); border: 1px solid var(--bs-primary-border-subtle); }
.badge-soft-success { background: var(--bs-success-bg-subtle); color: var(--bs-success); border: 1px solid var(--bs-success-border-subtle); }
.badge-soft-warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning); border: 1px solid var(--bs-warning-border-subtle); }
.badge-soft-danger { background: var(--bs-danger-bg-subtle); color: var(--bs-danger); border: 1px solid var(--bs-danger-border-subtle); }
.badge-soft-info { background: var(--bs-info-bg-subtle); color: var(--bs-info); border: 1px solid var(--bs-info-border-subtle); }

/* Standardized Action Button Icons (Tabler / Metronic Enterprise Standard) */
.action-btn-sm, .btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 0.85rem;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-card-bg);
    color: var(--bs-secondary-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.action-btn-sm:hover, .btn-icon-sm:hover {
    background-color: var(--bg-sidebar-hover);
    border-color: var(--bs-border-color-translucent);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.action-btn-sm.text-danger, .btn-icon-danger {
    color: var(--bs-danger) !important;
    border-color: var(--bs-danger-border-subtle);
    background-color: var(--bs-danger-bg-subtle);
}
.action-btn-sm.text-danger:hover, .btn-icon-danger:hover {
    background-color: var(--bs-danger) !important;
    color: #ffffff !important;
    border-color: var(--bs-danger) !important;
}

.action-btn-sm.text-primary, .btn-icon-primary {
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary-border-subtle);
    background-color: var(--bs-primary-bg-subtle);
}
.action-btn-sm.text-primary:hover, .btn-icon-primary:hover {
    background-color: var(--bs-primary) !important;
    color: #ffffff !important;
    border-color: var(--bs-primary) !important;
}

.action-btn-sm.text-success, .btn-icon-success {
    color: var(--bs-success) !important;
    border-color: var(--bs-success-border-subtle);
    background-color: var(--bs-success-bg-subtle);
}
.action-btn-sm.text-success:hover, .btn-icon-success:hover {
    background-color: var(--bs-success) !important;
    color: #ffffff !important;
    border-color: var(--bs-success) !important;
}

/* Fractional Spacing Utilities */
.p-0\.5, .p-0-5 { padding: 0.18rem !important; }
.p-1\.5, .p-1-5 { padding: 0.38rem !important; }
.p-2\.5, .p-2-5 { padding: 0.65rem !important; }
.px-1\.5, .px-1-5 { padding-left: 0.38rem !important; padding-right: 0.38rem !important; }
.px-2\.5, .px-2-5 { padding-left: 0.65rem !important; padding-right: 0.65rem !important; }
.py-0\.5, .py-0-5 { padding-top: 0.18rem !important; padding-bottom: 0.18rem !important; }
.py-1\.5, .py-1-5 { padding-top: 0.38rem !important; padding-bottom: 0.38rem !important; }
.py-2\.5, .py-2-5 { padding-top: 0.65rem !important; padding-bottom: 0.65rem !important; }
.gap-1\.5, .gap-1-5 { gap: 0.38rem !important; }
.gap-2\.5, .gap-2-5 { gap: 0.65rem !important; }
.g-2\.5, .g-2-5 { --bs-gutter-x: 0.65rem; --bs-gutter-y: 0.65rem; }
.mb-2\.5, .mb-2-5 { margin-bottom: 0.65rem !important; }
.mt-2\.5, .mt-2-5 { margin-top: 0.65rem !important; }
.my-0\.5, .my-0-5 { margin-top: 0.18rem !important; margin-bottom: 0.18rem !important; }
.my-1\.5, .my-1-5 { margin-top: 0.38rem !important; margin-bottom: 0.38rem !important; }
.my-2\.5, .my-2-5 { margin-top: 0.65rem !important; margin-bottom: 0.65rem !important; }

.text-purple { color: #9333ea !important; }
.bg-purple-subtle { background-color: rgba(147, 51, 234, 0.12) !important; }

/* Standardized Surface & Background Tokens (Cross-Bootstrap Standard) */
.bg-body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}
.bg-card, .bg-surface {
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color) !important;
}
.bg-subtle-box {
    background-color: var(--bs-primary-bg-subtle) !important;
}
.bg-muted-box, .table-modal-summary-box, .summary-detail-box {
    background-color: var(--bs-body-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}

/* Modals & Dialogs (Explicit Standard Styling) */
.modal-content {
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color) !important;
    border: 1px solid var(--bs-border-color) !important;
}
.modal-header {
    background-color: var(--bs-card-bg) !important;
    border-bottom: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}
.modal-footer {
    background-color: var(--bs-card-bg) !important;
    border-top: 1px solid var(--bs-border-color) !important;
    color: var(--bs-body-color) !important;
}
.modal-body {
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color) !important;
}

/* ==========================================================================
   SMART HYBRID SELECTOR PILLS (Shared across POS DineIn & Floor Map)
   ========================================================================== */
.cat-filter-btn,
.area-pill-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 50rem !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    transition: all 0.15s ease !important;
}

.cat-filter-btn.active,
.area-pill-btn.active {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25) !important;
}

#categoryTabs,
#areaTabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

#categoryTabs::-webkit-scrollbar,
#areaTabs::-webkit-scrollbar {
    display: none;
}

/* ==========================================================================
   F&B TABLE MAP CARDS (Interactive Floor Map Styles)
   ========================================================================== */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

@media (max-width: 767.98px) {
    .table-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 575.98px) {
    .table-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

.table-card {
    background: var(--bs-card-bg);
    border: 1.5px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    padding: 12px 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 142px;
    height: 100%;
}

.table-card.d-none {
    display: none !important;
}

.table-number {
    white-space: nowrap !important;
    letter-spacing: -0.01em;
}

.table-status-badge {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.table-capacity {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.table-order-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    margin: 4px 0;
}

@media (max-width: 575.98px) {
    .table-card {
        padding: 12px 14px !important;
        min-height: auto !important;
    }
    .table-order-info {
        min-height: auto !important;
        margin: 4px 0 !important;
    }
}

.table-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Status variants */
.table-card.table-empty {
    border-color: #cbd5e1;
}
.table-card.table-empty .table-status-badge {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success);
    border: 1px solid var(--bs-success-border-subtle);
}

.table-card.table-occupied {
    border-color: var(--bs-primary);
    background: linear-gradient(180deg, var(--bs-primary-bg-subtle) 0%, var(--bs-card-bg) 60%);
}
.table-card.table-occupied .table-status-badge {
    background: var(--bs-primary);
    color: #ffffff;
}

.table-card.table-billing {
    border-color: #a855f7;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.08) 0%, var(--bs-card-bg) 60%);
}

.table-card-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.table-number {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--bs-body-color);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.table-capacity {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

.table-order-info {
    margin: 6px 0;
}

.table-amount {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--bs-primary);
}

.table-time {
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
}

/* ==========================================================================
   MENU ITEM PRODUCT CARDS
   ========================================================================== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.menu-card {
    background: var(--bs-card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    transition: all 0.15s ease-in-out;
    display: flex;
    flex-direction: column;
}

.menu-card:hover {
    transform: translateY(-2px);
    border-color: var(--bs-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.menu-card-img-wrap {
    height: 120px;
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ea580c;
    position: relative;
}

.menu-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.25;
}

.menu-card-price {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    color: var(--bs-primary);
}

/* ==========================================================================
   BADGES, AVATARS & TABLES
   ========================================================================== */
.badge-soft-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); border: 1px solid var(--bs-primary-border-subtle); }
.badge-soft-success { background: var(--bs-success-bg-subtle); color: var(--bs-success); border: 1px solid var(--bs-success-border-subtle); }
.badge-soft-warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning); border: 1px solid var(--bs-warning-border-subtle); }
.badge-soft-danger  { background: var(--bs-danger-bg-subtle);  color: var(--bs-danger);  border: 1px solid var(--bs-danger-border-subtle); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-success { background-color: var(--bs-success); }
.dot-warning { background-color: var(--bs-warning); }
.dot-danger  { background-color: var(--bs-danger); }
.dot-primary { background-color: var(--bs-primary); }

.table th, .custom-table th {
    background: var(--bs-body-bg);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
    padding: 8px 12px;
    border-bottom: 1px solid var(--bs-border-color);
}

.table td, .custom-table td {
    padding: 9px 12px;
    font-size: 0.835rem;
    color: var(--bs-body-color);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    vertical-align: middle;
}

.form-control, .form-select {
    font-size: 0.835rem !important;
    padding: 6px 12px !important;
    border-radius: var(--bs-border-radius) !important;
    border-color: var(--bs-border-color) !important;
    background-color: var(--bs-card-bg) !important;
    color: var(--bs-body-color) !important;
}

.btn {
    font-size: 0.835rem !important;
    padding: 6px 14px !important;
    border-radius: var(--bs-border-radius) !important;
    font-weight: 600 !important;
}

.btn-sm {
    font-size: 0.76rem !important;
    padding: 3px 9px !important;
}

.app-footer {
    padding: 12px 20px;
    background: var(--bs-card-bg);
    border-top: 1px solid var(--bs-border-color);
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   RESPONSIVE & DESKTOP MINI SIDEBAR
   ========================================================================== */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 19, 36, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        width: 260px;
        z-index: 1050;
    }
    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .app-topbar {
        padding: 0 12px;
    }
    .topbar-search {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        padding: 0 8px !important;
    }
    .topbar-right {
        gap: 4px !important;
    }
    .topbar-left {
        gap: 4px !important;
    }
    .icon-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.95rem !important;
    }
    .app-content {
        padding: 12px 10px !important;
    }
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }
    .page-title {
        font-size: 1.15rem !important;
    }
    .page-subtitle {
        font-size: 0.75rem !important;
    }
    .page-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .page-actions .btn {
        flex: 1 1 auto !important;
        text-align: center !important;
        justify-content: center !important;
    }
    .custom-table th, .custom-table td {
        white-space: nowrap !important;
        padding: 8px 10px !important;
    }
}

@media (min-width: 992px) {
    html.sidebar-is-collapsed .app-sidebar {
        width: 64px !important;
    }
    html.sidebar-is-collapsed .app-sidebar .brand-logo div,
    html.sidebar-is-collapsed .app-sidebar .brand-badge,
    html.sidebar-is-collapsed .app-sidebar .sidebar-section-title,
    html.sidebar-is-collapsed .app-sidebar .nav-item-link span,
    html.sidebar-is-collapsed .app-sidebar .nav-badge,
    html.sidebar-is-collapsed .app-sidebar .user-info-text,
    html.sidebar-is-collapsed .app-sidebar .btn-logout {
        display: none !important;
    }
    html.sidebar-is-collapsed .app-sidebar .sidebar-header {
        padding: 0 12px;
        justify-content: center;
    }
    html.sidebar-is-collapsed .app-sidebar .nav-item-link {
        justify-content: center;
        padding: 9px 0;
        gap: 0;
        position: relative;
    }
    html.sidebar-is-collapsed .app-sidebar .nav-item-link i {
        font-size: 1.15rem;
        width: auto;
    }
    html.sidebar-is-collapsed .app-sidebar .sidebar-footer {
        padding: 8px 4px;
        justify-content: center;
    }
    html.sidebar-is-collapsed .app-sidebar .user-quick-profile {
        justify-content: center;
    }
    html.sidebar-is-collapsed .app-main {
        margin-left: 64px !important;
        width: calc(100vw - 64px) !important;
    }
    /* Tooltips */
    html.sidebar-is-collapsed .nav-item-link::after {
        content: attr(data-title);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%) translateX(-4px);
        background: #0f172a;
        color: #ffffff;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 5px 10px;
        border-radius: var(--bs-border-radius-sm);
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.15s ease;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.12);
        z-index: 1200;
    }
    html.sidebar-is-collapsed .nav-item-link:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }
}

/* ==========================================================================
   GLOBAL HIGH-CONTRAST BADGE & PILL DESIGN SYSTEM (WCAG AAA STANDARD)
   Guarantees 100% sharp text contrast across ALL subtle and soft badges
   ========================================================================== */

.badge {
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* 1. Primary / Indigo Soft (Royal Blue Contrast) */
.badge.bg-primary-subtle,
.badge-soft-primary,
.badge.text-primary {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
}

/* 2. Warning / Amber Soft (Deep Amber Contrast) */
.badge.bg-warning-subtle,
.badge-soft-warning,
.badge.text-warning,
.badge.text-warning-emphasis {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fcd34d !important;
}

/* 3. Success / Emerald Soft (Deep Green Contrast) */
.badge.bg-success-subtle,
.badge-soft-success,
.badge.text-success,
.badge.text-success-emphasis {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #bbf7d0 !important;
}

/* 4. Danger / Red Soft (Deep Maroon Contrast) */
.badge.bg-danger-subtle,
.badge-soft-danger,
.badge.text-danger,
.badge.text-danger-emphasis {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

/* 5. Info / Sky Blue Soft */
.badge.bg-info-subtle,
.badge-soft-info,
.badge.text-info,
.badge.text-info-emphasis {
    background-color: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
}

/* 6. Secondary / Slate Soft (Dark Slate Contrast) */
.badge.bg-secondary-subtle,
.badge-soft-secondary,
.badge.text-secondary,
.badge.text-secondary-emphasis {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}

/* 7. Solid Badges */
.badge.bg-primary {
    background-color: #4f46e5 !important;
    color: #ffffff !important;
}
.badge.bg-success {
    background-color: #16a34a !important;
    color: #ffffff !important;
}
.badge.bg-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}
.badge.bg-warning {
    background-color: #f59e0b !important;
    color: #78350f !important;
}
.badge.bg-dark {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

/* 8. Dark Theme Support */
[data-bs-theme="dark"] .badge.bg-primary-subtle,
[data-bs-theme="dark"] .badge-soft-primary {
    background-color: rgba(79, 70, 229, 0.2) !important;
    color: #a5b4fc !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
}
[data-bs-theme="dark"] .badge.bg-warning-subtle,
[data-bs-theme="dark"] .badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fde68a !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
[data-bs-theme="dark"] .badge.bg-success-subtle,
[data-bs-theme="dark"] .badge-soft-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #a7f3d0 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}
[data-bs-theme="dark"] .badge.bg-danger-subtle,
[data-bs-theme="dark"] .badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge-soft-secondary {
    background-color: rgba(148, 163, 184, 0.15) !important;
    color: #e2e8f0 !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
}