:root {
    /* Palette Design System (Clean Light Theme) */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-sidebar-active: #1e293b;

    --brand-primary: #6366f1;
    --brand-secondary: #4f46e5;
    --brand-gradient: linear-gradient(135deg, #6366f1, #4f46e5);
    --brand-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --brand-light: #e0e7ff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-on-brand: #ffffff;

    --color-success: #10b981;
    --color-success-bg: #d1fae5;
    --color-success-dark: #065f46;

    --color-error: #ef4444;
    --color-error-bg: #fee2e2;
    --color-error-dark: #991b1b;

    --color-warning: #f59e0b;
    --color-warning-bg: #fef3c7;
    --color-warning-dark: #92400e;

    --color-info: #3b82f6;
    --color-info-bg: #dbeafe;
    --color-info-dark: #1e40af;

    --border-light: #e2e8f0;
    --border-focus: #cbd5e1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px 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.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.03);

    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

body.not-logged-in {
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 40%), var(--bg-base);
    justify-content: center;
    align-items: center;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* -------------------- LOGIN SCREEN -------------------- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    animation: fadeIn 0.4s ease-out forwards;
}

body.not-logged-in .sidebar,
body.not-logged-in .workspace {
    display: none;
}

.login-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.login-brand {
    margin-bottom: 24px;
}

.login-brand .brand-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--brand-glow);
}

.login-brand .brand-icon svg {
    width: 26px;
    height: 26px;
    fill: #ffffff;
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-input {
    padding: 12px 16px;
}

.login-password-group {
    margin-bottom: 24px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.demo-credentials-box {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

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

.demo-code {
    font-size: 11px;
    color: var(--brand-secondary);
    display: block;
    margin-top: 4px;
}


/* -------------------- SIDEBAR LAYOUT -------------------- */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 28px;
    border-bottom: 1px solid var(--bg-sidebar-active);
    margin-bottom: 24px;
    transition: var(--transition-smooth);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: var(--brand-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--brand-glow);
    flex-shrink: 0;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.brand-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.menu-item a svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.menu-item a span {
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.menu-item a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active a {
    color: #ffffff;
    background-color: var(--brand-primary);
    box-shadow: var(--brand-glow);
}

.menu-item.active a svg {
    stroke: #ffffff;
}

.sidebar-footer {
    padding: 8px 12px;
    margin: 0 -8px;
    border-top: 1px solid var(--bg-sidebar-active);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.sidebar-footer:hover {
    background-color: var(--bg-sidebar-active);
}

.sidebar-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffffff;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.logout-btn {
    border: none;
    background: none;
    color: #94a3b8;
    padding: 4px;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.logout-btn:hover {
    color: var(--color-error);
    background-color: var(--color-error-bg);
}

/* Sidebar collapsed state overrides */
.sidebar.collapsed {
    width: 78px;
    padding: 24px 12px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .menu-item a span,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    padding: 8px 0 28px;
    justify-content: center;
    gap: 0;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.sidebar.collapsed .menu-item a {
    padding: 12px;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    gap: 0;
    border-top-color: rgba(255, 255, 255, 0.05);
}


/* -------------------- WORKSPACE & HEADER -------------------- */
.workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.header {
    height: 72px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

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

.datetime-ticker {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-base);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-icon-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-light);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.action-icon-btn:hover {
    background-color: var(--bg-base);
    color: var(--text-primary);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.action-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sidebar-toggle-btn {
    border: none;
    background: none;
    margin-right: 12px;
    width: 36px;
    height: 36px;
}

.badge-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--color-error);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}


/* -------------------- VIEWS & TABS -------------------- */
.content-view {
    padding: 32px;
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

.subtabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.subtab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.subtab-btn:hover {
    color: var(--text-primary);
}

.subtab-btn.active {
    color: var(--brand-primary);
}

.subtab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
}

.subtab-pane {
    display: none;
}

.subtab-pane.active {
    display: block;
}


/* -------------------- GENERAL CARDS & TABLES -------------------- */
.card-main {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 32px;
}

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

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

.card-body {
    padding: 24px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.custom-table th {
    padding: 14px 20px;
    background-color: var(--bg-base);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.custom-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.custom-table tbody tr:hover {
    background-color: var(--bg-base);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.table-sm th {
    padding: 10px 14px;
}

.table-sm td {
    padding: 10px 14px;
}


/* -------------------- INTERACTIVE BUTTONS & BADGES -------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

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

.btn-danger {
    background-color: var(--color-error-bg);
    color: var(--color-error-dark);
}

.btn-danger:hover {
    background-color: #fee2e2;
    transform: scale(0.98);
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-light);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    margin-right: 4px;
}

.btn-icon-only:hover {
    background-color: var(--bg-base);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.btn-icon-only.danger:hover {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error);
}

.btn-icon-only svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon-only svg path,
.btn-icon-only svg polyline {
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-highlight {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
    border: none;
}

.btn-highlight:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-svg-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-svg-icon path,
.btn-svg-icon polyline {
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-svg-icon-lg {
    width: 18px;
    height: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.2px;
}

.badge-admin {
    background-color: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.badge-manager {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-sale {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-cashier {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-active {
    background-color: var(--color-success-bg);
    color: var(--color-success-dark);
}

.badge-danger {
    background-color: var(--color-error-bg);
    color: var(--color-error-dark);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.status-alert-badge {
    background: var(--color-error-bg);
    color: var(--color-error);
    font-weight: 700;
}


/* -------------------- SEARCH & INPUT CONTROLS -------------------- */
.search-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.input-group-search {
    position: relative;
    flex-grow: 1;
    max-width: 380px;
}

.input-group-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-tertiary);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.input-search {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-size: 13.5px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.input-search:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

@media (min-width: 640px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: normal;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    background-color: var(--bg-surface);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.disabled-bg-cursor {
    background-color: var(--bg-base);
    cursor: not-allowed;
}

.text-area-rows {
    resize: vertical;
    min-height: 60px;
}





/* -------------------- MODALS & OVERLAYS -------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-container {
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--border-light);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    margin: 20px;
}

.modal-lg {
    max-width: 600px;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}

.modal-close:hover {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
}

.modal-body {
    padding: 24px;
}

.modal-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}



/* -------------------- TOAST NOTIFICATIONS DRAWER -------------------- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 300;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-surface);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 16px 20px;
    min-width: 320px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 1px solid var(--border-light);
    border-left-width: 4px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

.toast-success {
    border-left-color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-error);
}

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

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.toast-msg {
    font-size: 12px;
    color: var(--text-secondary);
}


/* -------------------- MISC UTILITY CLASSES -------------------- */
.hidden {
    display: none;
}

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

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

.text-muted {
    color: var(--text-tertiary);
}

.color-text-primary {
    color: var(--text-primary);
}

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

.color-text-tertiary {
    color: var(--text-tertiary);
}

.color-brand-primary {
    color: var(--brand-primary);
}

.color-brand-secondary {
    color: var(--brand-secondary);
}

.color-success {
    color: var(--color-success);
}

.color-error-dark {
    color: var(--color-error-dark);
}

.font-weight-600 {
    font-weight: 600;
}

.font-weight-700 {
    font-weight: 700;
}

.font-weight-750 {
    font-weight: 750;
}

.font-weight-800 {
    font-weight: 800;
}

.font-monospace-primary {
    font-family: monospace;
}

.catalog-desc-ellipsis {
    font-size: 11.5px;
    color: var(--text-tertiary);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.size-address-dim {
    font-size: 13px;
}

.address-column-desc {
    font-size: 13px;
}

.text-ellipsis-sm {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.max-items-summary-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.text-left {
    text-align: left;
}

/* -------------------- SHARED INLINE-REPLACEMENT UTILITIES -------------------- */
.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-md {
    width: 20px;
    height: 20px;
}

.modal-sm {
    max-width: 400px;
}

.modal-xl {
    max-width: 750px;
}

.modal-body-scrollable {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px 24px;
}

.form-input-readonly {
    background-color: var(--bg-base);
    cursor: not-allowed;
    user-select: none;
}

.card-main-mt {
    margin-top: 24px;
}

.form-group-compact {
    margin-bottom: 12px;
}

.radio-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.radio-label {
    font-size: 13px;
}

.new-customer-block {
    display: none;
    background: var(--bg-surface-hover);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.required-asterisk {
    color: var(--color-error);
}

.modal-form-actions-spread {
    justify-content: space-between;
    display: flex;
    width: 100%;
}

.toast-icon-success {
    color: var(--color-success);
}

.toast-icon-error {
    color: var(--color-error);
}

.toast-icon-warning {
    color: var(--color-warning);
}

.toast-icon-info {
    color: var(--brand-primary);
}

/* -------------------- LOCALIZATION SELECTOR -------------------- */
.lang-selector-container {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.lang-select {
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    outline: none;
    transition: var(--transition-smooth);
}

.lang-select:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.lang-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-lang-container {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 1000;
}

/* Shared Dialog Widget overrides */
.dialog-overlay {
    z-index: 9999;
}

.dialog-container {
    max-width: 400px;
}

.dialog-message {
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px;
}

/* -------------------- HOVER POPOVER / SHARING WIDGET -------------------- */
.hover-popover-widget {
    position: fixed;
    z-index: 10000;
    width: 320px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 35px -5px rgba(15, 23, 42, 0.18), 0 4px 10px -2px rgba(15, 23, 42, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
    pointer-events: auto;
    overflow: visible;
}

.hover-popover-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hover-popover-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    transform: rotate(45deg);
    z-index: 1;
    left: var(--arrow-left, 50%);
    margin-left: -6px;
}

/* Arrow position when popover is placed ABOVE target */
.hover-popover-widget.placement-top .hover-popover-arrow {
    bottom: -7px;
    border-top: none;
    border-left: none;
}

/* Arrow position when popover is placed BELOW target */
.hover-popover-widget.placement-bottom .hover-popover-arrow {
    top: -7px;
    border-bottom: none;
    border-right: none;
}

.hover-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background-color: var(--bg-surface-hover);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.hover-popover-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hover-popover-icon {
    width: 16px;
    height: 16px;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.hover-popover-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.hover-popover-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--brand-primary);
}

.hover-popover-body {
    padding: 10px 14px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hover-popover-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    transition: var(--transition-smooth);
}

.hover-popover-item-row:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-focus);
}

.hover-popover-item-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.hover-popover-item-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hover-popover-item-sub {
    font-size: 11px;
    color: var(--text-tertiary);
}

.hover-popover-item-qty {
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-base);
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
}

.hover-popover-empty {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 12px 0;
}

/* Target cell trigger enhancement */
.items-ordered-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.items-ordered-trigger:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-light);
    color: var(--brand-primary);
}

.items-ordered-trigger .items-ordered-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.items-ordered-trigger .items-ordered-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.items-ordered-trigger:hover .items-ordered-icon {
    color: var(--brand-primary);
    transform: scale(1.1);
}

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media (max-width: 768px) {

    /* Sidebar Off-Canvas */
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        z-index: 1000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.mobile-open {
        transform: translateX(260px);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.6);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

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

    /* Workspace */
    .workspace {
        width: 100%;
        padding: 0;
    }

    /* Header adjustments */
    .header {
        padding: 0 12px;
        height: 56px;
    }

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

    .datetime-ticker {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .content-view {
        padding: 12px;
    }

    /* Global utilities for mobile */
    .btn-text-responsive {
        display: none;
    }
}