/* ============================================================
   PROINVENTORY - MAIN STYLESHEET
   Bootstrap 5 + Custom
============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a2d4a;
    --sidebar-text: #a0aec0;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(232,93,26,0.25);
    --sidebar-hover-bg: rgba(255,255,255,0.07);
    --primary: #e85d1a;
    --primary-dark: #c44d12;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg: #f0f4f8;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --topbar-height: 60px;
    font-family: 'Nunito', sans-serif;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Nunito', sans-serif; }

/* ---- SIDEBAR ---- */
#sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-brand {
    padding: 20px 20px;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.5px;
    display: flex; align-items: center;
}
.sidebar-brand i { color: var(--primary); font-size: 1.4rem; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section {
    padding: 14px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
}
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover-bg);
}
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(232,93,26,0.2);
    border-left-color: #e85d1a;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 0.9rem; }

/* ---- MAIN CONTENT ---- */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}
#main-content.sidebar-collapsed { margin-left: 0; }
#sidebar.collapsed { transform: translateX(-100%); }

/* ---- TOPBAR ---- */
.top-navbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky; top: 0; z-index: 999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sidebar-toggle {
    background: none; border: 1px solid var(--border);
    color: var(--text-muted); border-radius: 8px;
    width: 36px; height: 36px;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.user-avatar {
    width: 36px; height: 36px;
    background: var(--primary);
    color: #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem;
}

/* ---- CONTENT AREA ---- */
.content-area { padding: 28px; }

/* ---- CARDS ---- */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    background: var(--card-bg);
}
.card-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 14px 14px 0 0 !important;
    font-weight: 700;
}

/* ---- STAT CARDS ---- */
.stat-card {
    border-radius: 14px;
    padding: 24px;
    color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-label { font-size: 0.8rem; font-weight: 600; opacity: 0.85; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; }
.stat-card .stat-sub { font-size: 0.75rem; opacity: 0.75; margin-top: 4px; }
.stat-card .stat-icon { font-size: 2.8rem; opacity: 0.3; }
.bg-stat-blue  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-stat-green { background: linear-gradient(135deg, #10b981, #047857); }
.bg-stat-orange{ background: linear-gradient(135deg, #f59e0b, #b45309); }
.bg-stat-red   { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.bg-stat-purple{ background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.bg-stat-teal  { background: linear-gradient(135deg, #06b6d4, #0e7490); }

/* ---- TABLES ---- */
.table-card { border-radius: 14px; overflow: hidden; }
.table thead th {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    padding: 12px 16px;
}
.table tbody td { padding: 12px 16px; vertical-align: middle; font-size: 0.875rem; }
.table tbody tr:hover { background: #f8fafc; }

/* ---- BADGES ---- */
.badge { font-weight: 600; letter-spacing: 0.3px; }

/* ---- STOCK LEVELS ---- */
.stock-low { color: var(--danger); font-weight: 700; }
.stock-ok  { color: var(--success); font-weight: 600; }

/* ---- BUTTONS ---- */
.btn { font-weight: 600; border-radius: 8px; }
.btn-primary { background: var(--primary) !important; border-color: var(--primary) !important; color:#fff !important; }
.btn-primary:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

/* ---- FORMS ---- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    padding: 9px 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-label { font-weight: 600; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 5px; }

/* ---- LOGIN PAGE ---- */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2d4a 0%, #e85d1a 60%, #1a2d4a 100%);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: "";
    position: absolute;
    width: 500px; height: 500px;
    background: rgba(232,93,26,0.15);
    border-radius: 50%;
    top: -100px; right: -100px;
}
.login-wrapper::after {
    content: "";
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(26,45,74,0.2);
    border-radius: 50%;
    bottom: -80px; left: -80px;
}
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 44px;
    width: 100%; max-width: 440px;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    position: relative; z-index: 1;
}
.login-logo { font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 28px; }

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom: 24px; }
.page-header h4 { font-weight: 800; margin: 0; }
.page-header .breadcrumb { font-size: 0.8rem; }

/* ---- INVOICE ---- */
.invoice-box { background: #fff; padding: 40px; border-radius: 14px; }
.invoice-header { border-bottom: 2px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }

/* ---- ALERTS ---- */
.alert { border-radius: 10px; font-size: 0.875rem; font-weight: 600; }

/* ---- PROGRESS BARS ---- */
.progress { border-radius: 10px; height: 8px; }
.progress-bar { border-radius: 10px; }

/* ---- DATATABLE OVERRIDES ---- */
.dataTables_wrapper .dataTables_filter input { border-radius: 8px; }
.dataTables_wrapper .dataTables_length select { border-radius: 8px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.mobile-open { transform: translateX(0); }
    #main-content { margin-left: 0; }
    .content-area { padding: 16px; }
    .stat-card { padding: 18px; }
    .stat-card .stat-icon { font-size: 2rem; }
}

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-primary { color: var(--primary) !important; }
.rounded-pill { border-radius: 50px !important; }

/* ── Product Image Upload ── */
.image-upload-box {
    width:100%; height:180px; border:2px dashed #3b82f6; border-radius:12px;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    cursor:pointer; background:#f8fafc; transition:all .2s; overflow:hidden; position:relative;
}
.image-upload-box:hover { background:#eff6ff; border-color:#1d4ed8; }

/* ── Product Grid Cards ── */
.product-card { border-radius:12px; transition:transform .2s,box-shadow .2s; }
.product-card:hover { transform:translateY(-3px); box-shadow:0 8px 20px rgba(0,0,0,.12); }
.product-img-wrap { position:relative; width:100%; height:130px; overflow:hidden; border-radius:12px 12px 0 0; background:#f8fafc; }
.product-img { width:100%; height:100%; object-fit:cover; }
.product-img-placeholder { width:100%; height:100%; display:flex; align-items:center; justify-content:center; }
.stock-badge { position:absolute; top:6px; right:6px; font-size:9px; }
.gst-badge { position:absolute; top:6px; left:6px; font-size:9px; background:rgba(30,130,76,.9); color:#fff; padding:2px 7px; border-radius:20px; font-weight:700; }

/* ---- Extra button sizes ---- */
.btn-xs { padding: 2px 7px; font-size: 11px; border-radius: 4px; line-height: 1.5; }

