/**
 * assets/css/style.css
 *
 * Custom styles for the Inventory Management System.
 * Layered on top of Bootstrap 5.
 */

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
    --sidebar-width:     240px;
    --sidebar-bg:        #1e2a3a;
    --sidebar-hover:     #2c3e50;
    --sidebar-active:    #3498db;
    --sidebar-text:      #c8d6e5;
    --sidebar-text-muted:#7f8c9a;
    --topbar-height:     60px;
    --topbar-bg:         #ffffff;
    --body-bg:           #f4f6f9;
    --card-radius:       .75rem;
    --transition:        .2s ease;
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--body-bg);
    color: #2c3e50;
}

/* ─── Login Page ────────────────────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 50%, #3498db 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: var(--card-radius);
}

/* ─── App Layout ────────────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.25rem 1rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.4rem; color: var(--sidebar-active); }

.sidebar-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    padding: .9rem 1.25rem .3rem;
}

.sidebar-nav { flex: 1; padding: .5rem 0; overflow-y: auto; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
}
.sidebar-link i { font-size: 1rem; width: 1.2rem; text-align: center; }
.sidebar-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.sidebar-footer {
    padding: .75rem 1.25rem 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .8rem;
    color: var(--sidebar-text-muted);
}
.sidebar-footer a { color: var(--sidebar-text-muted); text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

/* ─── Main Content ──────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #e0e6ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: #2c3e50; }
.topbar-user  { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.topbar-user .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sidebar-active);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}

/* ─── Page Content ──────────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 1.75rem 1.5rem; }
.page-header  { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header p  { color: #6c757d; margin: .25rem 0 0; font-size: .875rem; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card { border: none; border-radius: var(--card-radius); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; border-radius: var(--card-radius) var(--card-radius) 0 0 !important; font-weight: 600; }

/* ─── Stat Cards (Dashboard) ────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon { font-size: 2rem; opacity: .85; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .9; margin-top: .2rem; }

.stat-card.blue   { background: linear-gradient(135deg,#3498db,#2980b9); }
.stat-card.green  { background: linear-gradient(135deg,#2ecc71,#27ae60); }
.stat-card.orange { background: linear-gradient(135deg,#f39c12,#e67e22); }
.stat-card.red    { background: linear-gradient(135deg,#e74c3c,#c0392b); }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table-responsive { border-radius: var(--card-radius); }
.table thead th { background: #f8f9fb; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6c757d; border-bottom: 2px solid #eef0f3; }
.table td { vertical-align: middle; font-size: .875rem; }
.table tbody tr:hover { background: #f8f9fb; }

/* ─── Badges ─────────────────────────────────────────────────────────────  */
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-low      { background: #fff3cd; color: #856404; }

/* ─── Stock type pills ──────────────────────────────────────────────────── */
.pill-in  { background: #d4edda; color: #155724; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill-out { background: #f8d7da; color: #721c24; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }

/* ─── Low-stock alert row ───────────────────────────────────────────────── */
tr.low-stock td { background: #fff9ec !important; }

/* ─── Hamburger toggle (mobile) ──────────────────────────────────────────── */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: #2c3e50; cursor: pointer; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle { display: block; }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1039;
    }
    .sidebar-overlay.show { display: block; }
}
/**
 * assets/css/style.css
 *
 * Custom styles for the Inventory Management System.
 * Layered on top of Bootstrap 5.
 */

/* ─── CSS Variables ─────────────────────────────────────────────────────── */
:root {
    --sidebar-width:     240px;
    --sidebar-bg:        #1e2a3a;
    --sidebar-hover:     #2c3e50;
    --sidebar-active:    #3498db;
    --sidebar-text:      #c8d6e5;
    --sidebar-text-muted:#7f8c9a;
    --topbar-height:     60px;
    --topbar-bg:         #ffffff;
    --body-bg:           #f4f6f9;
    --card-radius:       .75rem;
    --transition:        .2s ease;
}

/* ─── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--body-bg);
    color: #2c3e50;
}

/* ─── Login Page ────────────────────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg, #1e2a3a 0%, #2c3e50 50%, #3498db 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: var(--card-radius);
}

/* ─── App Layout ────────────────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0;
    z-index: 1040;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.25rem 1rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.4rem; color: var(--sidebar-active); }

.sidebar-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--sidebar-text-muted);
    padding: .9rem 1.25rem .3rem;
}

.sidebar-nav { flex: 1; padding: .5rem 0; overflow-y: auto; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: .9rem;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
}
.sidebar-link i { font-size: 1rem; width: 1.2rem; text-align: center; }
.sidebar-link:hover  { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }

.sidebar-footer {
    padding: .75rem 1.25rem 1rem;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: .8rem;
    color: var(--sidebar-text-muted);
}
.sidebar-footer a { color: var(--sidebar-text-muted); text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

/* ─── Main Content ──────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid #e0e6ef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: #2c3e50; }
.topbar-user  { display: flex; align-items: center; gap: .5rem; font-size: .875rem; }
.topbar-user .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sidebar-active);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
}

/* ─── Page Content ──────────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 1.75rem 1.5rem; }
.page-header  { margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-header p  { color: #6c757d; margin: .25rem 0 0; font-size: .875rem; }

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.card { border: none; border-radius: var(--card-radius); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.card-header { background: #fff; border-bottom: 1px solid #eef0f3; border-radius: var(--card-radius) var(--card-radius) 0 0 !important; font-weight: 600; }

/* ─── Stat Cards (Dashboard) ────────────────────────────────────────────── */
.stat-card {
    border-radius: var(--card-radius);
    padding: 1.25rem 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-card .stat-icon { font-size: 2rem; opacity: .85; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: .8rem; opacity: .9; margin-top: .2rem; }

.stat-card.blue   { background: linear-gradient(135deg,#3498db,#2980b9); }
.stat-card.green  { background: linear-gradient(135deg,#2ecc71,#27ae60); }
.stat-card.orange { background: linear-gradient(135deg,#f39c12,#e67e22); }
.stat-card.red    { background: linear-gradient(135deg,#e74c3c,#c0392b); }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table-responsive { border-radius: var(--card-radius); }
.table thead th { background: #f8f9fb; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6c757d; border-bottom: 2px solid #eef0f3; }
.table td { vertical-align: middle; font-size: .875rem; }
.table tbody tr:hover { background: #f8f9fb; }

/* ─── Badges ─────────────────────────────────────────────────────────────  */
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-low      { background: #fff3cd; color: #856404; }

/* ─── Stock type pills ──────────────────────────────────────────────────── */
.pill-in  { background: #d4edda; color: #155724; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.pill-out { background: #f8d7da; color: #721c24; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }

/* ─── Low-stock alert row ───────────────────────────────────────────────── */
tr.low-stock td { background: #fff9ec !important; }

/* ─── Hamburger toggle (mobile) ──────────────────────────────────────────── */
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: #2c3e50; cursor: pointer; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle { display: block; }
    .sidebar-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1039;
    }
    .sidebar-overlay.show { display: block; }
}
