:root {
    --sidebar-width: 270px;
    --primary-color: #0d6efd;
    --sidebar-bg: #1e3a8a;
    --sidebar-text: rgba(255, 255, 255, 0.88);
    --sidebar-muted: rgba(191, 219, 254, 0.55);
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.14);
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-color: #1e293b;
}
[data-theme="dark"] {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --sidebar-bg: #172554;
}
body { background: var(--body-bg); color: var(--text-color); font-family: 'Segoe UI', system-ui, sans-serif; }
.wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 999px; }
.sidebar-header {
    padding: 1.35rem 1.35rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.05rem;
}
.sidebar-header .bi { font-size: 1.35rem; opacity: 0.95; }
.sidebar-menu { padding: 0.25rem 0 1.75rem; }
.sidebar-section { margin-bottom: 0.85rem; }
.sidebar-section-title {
    padding: 0.9rem 1.35rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-item-main {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.sidebar-item-main .bi {
    font-size: 1.05rem;
    width: 1.15rem;
    text-align: center;
    opacity: 0.95;
}
.sidebar-nav > li > a.sidebar-link,
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.72rem 1.35rem;
    color: var(--sidebar-text);
    text-decoration: none;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    font-size: 0.95rem;
    font-weight: 500;
}
.sidebar-nav > li > a.sidebar-link:hover,
.sidebar-group-toggle:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav > li > a.sidebar-link.active,
.sidebar-group-toggle.active {
    background: var(--sidebar-active);
    color: #fff;
}
.sidebar-chevron {
    font-size: 0.78rem;
    opacity: 0.75;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.sidebar-group.open .sidebar-chevron { transform: rotate(180deg); }
.sidebar-submenu {
    list-style: none;
    padding: 0.15rem 0 0.35rem;
    margin: 0;
}
.sidebar-submenu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.35rem 0.55rem 3.15rem;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.88rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-submenu a:hover,
.sidebar-submenu a.active {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-submenu a .bi { font-size: 0.95rem; width: 1rem; text-align: center; }
.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; }
.navbar-top { background: var(--card-bg); padding: 0.75rem 1.5rem; display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.card { background: var(--card-bg); border: none; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-radius: 0.5rem; }
.stat-card { border-left: 4px solid var(--primary-color); }
.stat-card.danger { border-left-color: #dc3545; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.success { border-left-color: #198754; }
.stat-card.info { border-left-color: #0dcaf0; }
.auth-body { background: linear-gradient(135deg, #1e3a5f 0%, #0d6efd 100%); min-height: 100vh; }
.auth-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.auth-card { background: #fff; border-radius: 1rem; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.pos-container { display: grid; grid-template-columns: 1fr 400px; gap: 1rem; height: calc(100vh - 120px); }
.pos-products { overflow-y: auto; }
.pos-cart { background: var(--card-bg); border-radius: 0.5rem; padding: 1rem; display: flex; flex-direction: column; }
.pos-cart-items { flex: 1; overflow-y: auto; }
.product-search-item { cursor: pointer; padding: 0.5rem; border-radius: 0.25rem; border-bottom: 1px solid rgba(0,0,0,0.05); }
.product-search-item:last-child { border-bottom: none; }
.product-search-item:hover { background: rgba(13,110,253,0.1); }
.product-search-dropdown {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
    margin-top: 2px;
}
.rx-product-results {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 0.35rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.rx-product-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.rx-product-item:hover { background: rgba(13,110,253,0.08); }
.rx-product-item:last-child { border-bottom: none; }
.table th { font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .pos-container { grid-template-columns: 1fr; height: auto; }
}
