/* =============================================================
   ShaGha POS — app.css
   Theme: black · red · white · light-blue
   ============================================================= */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --sg-black:      #14181d;
    --sg-black-soft: #1e2530;
    --sg-red:        #d6273e;
    --sg-red-dark:   #b21d31;
    --sg-white:      #ffffff;
    --sg-light-blue: #e9f4fc;
    --sg-blue:       #2f9be0;
    --sg-ink:        #1f2630;
    --sg-muted:      #6b7785;
    --sg-border:     #dee2e6;
    --sg-sidebar-w:  240px;
    --sg-navbar-h:   56px;
}

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

body.sg-body {
    background: var(--sg-light-blue);
    color: var(--sg-ink);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
}

a { color: var(--sg-blue); }
a:hover { color: var(--sg-red); }

.text-white-75  { color: rgba(255,255,255,.75) !important; }
.text-white-50  { color: rgba(255,255,255,.50) !important; }

/* ── Navbar ─────────────────────────────────────────────────── */
.sg-navbar {
    background: var(--sg-black);
    height: var(--sg-navbar-h);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    z-index: 1030;
}
.sg-navbar .navbar-brand {
    color: var(--sg-white);
    font-size: 1.2rem;
    letter-spacing: .3px;
}
.sg-brand-accent { color: var(--sg-red); }

/* Navbar icon button (mobile hamburger) */
.sg-btn-icon {
    background: transparent;
    border: 1px solid rgba(255,255,255,.3);
    color: rgba(255,255,255,.85);
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    line-height: 1;
}
.sg-btn-icon:hover { background: rgba(255,255,255,.1); color: white; border-color: rgba(255,255,255,.6); }

/* Role badge in navbar */
.sg-badge-role {
    background: var(--sg-red);
    color: white;
    font-size: .7rem;
    padding: 0.3em 0.7em;
    border-radius: 4px;
}

/* Navbar buttons */
.sg-btn {
    background: var(--sg-red);
    border: 1px solid var(--sg-red);
    color: var(--sg-white);
    font-weight: 600;
}
.sg-btn:hover { background: var(--sg-red-dark); border-color: var(--sg-red-dark); color: var(--sg-white); }

.sg-btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,.45);
    color: rgba(255,255,255,.9);
}
.sg-btn-outline:hover { background: rgba(255,255,255,.1); color: white; border-color: rgba(255,255,255,.8); }

/* ── Layout shell ───────────────────────────────────────────── */
.sg-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--sg-navbar-h));
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sg-sidebar {
    width: var(--sg-sidebar-w);
    min-width: var(--sg-sidebar-w);
    background: var(--sg-black);
    flex-direction: column;
    position: sticky;
    top: var(--sg-navbar-h);
    height: calc(100vh - var(--sg-navbar-h));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
    z-index: 100;
    flex-shrink: 0;
}
.sg-sidebar::-webkit-scrollbar { width: 4px; }
.sg-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sg-sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 1rem;
}

.sg-sidebar-brand {
    padding: 1rem 1.25rem 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sg-white);
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}
.sg-sidebar-brand a { color: var(--sg-white); }

/* Sidebar nav */
.sg-sidebar-nav { flex: 1; padding: 0.25rem 0.6rem 0.5rem; }

.sg-nav-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: 0.55rem 0.7rem 0.2rem;
}

.sg-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.42rem 0.75rem;
    border-radius: 7px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: .875rem;
    transition: background .12s, color .12s;
    margin-bottom: 1px;
    white-space: nowrap;
}
.sg-nav-link i { font-size: .95rem; flex-shrink: 0; width: 17px; text-align: center; }
.sg-nav-link:hover { background: rgba(255,255,255,.09); color: var(--sg-white); }
.sg-nav-link.active {
    background: var(--sg-red);
    color: var(--sg-white);
    font-weight: 600;
}
.sg-nav-link.active:hover { background: var(--sg-red-dark); }

/* Sub-group indent */
.sg-nav-sub-group {
    margin-left: 0.4rem;
    border-left: 2px solid rgba(255,255,255,.1);
    padding-left: 0.4rem;
    margin-bottom: 2px;
}
.sg-nav-sub-group .sg-nav-link { font-size: .82rem; padding: 0.33rem 0.6rem; }

.sg-sidebar-footer {
    padding: 0.65rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}

/* ── Main content ───────────────────────────────────────────── */
.sg-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Offcanvas (mobile sidebar) ─────────────────────────────── */
.sg-offcanvas {
    background: var(--sg-black);
    color: var(--sg-white);
    width: var(--sg-sidebar-w) !important;
}
.sg-offcanvas .btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* ── Cards ──────────────────────────────────────────────────── */
.sg-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 3px 16px rgba(20,24,29,.08);
    background: var(--sg-white);
}
.sg-stat-card {
    border: none;
    border-radius: 12px;
    background: var(--sg-white);
    box-shadow: 0 3px 16px rgba(20,24,29,.07);
    border-left: 4px solid var(--sg-red);
}
.sg-stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sg-muted);
    margin-bottom: 2px;
}
.sg-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--sg-black);
    line-height: 1.1;
}

/* ── Badges ─────────────────────────────────────────────────── */
.sg-badge-sterile  { background: #0dcaf0; color: #000; }
.sg-badge-featured { background: var(--sg-red); color: #fff; }

/* ── Product thumb ──────────────────────────────────────────── */
.sg-product-thumb {
    height: 120px;
    background: var(--sg-light-blue);
    border-radius: 10px 10px 0 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: var(--sg-blue);
}
.sg-product-thumb-lg { height: 260px; border-radius: 12px; font-size: 4rem; }
.sg-thumb-letter { user-select: none; }

/* ── Category card hover ────────────────────────────────────── */
.sg-category-card:hover {
    border-color: var(--sg-red) !important;
    transform: translateY(-2px);
    transition: all .15s;
}

/* ── Hero banner ────────────────────────────────────────────── */
.sg-hero { background: linear-gradient(135deg, var(--sg-black-soft, #1e2530), var(--sg-black)); }
.sg-hero .card-body, .sg-hero h1, .sg-hero p { color: rgba(255,255,255,.9); }

/* ── Tables ─────────────────────────────────────────────────── */
.table thead th {
    background: var(--sg-light-blue);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--sg-muted);
}

/* ── CRM tiles ──────────────────────────────────────────────── */
.crm-tile { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.crm-tile:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important; }

/* ── Footer ─────────────────────────────────────────────────── */
.sg-footer {
    background: var(--sg-black);
    padding: 1.1rem 0 0.9rem;
    margin-top: auto;
    flex-shrink: 0;
}
.sg-footer-inner { padding: 0 1.5rem; }
.sg-footer-divider { border-color: rgba(255,255,255,.1); margin: 0.65rem 0; }
.sg-footer-link {
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .82rem;
    transition: color .15s;
}
.sg-footer-link:hover { color: var(--sg-white); text-decoration: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .sg-sidebar { display: none !important; }
    .sg-footer-inner { padding: 0 1rem; }
}
