/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: #1e293b; background: #f1f5f9; }
a { text-decoration: none; color: inherit; }

/* ===== LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; overflow-x: hidden; }
.content-wrapper { padding: 24px; max-width: 1200px; }

/* ===== SIDEBAR ===== */
.sidebar { width: 220px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 20px 16px; font-size: 16px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #334155; }
.brand-icon { font-size: 20px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #94a3b8; transition: all .15s; border-left: 3px solid transparent; }
.nav-item:hover { background: #334155; color: #e2e8f0; }
.nav-item.active { background: #334155; color: #fff; border-left-color: #3b82f6; }
.nav-icon { font-size: 16px; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid #334155; display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.user-role { font-size: 11px; color: #64748b; }
.btn-logout { font-size: 18px; color: #64748b; cursor: pointer; padding: 4px; border-radius: 4px; }
.btn-logout:hover { color: #ef4444; background: #334155; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: #0f172a; }

/* ===== CARDS ===== */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: 10px; padding: 18px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); border-left: 4px solid; }
.stat-card.green { border-color: #22c55e; }
.stat-card.red { border-color: #ef4444; }
.stat-card.blue { border-color: #3b82f6; }
.stat-card.orange { border-color: #f97316; }
.stat-card.purple { border-color: #a855f7; }
.stat-icon { font-size: 24px; font-weight: 700; opacity: .6; }
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 18px; font-weight: 700; color: #0f172a; margin-top: 2px; }

/* ===== TABLE ===== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 16px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.table th { background: #f8fafc; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #64748b; }
.table tbody tr:hover { background: #f8fafc; }
.table tfoot td { background: #f8fafc; font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #94a3b8; }
.text-green { color: #16a34a; }
.text-red { color: #dc2626; }
.fw-bold { font-weight: 600; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-orange { background: #ffedd5; color: #ea580c; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-purple { background: #f3e8ff; color: #9333ea; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 5px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; color: #1e293b; background: #fff; transition: border-color .15s; }
.form-control:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
.filter-form .form-control { width: auto; }

/* ===== ALERTS ===== */
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ===== GRID ===== */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col-md-4 { flex: 0 0 calc(33.333% - 11px); min-width: 280px; }
.col-md-5 { flex: 0 0 calc(41.666% - 8px); min-width: 280px; }
.col-md-7 { flex: 0 0 calc(58.333% - 8px); min-width: 280px; }
.col-md-8 { flex: 0 0 calc(66.666% - 5px); min-width: 280px; }

/* ===== MGMT TABS ===== */
.mgmt-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.mgmt-tabs .tab { padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 500; color: #64748b; background: #fff; border: 1px solid #e2e8f0; }
.mgmt-tabs .tab:hover { background: #f1f5f9; }
.mgmt-tabs .tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* ===== CHECKBOX LABEL ===== */
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ===== LOGIN PAGE ===== */
.login-page { background: linear-gradient(135deg, #1e293b 0%, #334155 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 380px; padding: 16px; }
.login-box { background: #fff; border-radius: 12px; padding: 36px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h2 { font-size: 24px; font-weight: 700; color: #0f172a; text-align: center; }
.login-box .subtitle { text-align: center; color: #64748b; font-size: 13px; margin: 4px 0 24px; }
