:root {
    --primary: #4b3fff;
    --primary-dark: #3a2fd6;
    --sidebar-bg: #fdf3ea;
    --sidebar-border: #ecdfd0;
    --sidebar-text: #5c4a3a;
    --bg-light: #f4f5fb;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Login */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1522 0%, #2b1e2e 35%, #4a2318 70%, #7a3418 100%);
}
.login-card {
    width: 100%;
    max-width: 380px;
    border: none;
    border-radius: 16px;
}
.login-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
}
.dev-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    color: #9ca3af;
    font-size: 0.75rem;
}
.dev-credit img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

/* Layout */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
    max-width: 100%;
    height: auto;
    max-height: 60px;
}
.sidebar-nav {
    padding: 10px;
    flex-grow: 1;
}
.sidebar-dev-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    border-top: 1px solid var(--sidebar-border);
    color: #a89482;
    font-size: 0.72rem;
}
.sidebar-dev-credit img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}
.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.95rem;
}
.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 8px;
}
.sidebar-nav .nav-link:hover {
    background: #f5e7d8;
    color: #3d2f24;
}
.sidebar-nav .nav-link.active {
    background: var(--primary);
    color: #fff;
}

.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.topbar {
    background: #fff;
    height: 64px;
    border-bottom: 1px solid #e5e7eb;
}
.content-area {
    flex-grow: 1;
}

/* Cards */
.stat-card {
    border: none;
    border-radius: 14px;
    color: #fff;
    padding: 20px;
}
.stat-card h3 { font-weight: 700; }
.bg-grad-1 { background: linear-gradient(135deg, #4b3fff, #7b6bff); }
.bg-grad-2 { background: linear-gradient(135deg, #ff7a59, #ff9f7a); }
.bg-grad-3 { background: linear-gradient(135deg, #10b981, #34d399); }
.bg-grad-4 { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* POS screen */
.pos-product-card {
    cursor: pointer;
    border-radius: 12px;
    transition: transform .1s ease;
    border: 1px solid #e5e7eb;
}
.pos-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pos-product-card .card-body { padding: 12px; }
.pos-product-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    background: #f8f9fc;
    border-radius: 8px;
}
.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
}
.product-thumb-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f2f6;
    color: #b7bcc7;
    border-radius: 8px;
    font-size: 1.3rem;
}
.product-preview {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f8f9fc;
}
.product-preview.no-image-yet {
    visibility: hidden;
}
.camera-preview {
    width: 100%;
    max-width: 360px;
    border-radius: 10px;
    background: #000;
}
.attendance-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.product-desc {
    font-size: 0.7rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 2px 0 4px;
}
.cart-panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    min-height: 100%;
}
.cart-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
}
.qty-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 1;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -240px;
        z-index: 1050;
        transition: left .2s ease;
        height: 100vh;
    }
    .sidebar.show {
        left: 0;
        box-shadow: 4px 0 16px rgba(0,0,0,0.12);
    }
}
