/**
 * ERP Core CSS - Bootstrap-free essentials
 * This file provides core layout utilities for modules that don't use Bootstrap
 * It replicates essential Bootstrap classes needed for the sidebar and layout
 */

/* ================================================
   BASE RESET & TYPOGRAPHY
   ================================================ */
:root {
    /* Surfaces */
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #fbfcff;
    --text: #0f172a;
    --muted: #64748b;
    --border-color: rgba(15, 23, 42, 0.10);
    --border-2: rgba(15, 23, 42, 0.06);
    --bg-hover: #f8fafc;

    /* Brand */
    --gold: #f5b301;
    --gold-2: #ffcc33;
    --gold-dark: #d97706;
    --gold-soft: rgba(245, 179, 1, 0.18);
    --bg-input: #f8fafc;
    --bg-input-focus: #e2e8f0;

    /* Paleta de status (chamados, e-mail+chamados, badges) */
    --st-blue: #3b82f6;
    --st-blue-light: #dbeafe;
    --st-green: #22c55e;
    --st-green-light: #dcfce7;
    --st-yellow: #eab308;
    --st-yellow-light: #fef9c3;
    --st-orange: #f97316;
    --st-orange-light: #ffedd5;
    --st-purple: #a855f7;
    --st-purple-light: #f3e8ff;
    --st-gray: #64748b;
    --st-gray-light: #f1f5f9;
    --st-red: #ef4444;
    --st-red-light: #fee2e2;
    --st-cyan: #06b6d4;
    --st-cyan-light: #cffafe;
    --st-dark: #1e293b;
    --sidebar-bg: #0b1220;
    --sidebar-bg-2: #0f1b33;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Status */
    --primary: #2563eb;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --purple: #8b5cf6;

    /* Shape */
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.10);
    --transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;

    /* Aliases usados pelos CSS de módulos (cli-*, db-*, etc.) */
    --bg-body: var(--bg);
    --bg-card: var(--surface);
    --text-primary: var(--text);
    --text-secondary: var(--muted);
    --text-muted: var(--muted);
    --navy: #1e3a8a;
    --navy-light: #2563eb;
}

body.dark-mode {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --bg-input: #334155;
    --bg-input-focus: #475569;

    /* Sidebar Dark Mode (Slate-900 to Slate-800) */
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #1e293b;
    --border-color: #334155;

    --st-blue-light: rgba(59, 130, 246, 0.2);
    --st-green-light: rgba(34, 197, 94, 0.2);
    --st-yellow-light: rgba(234, 179, 8, 0.2);
    --st-orange-light: rgba(249, 115, 22, 0.2);
    --st-purple-light: rgba(168, 85, 247, 0.2);
    --st-gray-light: rgba(100, 116, 139, 0.25);
    --st-red-light: rgba(239, 68, 68, 0.2);
    --st-cyan-light: rgba(6, 182, 212, 0.2);
}

/* Dark mode component overrides */
body.dark-mode .card,
body.dark-mode .header-card,
body.dark-mode .actions-bar,
body.dark-mode .toolbar-card,
body.dark-mode .ghost-card,
body.dark-mode .bg-white,
body.dark-mode .bg-slate-50,
body.dark-mode .an-note-card,
body.dark-mode .note-card,
body.dark-mode .tsk-col,
body.dark-mode .table {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Modal / dropdown */
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Tabelas e listas */
body.dark-mode table tbody tr:nth-child(even),
body.dark-mode .table-striped tbody tr:nth-child(even) {
    background-color: #0b1220 !important;
}

body.dark-mode table,
body.dark-mode table th,
body.dark-mode table td,
body.dark-mode .table th,
body.dark-mode .table td {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Cards genéricos usados nos módulos */
body.dark-mode .card,
body.dark-mode .cli-card,
body.dark-mode .ps-card,
body.dark-mode .svc-card,
body.dark-mode .prd-card,
body.dark-mode .pps-card,
body.dark-mode .tsk-card,
body.dark-mode .ch-card,
body.dark-mode .cia-card,
body.dark-mode .cia-main,
body.dark-mode .cia-sidebar,
body.dark-mode .cia-input-wrapper,
body.dark-mode .an-card,
body.dark-mode .admin-card,
body.dark-mode .table-card,
body.dark-mode .header-card,
body.dark-mode .actions-bar,
body.dark-mode .toolbar-card,
body.dark-mode .ghost-card,
body.dark-mode .bg-white {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Chat IA overrides */
body.dark-mode .cia-conv-item {
    background-color: var(--surface) !important;
    border-color: var(--border-color, #334155) !important;
    color: var(--text) !important;
}

body.dark-mode .cia-input-area,
body.dark-mode .cia-chat-window,
body.dark-mode .cia-messages-list {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Chat IA text area */
body.dark-mode .cia-textarea {
    background-color: #0b1220 !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Inputs em toolbars e filtros */
body.dark-mode .search-group,
body.dark-mode .search-group input,
body.dark-mode .search-group select,
body.dark-mode .search-group textarea {
    background-color: #0b1220 !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

/* Auxiliares de cor herdados de Bootstrap/tailwind */
body.dark-mode .bg-light,
body.dark-mode .bg-body,
body.dark-mode .bg-gray-50,
body.dark-mode .bg-slate-100 {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

body.dark-mode hr {
    border-color: var(--border-color, #334155) !important;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .form-control,
body.dark-mode .search-group,
body.dark-mode .search-group input {
    background-color: #0f172a !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}

body.dark-mode .text-muted,
body.dark-mode .muted,
body.dark-mode .text-slate-500,
body.dark-mode .text-slate-600 {
    color: var(--muted) !important;
}

body.dark-mode table thead {
    background-color: #0b1220 !important;
    color: var(--text) !important;
}

body.dark-mode .badge,
body.dark-mode .chip,
body.dark-mode .status-chip {
    color: var(--text) !important;
}

/* Forms/inputs globais */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #0b1220 !important;
    color: var(--text) !important;
    border-color: var(--border-color, #334155) !important;
}


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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid rgba(245, 179, 1, 0.35);
    outline-offset: 2px;
}

/* ================================================
   FLEXBOX UTILITIES
   ================================================ */
.d-flex {
    display: flex !important;
}

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

.d-block {
    display: block !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-row {
    flex-direction: row !important;
}

.flex-grow-1 {
    flex-grow: 1 !important;
}

.flex-shrink-0 {
    flex-shrink: 0 !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.align-items-center {
    align-items: center !important;
}

.align-items-start {
    align-items: flex-start !important;
}

.align-items-end {
    align-items: flex-end !important;
}

.justify-content-center {
    justify-content: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.gap-1 {
    gap: 0.25rem !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 1rem !important;
}

.gap-4 {
    gap: 1.5rem !important;
}

/* ================================================
   SPACING UTILITIES
   ================================================ */
.m-0 {
    margin: 0 !important;
}

.mt-auto {
    margin-top: auto !important;
}

.mb-auto {
    margin-bottom: auto !important;
}

.ms-auto {
    margin-left: auto !important;
}

.me-auto {
    margin-right: auto !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

/* Responsive utilities */
@media (min-width: 768px) {
    .mb-md-0 {
        margin-bottom: 0 !important;
    }
}

.p-3 {
    padding: 1rem !important;
}

.px-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.pb-3 {
    padding-bottom: 1rem !important;
}

/* ================================================
   TEXT UTILITIES
   ================================================ */
.text-white {
    color: #fff !important;
}

.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.text-decoration-none {
    text-decoration: none !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fs-4 {
    font-size: 1.25rem !important;
}

.fs-5 {
    font-size: 1.125rem !important;
}

.small {
    font-size: 0.875rem !important;
}

.opacity-50 {
    opacity: 0.5 !important;
}

.user-select-none {
    user-select: none !important;
}

/* ================================================
   WIDTH & HEIGHT
   ================================================ */
.w-100 {
    width: 100% !important;
}

.min-vh-100 {
    min-height: 100vh !important;
}

/* ================================================
   BORDERS & SHAPES
   ================================================ */
.rounded-circle {
    border-radius: 50% !important;
}

/* ================================================
   RESPONSIVE DISPLAY
   ================================================ */
@media (min-width: 992px) {
    .d-lg-flex {
        display: flex !important;
    }

    .d-lg-none {
        display: none !important;
    }
}

/* ================================================
   SIDEBAR STYLES
   ================================================ */
.sidebar-desktop {
    width: 260px;
    min-width: 200px;
    max-width: 400px;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    position: sticky;
    top: 0;
    transition: width 0.3s;
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 18px 10px 10px 10px !important;
}

/* Faixa do logo: uma linha, não estica no flex-col da sidebar */
#desktopBrandToggle,
.sidebar-brand-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    align-self: stretch;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none;
    padding: 4px 6px !important;
    margin: 0 0 6px !important;
    text-decoration: none;
    color: white;
    gap: 8px;
    box-sizing: border-box;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sidebar-desktop > hr,
.sidebar-desktop > .sidebar-divider {
    flex: 0 0 auto;
}

.sidebar-desktop .sidebar-nav-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
}

/* Remove gap above the first separator line */
#desktopBrandToggle+hr {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

/* Collapsed state - Support both direct class and parent html class (anti-flicker) */
.sidebar-desktop.collapsed,
html.sidebar-collapsed .sidebar-desktop {
    width: 90px !important;
    min-width: 90px !important;
}

.sidebar-desktop.collapsed .nav-label,
.sidebar-desktop.collapsed .brand-title,
html.sidebar-collapsed .sidebar-desktop .nav-label,
html.sidebar-collapsed .sidebar-desktop .brand-title {
    display: none;
}

.sidebar-desktop.collapsed #desktopBrandToggle,
.sidebar-desktop.collapsed .nav-link,
.sidebar-desktop.collapsed .dropdown-toggle,
html.sidebar-collapsed .sidebar-desktop #desktopBrandToggle,
html.sidebar-collapsed .sidebar-desktop .nav-link,
html.sidebar-collapsed .sidebar-desktop .dropdown-toggle {
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 16px;
    line-height: 1;
    overflow: visible;
    margin: 6px auto;
    flex-shrink: 0;
}

.sidebar-desktop.collapsed .dropdown-toggle::after,
html.sidebar-collapsed .sidebar-desktop .dropdown-toggle::after {
    display: none;
}

.sidebar-desktop.collapsed .dropdown-toggle .me-2,
html.sidebar-collapsed .sidebar-desktop .dropdown-toggle .me-2 {
    margin-right: 0 !important;
}

/* Collapsed: fix icon sizing/centering */
.sidebar-desktop.collapsed .nav-link i,
.sidebar-desktop.collapsed .nav-link svg,
.sidebar-desktop.collapsed .dropdown-toggle i,
.sidebar-desktop.collapsed .dropdown-toggle svg,
html.sidebar-collapsed .sidebar-desktop .nav-link i,
html.sidebar-collapsed .sidebar-desktop .nav-link svg,
html.sidebar-collapsed .sidebar-desktop .dropdown-toggle i,
html.sidebar-collapsed .sidebar-desktop .dropdown-toggle svg {
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    flex-shrink: 0;
}

/* Collapsed: 56×56 como .nav-link */
.sidebar-desktop.collapsed .brand-badge,
html.sidebar-collapsed .sidebar-desktop .brand-badge {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%) !important;
    border-radius: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 !important;
}

.sidebar-desktop.collapsed .brand-badge img,
.sidebar-desktop.collapsed .brand-badge .erp-brand-logo,
html.sidebar-collapsed .sidebar-desktop .brand-badge img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
}

.sidebar-resizer {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    z-index: 100;
}

.sidebar-resizer:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navigation */
.nav {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-pills {
    gap: 4px;
}

.nav-item {
    width: 100%;
}

/* Sidebar Navigation Items - High Specificity to override Bootstrap */
.sidebar-desktop .nav-link,
.sidebar-mobile-menu .nav-link,
.nav-pills .nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
    padding: 0.7rem 1rem;
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 12px;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.98rem;
    font-weight: 600;
}

.sidebar-desktop .nav-link:focus-visible,
.sidebar-mobile-menu .nav-link:focus-visible,
#desktopBrandToggle:focus-visible,
.sidebar-brand-toggle:focus-visible {
    outline: 3px solid rgba(245, 158, 11, 0.45);
    outline-offset: 2px;
}

.sidebar-desktop .nav-link i,
.sidebar-desktop .nav-link svg,
.sidebar-mobile-menu .nav-link i,
.sidebar-mobile-menu .nav-link svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    font-size: 24px !important;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.88);
    opacity: 1;
    transition: color 0.2s, transform 0.2s;
    position: relative;
    top: 0;
}

.sidebar-desktop .nav-link.active i.ti,
.sidebar-mobile-menu .nav-link.active i.ti {
    color: #1b1200;
}

/* When collapsed (icon-only), keep icons fully centered */
.sidebar-desktop.collapsed .nav-link i,
.sidebar-desktop.collapsed .nav-link svg,
html.sidebar-collapsed .sidebar-desktop .nav-link i,
html.sidebar-collapsed .sidebar-desktop .nav-link svg {
    top: 3px;
    left: 3px;
}

.sidebar-desktop .nav-link:hover,
.sidebar-mobile-menu .nav-link:hover,
.nav-pills .nav-link:hover {
    background: rgba(245, 158, 11, 0.8);
    color: #0f172a;
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.sidebar-desktop .nav-link.active,
.sidebar-mobile-menu .nav-link.active,
.nav-pills .nav-link.active {
    background: var(--gold) !important;
    color: #0f172a !important;
    /* Dark text for contrast */
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.nav-link svg {
    width: 34px !important;
    height: 34px !important;
    font-size: 34px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brand */
.brand-badge {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(245, 179, 1, 0.2);
}

.brand-badge svg,
.brand-badge img,
.brand-badge .erp-brand-logo {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    min-width: 0;
}

/* No mobile topo o título é o elemento principal — sem flex:1 que faria ele colapsar */
.sidebar-mobile .brand-title {
    flex: 0 0 auto;
}

.brand-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.nav-label {
    white-space: nowrap;
    line-height: 1.2;
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* No menu mobile aberto, garante que o label do módulo aparece, sem truncate forçado */
.sidebar-mobile-menu .nav-label {
    max-width: none;
    font-size: 15px;
    font-weight: 500;
}

/* Mobile Sidebar */
.sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(90deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    z-index: 1000;
    padding: 0;
    /* Remove padding to allow full centering */
    display: flex;
    /* Removed !important so d-lg-none works */
    align-items: center !important;
    justify-content: center !important;
    /* Perfect H-center */
}

.sidebar-mobile .brand,
.sidebar-mobile-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    margin: 0 auto !important;
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.sidebar-mobile-trigger:focus-visible {
    outline: 3px solid rgba(245, 158, 11, 0.45);
    outline-offset: 2px;
}

/* Badge menor dentro do header mobile (título é o foco) */
.sidebar-mobile .brand-badge--inline {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
}

.sidebar-mobile .brand-badge--inline svg,
.sidebar-mobile .brand-badge--inline img {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}

/* Chevron discreto à direita do título no header mobile */
.sidebar-mobile .brand-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    margin-left: 2px;
}

.sidebar-mobile .ti-chevron-down {
    display: none !important;
}

.nav-link--danger {
    color: #f87171 !important;
}

.nav-link--danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fecaca !important;
}

/* Chevron dentro do título (novo header mobile) — visível */
.sidebar-mobile .brand-chevron .ti-chevron-down {
    display: inline-block !important;
}

/* Hide legacy inline chevron no header (compat) */
.sidebar-mobile > .ti-chevron-down {
    display: none !important;
}

.sidebar-mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    z-index: 999;
    padding: 16px;
    display: none;
    overflow-y: auto;
    text-align: center;
    /* Center text content */
}

.sidebar-mobile-menu .nav-link {
    justify-content: center;
    /* Center flex items */
    background: rgba(255, 255, 255, 0.05);
    /* Subtle background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Border for definition */
    margin-bottom: 8px;
    /* Spacing between items */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Slight shadow for depth */
}

.sidebar-mobile-menu .nav-link:active {
    background: rgba(255, 255, 255, 0.15);
    /* Highlight on tap */
    transform: translateY(1px);
    /* Press effect */
}

.sidebar-mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    z-index: 999;
    padding: 16px;
    display: none;
    overflow-y: auto;
}

.sidebar-mobile-menu.show {
    display: block;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: 0.2em;
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-left: 0.3em solid transparent;
}

.dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 160px;
    padding: 0.5rem 0;
    background: #2d3748;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    margin-bottom: 4px;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

/* HR */
hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.75rem 0;
}

/* Background colors */
.bg-primary {
    background-color: var(--primary) !important;
}

.bg-secondary {
    background-color: #64748b !important;
}

/* ================================================
   MAIN CONTENT LAYOUT
   ================================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    overflow-x: hidden;
    background-color: var(--bg);
}

.content-wrapper {
    padding: 1rem;
}

/* Hide scrollbar utility */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ================================================
   MOBILE WARNING
   ================================================ */
.mobile-warning {
    display: none;
}

/* ================================================
   TOAST CONTAINER
   ================================================ */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

/* ================================================
   RICH CONTENT
   ================================================ */
.erp-rich-content {
    word-break: break-word;
}

.erp-rich-content>*:first-child {
    margin-top: 0;
}

.erp-rich-content>*:last-child {
    margin-bottom: 0;
}

.erp-rich-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px 0;
    border-radius: 8px;
}

.erp-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}

.erp-rich-content th,
.erp-rich-content td {
    border: 1px solid var(--border-color, #cbd5e1);
    padding: 6px 8px;
    vertical-align: top;
}

.erp-rich-content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
}
