/**
 * General Store Management System - Custom Styles
 */

:root {
    --sidebar-width: 260px;
    --primary-color: #0d6efd;
    --sidebar-bg: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #1e3a5f 0%, #0d6efd 50%, #6610f2 100%);
}

.login-card {
    border-radius: 16px;
}

.login-icon-wrap {
    width: 72px;
    height: 72px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #0d6efd;
}

.welcome-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    border-left: 4px solid var(--primary-color) !important;
}

.profile-avatar-lg {
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.avatar-placeholder,
.avatar-placeholder-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    border-radius: 50%;
}

.avatar-placeholder { width: 36px; height: 36px; }
.avatar-placeholder-sm { width: 32px; height: 32px; font-size: 0.9rem; }

.letter-spacing-2 { letter-spacing: 0.5em; }

/* Layout */
.wrapper {
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow: hidden !important;
}

.sidebar-header {
    flex: 0 0 auto;
}

.sidebar-nav {
    flex: 1 1 auto;
    height: calc(100vh - 72px);
    max-height: calc(100vh - 72px);
    min-height: 0;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    padding-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #888 #000;
}

.sidebar-nav::-webkit-scrollbar {
    width: 12px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #000;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
    border: 2px solid #000;
    min-height: 40px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.sidebar .nav-link {
    border-radius: 8px;
    margin-bottom: 4px;
    padding: 10px 16px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff !important;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Product Thumbnail */
.product-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
}

/* Cards */
.card {
    border-radius: 12px;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

/* Responsive Sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
}

/* Pagination */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
}

/* Transaction badges */
.badge.STOCK_IN, .badge.bg-success { }
.transaction-stock-in { background-color: #198754 !important; }
.transaction-stock-out { background-color: #dc3545 !important; }

/* Activity table compact */
.table td small { font-size: 0.8rem; }

/* Sell product form */
#sellBtn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Profit & Margin module */
.profit-month-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.profit-month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}
.profit-stat-card {
    transition: box-shadow 0.2s ease;
}
.profit-stat-card:hover {
    box-shadow: 0 0.35rem 0.75rem rgba(0, 0, 0, 0.08) !important;
}
.stat-card.border-start {
    border-left-width: 4px !important;
}
