/* ===================================================================
   M-ERP 2.0
=================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root,
[data-theme="dark"] {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Color Tokens (Dark Slate Theme) */
    --bg-app: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-elevated: #334155;
    --bg-surface-subtle: rgba(30, 41, 59, 0.6);
    --border-subtle: #334155;
    --border-strong: #475569;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #ffffff;

    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-subtle: rgba(99, 102, 241, 0.15);

    --color-success: #10b981;
    --color-success-subtle: rgba(16, 185, 129, 0.15);
    --color-warning: #f59e0b;
    --color-warning-subtle: rgba(245, 158, 11, 0.15);
    --color-danger: #ef4444;
    --color-danger-subtle: rgba(239, 68, 68, 0.15);
    --color-info: #0ea5e9;
    --color-info-subtle: rgba(14, 165, 233, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.15);

    --sidebar-width: 260px;
    --header-height: 64px;

    --sidebar-bg: #090d16;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(15, 23, 42, 0.85);
    --header-border: rgba(255, 255, 255, 0.08);
    --input-bg: #0f172a;
    --input-border: #475569;
    --input-text: #ffffff;
    --table-header-bg: rgba(15, 23, 42, 0.7);
    --table-border: rgba(255, 255, 255, 0.05);
    --table-hover: rgba(255, 255, 255, 0.02);
    --modal-bg: #1e293b;
    --modal-border: #475569;
    --combobox-bg: #1e293b;
    --combobox-border: #475569;
    --combobox-option-hover: #6366f1;
    --combobox-option-text: #cbd5e1;
    --card-footer-bg: rgba(0, 0, 0, 0.1);
    --badge-neutral-bg: rgba(255, 255, 255, 0.08);
    --badge-neutral-text: #94a3b8;
}

[data-theme="light"] {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Color Tokens (Clean Modern Crisp Light Theme) */
    --bg-app: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-heading: #0f172a;

    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-subtle: rgba(79, 70, 229, 0.1);

    --color-success: #059669;
    --color-success-subtle: rgba(5, 150, 105, 0.12);
    --color-warning: #d97706;
    --color-warning-subtle: rgba(217, 119, 6, 0.12);
    --color-danger: #dc2626;
    --color-danger-subtle: rgba(220, 38, 38, 0.12);
    --color-info: #0284c7;
    --color-info-subtle: rgba(2, 132, 199, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

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

    --sidebar-width: 260px;
    --header-height: 64px;

    --sidebar-bg: #0f172a;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --header-bg: rgba(255, 255, 255, 0.95);
    --header-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;
    --table-header-bg: #f8fafc;
    --table-border: #e2e8f0;
    --table-hover: #f1f5f9;
    --modal-bg: #ffffff;
    --modal-border: #cbd5e1;
    --combobox-bg: #ffffff;
    --combobox-border: #cbd5e1;
    --combobox-option-hover: #4f46e5;
    --combobox-option-text: #334155;
    --card-footer-bg: #f8fafc;
    --badge-neutral-bg: #f1f5f9;
    --badge-neutral-text: #475569;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: #090d16;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.brand-text p {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 10px 12px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* Expandable Nav Groups */
.nav-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.nav-group-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    outline: none;
    font-family: inherit;
}

.nav-group-header:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-group-header.is-active-group {
    color: #fff;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-group-title svg {
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.nav-group-header:hover .nav-group-title svg,
.nav-group-header.is-active-group .nav-group-title svg {
    color: var(--color-primary);
}

.nav-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
    flex-shrink: 0;
}

.nav-chevron.is-open {
    transform: rotate(180deg);
    color: var(--text-secondary);
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 6px 12px;
    margin-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-sublink {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-sublink:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.nav-sublink.active {
    color: #fff;
    font-weight: 700;
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.nav-sublink svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: #334155;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Header */
.app-header {
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--header-border);
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

/* Branch Switcher Dropdown */
.branch-switcher-form select {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
}

.branch-switcher-form select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Page Container */
.page-content,
.page-container {
    flex: 1;
    padding: 24px 28px;
    max-width: 100% !important;
    width: 100%;
}

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

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

.page-title p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

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

/* Cards & Panels */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: visible;
    color: var(--text-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-subtle);
    background: var(--card-footer-bg);
}

/* Stat Widgets Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.stat-content .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stat-content .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-heading);
    font-family: var(--font-mono);
}

.stat-content .stat-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-primary {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.stat-icon-success {
    background: var(--color-success-subtle);
    color: var(--color-success);
}

.stat-icon-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
}

.stat-icon-danger {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
}

.stat-icon-info {
    background: var(--color-info-subtle);
    color: var(--color-info);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

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

.table-erp th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

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

.table-erp tr:hover td {
    background: var(--table-hover);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

.badge-success {
    background: var(--color-success-subtle);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: var(--color-warning-subtle);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: var(--color-danger-subtle);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-primary {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-neutral {
    background: var(--badge-neutral-bg);
    color: var(--badge-neutral-text);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    outline: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-strong);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 9px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
    font-family: inherit;
}

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

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Alert Boxes */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: var(--color-danger-subtle);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: var(--color-success-subtle);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Alpine Interactive Calculator Card */
.calculator-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid #4338ca;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

.schedule-row.total {
    border-top: 2px solid var(--color-primary);
    border-bottom: none;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    margin-top: 10px;
    padding-top: 12px;
}

/* ===================================================================
   Alpine Cloak & Modal Overlay System
   =================================================================== */
[x-cloak] {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal-dialog {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--modal-bg);
    border: 1px solid var(--modal-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: auto;
    position: relative;
    color: var(--text-primary);
}

.modal-dialog-lg {
    max-width: 850px;
}

.modal-dialog-sm {
    max-width: 480px;
}

/* ===================================================================
   Searchable Combobox Component (Pure Alpine & Zero Dependency)
   =================================================================== */
.combobox-wrapper {
    position: relative;
    width: 100%;
}

.combobox-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.combobox-input {
    width: 100%;
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--input-text) !important;
    padding: 9px 36px 9px 12px !important;
    font-size: 0.85rem !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

.combobox-input:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px var(--color-primary-subtle) !important;
}

.combobox-chevron {
    position: absolute;
    right: 12px;
    pointer-events: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.combobox-wrapper,
.cell-combobox,
.table-erp td.cell-combobox {
    position: relative !important;
    width: 100%;
    overflow: visible !important;
}

.combobox-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--combobox-bg);
    border: 1px solid var(--combobox-border);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.35);
    z-index: 100099 !important;
    padding: 4px;
}

.table-overflow-visible {
    overflow: visible !important;
    min-height: 280px;
}

.combobox-option {
    padding: 9px 12px;
    font-size: 0.85rem;
    color: var(--combobox-option-text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.1s ease, color 0.1s ease;
    margin-bottom: 2px;
}

.combobox-option:hover,
.combobox-option.is-active {
    background-color: var(--color-primary);
    color: #ffffff;
}

.combobox-option.is-selected {
    background-color: rgba(99, 102, 241, 0.25);
    color: #818cf8;
    font-weight: 700;
}

.combobox-empty {
    padding: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* ==========================================================================
   Sleek Glassmorphic Segmented Navigation Tabs
   ========================================================================== */
.custom-nav-tabs,
.report-tabs {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow-x: auto;
}

.custom-nav-tab,
.report-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    white-space: nowrap;
}

.custom-nav-tab:hover,
.report-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.custom-nav-tab.active,
.report-tab.active {
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(59, 130, 246, 0.25) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.custom-nav-tab.active::after,
.report-tab.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #38bdf8);
    border-radius: 999px;
    box-shadow: 0 0 8px #38bdf8;
}

.custom-nav-tab i {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.custom-nav-tab:hover i {
    transform: scale(1.1);
}

.custom-nav-tab.active i {
    color: #38bdf8;
}

.tab-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
}

/* ===================================================================
   M-ERP 2.0 - Universal Professional Print & PDF Engine
   Renders clean, beautiful, zero-chrome vector prints & POS slips
=================================================================== */

.print-only {
    display: none !important;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm 10mm 14mm 10mm;
    }

    html,
    body {
        background: #ffffff !important;
        color: #0f172a !important;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 1. Hide All Screen / Web Navigation Elements */
    .app-sidebar,
    .app-topbar,
    .sidebar-nav,
    .nav-link,
    .page-header .page-actions,
    .page-actions,
    .btn,
    .btn-print,
    button:not(.allow-print),
    input,
    select,
    textarea,
    .no-print,
    nav,
    .custom-nav-tabs,
    .report-tabs,
    .filter-card,
    .search-box,
    .tab-badge,
    .pagination,
    .fixed,
    [x-cloak] {
        display: none !important;
        visibility: hidden !important;
    }

    .print-only {
        display: block !important;
        visibility: visible !important;
    }

    /* 2. Reset Layout Shell to Pure Document Stream */
    .app-shell,
    .app-main,
    .container,
    .page-wrapper {
        display: block !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* 3. Universal Cards & Content Blocks */
    .card {
        background: transparent !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 4px !important;
        box-shadow: none !important;
        color: #0f172a !important;
        margin-bottom: 10pt !important;
        padding: 8pt !important;
        page-break-inside: auto !important;
    }

    .card-header,
    .card-title,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: #0f172a !important;
    }

    /* 4. Tables: High-Contrast, Repeating Headers, Page-break safety */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
        margin-bottom: 8pt !important;
    }

    thead {
        display: table-header-group !important;
    }

    tfoot {
        display: table-footer-group !important;
    }

    tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    th,
    td {
        border: 1px solid #cbd5e1 !important;
        padding: 4pt 6pt !important;
        color: #0f172a !important;
        text-align: inherit;
    }

    th {
        background-color: #f1f5f9 !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        font-size: 8.5pt !important;
        text-transform: uppercase !important;
    }

    /* 5. Typography & Badges in Print */
    .text-white,
    .text-slate-100,
    .text-slate-200,
    .text-slate-300 {
        color: #0f172a !important;
    }

    .text-slate-400,
    .text-slate-500 {
        color: #475569 !important;
    }

    .text-indigo-400,
    .text-indigo-300,
    .text-blue-400 {
        color: #1e40af !important;
    }

    .text-emerald-400,
    .text-success {
        color: #065f46 !important;
    }

    .text-amber-400,
    .text-warning {
        color: #92400e !important;
    }

    .text-rose-400,
    .text-danger {
        color: #991b1b !important;
    }

    .text-purple-400,
    .text-purple-300 {
        color: #581c87 !important;
    }

    .badge {
        background: transparent !important;
        border: 1px solid #94a3b8 !important;
        color: #0f172a !important;
        font-size: 8pt !important;
        font-weight: 600 !important;
        padding: 1pt 4pt !important;
        border-radius: 3px !important;
    }

    /* 6. Avoid Page Breaks inside summary rows / totals */
    .avoid-break,
    .summary-row,
    tfoot tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* 7. Dedicated Print Header & Footer Standards */
    .print-header-container {
        border-bottom: 2px solid #0f172a !important;
        padding-bottom: 10pt !important;
        margin-bottom: 12pt !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
    }

    .print-footer-container {
        border-top: 1px solid #cbd5e1 !important;
        padding-top: 8pt !important;
        margin-top: 14pt !important;
        font-size: 8pt !important;
        color: #64748b !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        page-break-inside: avoid !important;
    }

    /* 8. POS 80mm Thermal Receipt Layout Mode */
    .print-thermal {
        width: 72mm !important;
        max-width: 72mm !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 8.5pt !important;
        font-family: 'Courier New', Courier, monospace !important;
    }

    .print-thermal table {
        font-size: 8pt !important;
    }

    .print-thermal th,
    .print-thermal td {
        border: none !important;
        border-bottom: 1px dashed #cbd5e1 !important;
        padding: 2pt 0 !important;
    }
}