/* ============================================
   Jewellery Shop Management - Custom CSS
   ============================================ */

:root {
    --gold:        #D4AF37;
    --gold-dark:   #B8960C;
    --gold-light:  #FFF8DC;
    --sidebar-bg:  #1a1a2e;
    --sidebar-w:   260px;
    --topbar-h:    65px;
}

/* ---- Body ---- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
body.login-body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(212,175,55,0.4);
}

.login-header h3 {
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 5px;
}

.login-header p {
    color: #888;
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

/* ============================================
   LAYOUT
   ============================================ */
.wrapper {
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    flex-shrink: 0;
    transition: width 0.3s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-header h4,
.sidebar.collapsed .sidebar-header small,
.sidebar.collapsed .sidebar-menu span,
.sidebar.collapsed .menu-header { display: none; }

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 14px;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.shop-logo {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(212,175,55,0.3);
}

.sidebar-header h4 {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 3px;
}

.sidebar-header small {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

.sidebar-menu {
    padding: 15px 0;
    margin: 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.25s;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background: rgba(212,175,55,0.15);
    color: var(--gold);
    border-left-color: var(--gold);
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.menu-header {
    padding: 15px 20px 5px;
}

.menu-header small {
    color: rgba(255,255,255,0.3);
    font-size: 0.7rem;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content.expanded {
    /* when sidebar collapses */
}

/* ---- Topbar ---- */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    height: var(--topbar-h);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ---- Content Area ---- */
.content-area {
    background: #f0f2f5;
    min-height: calc(100vh - var(--topbar-h));
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    border-radius: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.bg-primary-light  { background: rgba(13,110,253,0.1);  }
.bg-success-light  { background: rgba(25,135,84,0.1);   }
.bg-warning-light  { background: rgba(255,193,7,0.1);   }
.bg-danger-light   { background: rgba(220,53,69,0.1);   }

/* ============================================
   BUTTONS
   ============================================ */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    border: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark), #9a7a0a);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(212,175,55,0.4);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border-radius: 12px;
}

/* ============================================
   TEXT COLORS
   ============================================ */
.text-gold { color: var(--gold); }

/* ============================================
   BADGE GOLD
   ============================================ */
.badge.bg-gold {
    background: var(--gold);
    color: #fff;
}

/* ============================================
   FORMS
   ============================================ */
.form-control:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 0.2rem rgba(212,175,55,0.25);
}

/* ============================================
   TABLES
   ============================================ */
.table th { font-size: 0.85rem; letter-spacing: 0.5px; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .topbar,
    .d-print-none,
    .btn,
    .alert { display: none !important; }

    .main-content { margin: 0 !important; }
    .content-area { background: #fff !important; padding: 0 !important; }

    #billPrint,
    #loanPrint {
        box-shadow: none !important;
        border: none !important;
    }

    body { background: #fff !important; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s;
    }

    .sidebar.mobile-open {
        left: 0;
    }

    .main-content {
        width: 100%;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
}