:root {
    --bg-main: #f4f7fb;
    --bg-sidebar: #0f172a;
    --accent: #0f766e;
    --border: #e5e7eb;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at top, #eff6ff 0%, var(--bg-main) 50%, #eef2ff 100%);
    color: #102034;
}

.login-page {
    background: linear-gradient(135deg, #0f172a, #134e4a 55%, #f59e0b);
}

.app-shell { min-height: 100vh; }
.sidebar {
    width: 280px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #0b1220 0%, var(--bg-sidebar) 100%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6, #f59e0b);
    color: #fff;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-sublink {
    margin-left: 1.5rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    font-size: 0.92rem;
}

.sidebar-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.sidebar-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(180deg);
}

.summary-total {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(135deg, #ecfeff, #ffffff);
    padding: 0.9rem 1rem;
}

.memo-pinned {
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border-color: #fed7aa !important;
}

.stock-action-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.product-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.product-thumb-sm,
.pos-product-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.js-image-preview {
    cursor: zoom-in;
    display: inline-flex;
}

.pos-product-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 1rem;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pos-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.card {
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 22px;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.metric-card { color: #fff; }
.metric-card .card-body { padding: 1.4rem; }
.metric-label { display: block; margin-bottom: 0.7rem; color: rgba(255, 255, 255, 0.78); }
.revenue-card { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.expense-card { background: linear-gradient(135deg, #b45309, #f59e0b); }
.salary-card { background: linear-gradient(135deg, #334155, #64748b); }
.profit-card { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }

.summary-box,
.quick-stat {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    margin-top: 0.85rem;
}

.stock-signal,
.valuation-card,
.top-product {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    background: #fff;
}

.stock-signal {
    min-height: 136px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.signal-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
}

.stock-signal strong {
    font-size: 2rem;
    line-height: 1;
}

.stock-ok {
    background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
}

.stock-warning {
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.stock-danger {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.row-critical td {
    background: rgba(239, 68, 68, 0.06);
}

.row-warning td {
    background: rgba(245, 158, 11, 0.06);
}

.valuation-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
}

.valuation-highlight {
    background: linear-gradient(135deg, #dbeafe, #ffffff);
}

.top-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
}

.table > :not(caption) > * > * {
    padding: 0.9rem 0.75rem;
}

@media (max-width: 991.98px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }
}
