:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0d1117;
  --sidebar-border: #21262d;
  --sidebar-text: #8b949e;
  --sidebar-active: #58a6ff;
  --topbar-height: 56px;
  --brand-color: #58a6ff;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: #f6f8fa; color: #1f2328; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-width);
  background: var(--sidebar-bg); display: flex; flex-direction: column;
  z-index: 1000; transition: transform .3s ease; overflow-y: auto;
}
.sidebar-header { padding: 1.25rem 1rem; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; }
.brand-icon { width: 40px; height: 40px; background: linear-gradient(135deg, #1f6feb, #58a6ff); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; flex-shrink: 0; }
.brand-name { color: #e6edf3; font-weight: 700; font-size: 1rem; line-height: 1.2; }
.brand-sub { color: var(--sidebar-text); font-size: .7rem; }

.sidebar-nav { padding: .75rem .5rem; flex: 1; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; color: var(--sidebar-text); text-decoration: none; border-radius: 8px; margin-bottom: 2px; font-size: .875rem; transition: all .15s; }
.sidebar-nav .nav-link:hover { background: #161b22; color: #e6edf3; }
.sidebar-nav .nav-link.active { background: #1f3a5f; color: var(--sidebar-active); font-weight: 500; }
.sidebar-nav .nav-link i { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--sidebar-border); }
.user-info { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.user-avatar { width: 32px; height: 32px; background: linear-gradient(135deg,#1f6feb,#58a6ff); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.user-name { color: #e6edf3; font-size: .8rem; font-weight: 600; line-height: 1.2; }
.user-role { color: var(--sidebar-text); font-size: .7rem; }

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

/* ── TOPBAR ── */
.topbar { height: var(--topbar-height); background: #fff; border-bottom: 1px solid #d0d7de; display: flex; align-items: center; padding: 0 1.25rem; gap: .75rem; position: sticky; top: 0; z-index: 100; }
.topbar-title { font-weight: 600; color: #1f2328; font-size: .95rem; }
.sidebar-toggle { background: none; border: 1px solid #d0d7de; border-radius: 8px; padding: .3rem .5rem; cursor: pointer; display: none; }

/* ── PAGE CONTENT ── */
.page-content { padding: 1.5rem; flex: 1; }

/* ── STAT CARDS ── */
.stat-card { background: #fff; border: 1px solid #d0d7de; border-radius: 12px; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: #1f2328; line-height: 1.2; }
.stat-label { font-size: .75rem; color: #656d76; margin-top: 2px; }

/* ── CARDS ── */
.card { border: 1px solid #d0d7de; border-radius: 12px; }
.card-header { background: #f6f8fa; border-bottom: 1px solid #d0d7de; padding: .75rem 1rem; font-weight: 600; }

/* ── TABLES ── */
.table { font-size: .875rem; }
.table thead th { background: #f6f8fa; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: #656d76; border-bottom: 1px solid #d0d7de; }
.table-hover tbody tr:hover { background: #f6f8fa; }

/* ── FORMS ── */
.form-control, .form-select { border-color: #d0d7de; border-radius: 8px; font-size: .875rem; }
.form-control:focus, .form-select:focus { border-color: #0969da; box-shadow: 0 0 0 3px rgba(9,105,218,.1); }
.form-label { font-weight: 500; font-size: .875rem; color: #1f2328; }

/* ── BUTTONS ── */
.btn { border-radius: 8px; font-size: .875rem; font-weight: 500; }
.btn-primary { background: #0969da; border-color: #0969da; }
.btn-primary:hover { background: #0860ca; }

/* ── BADGES ── */
.badge { font-size: .7rem; font-weight: 500; border-radius: 6px; }

/* ── ASSET CARDS ── */
.asset-card { transition: transform .15s, box-shadow .15s; }
.asset-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

/* ── PAGINATION ── */
.pagination .page-link { border-color: #d0d7de; color: #0969da; border-radius: 8px; margin: 0 2px; }
.pagination .page-item.active .page-link { background: #0969da; border-color: #0969da; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* ── RESPONSIVE ── */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; align-items: center; }
  .page-content { padding: 1rem; }
  .stat-value { font-size: 1.1rem; }
}

@media (max-width: 575.98px) {
  .page-content { padding: .75rem; }
  .stat-card { padding: 1rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1rem; }
  .topbar { padding: 0 .75rem; }
}

/* ── LOGIN PAGE ── */
.login-page { min-height: 100vh; background: var(--sidebar-bg); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { background: #161b22; border: 1px solid #21262d; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo .brand-icon { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 14px; margin: 0 auto 1rem; }
.login-logo h4 { color: #e6edf3; margin: 0; }
.login-logo p { color: var(--sidebar-text); font-size: .85rem; margin: 0; }
.login-card .form-control { background: #0d1117; border-color: #30363d; color: #e6edf3; }
.login-card .form-control:focus { border-color: #58a6ff; background: #0d1117; color: #e6edf3; }
.login-card .form-label { color: #8b949e; }
