/* ============================================
   TOKO JUSRON — Main Stylesheet
   ============================================ */

:root {
    --primary: #1a56db;
    --primary-dark: #1343b0;
    --primary-light: #e8f0fe;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-width: 240px;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #1a56db;
    --topbar-height: 60px;
    --bg: #f1f5f9;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --font: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    display: flex;
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand i { font-size: 20px; color: var(--accent); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
    padding: 16px 10px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: all .15s;
    margin-bottom: 2px;
}

.nav-item i { font-size: 16px; width: 20px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--sidebar-text); }

.btn-logout {
    color: var(--sidebar-text);
    font-size: 18px;
    text-decoration: none;
    padding: 4px;
    transition: color .15s;
}
.btn-logout:hover { color: var(--danger); }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
}

.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.btn-toggle-sidebar {
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-muted); padding: 4px;
    display: none;
}

.page-title {
    font-size: 16px; font-weight: 700; flex: 1;
}

.badge-role {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
}

.content-wrapper { padding: 24px 20px; flex: 1; }

/* ---- CARDS ---- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header-custom {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-header-custom h5 {
    font-size: 15px; font-weight: 700; margin: 0;
}

/* ---- STAT CARDS ---- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: #d1fae5; color: var(--success); }
.stat-icon.yellow { background: #fef3c7; color: var(--warning); }
.stat-icon.red { background: #fee2e2; color: var(--danger); }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- TABLES ---- */
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom th {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted);
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-custom td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table-custom tr:last-child td { border-bottom: none; }
.table-custom tr:hover td { background: #f8fafc; }

/* ---- FORMS ---- */
.form-label { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color .15s, box-shadow .15s;
    font-family: var(--font);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
    outline: none;
}

/* ---- BUTTONS ---- */
.btn { font-family: var(--font); font-weight: 600; border-radius: 8px; font-size: 13px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

/* ---- STOK BADGE ---- */
.kode-barang { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ---- ALERT ---- */
.alert { border-radius: 10px; font-size: 13px; border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .btn-toggle-sidebar { display: block; }
    .content-wrapper { padding: 16px 14px; }
    .stat-value { font-size: 18px; }
}
