:root { --sidebar-w: 240px; --sidebar-bg: #1f2937; --sidebar-fg: #cbd5e1; --sidebar-active: #2563eb; }
body { background: #f4f6fa; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }

/* Login */
.login-page { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 400px; padding: 1rem; }
.login-logo { font-size: 3rem; color: #2563eb; }
.login-page .text-muted { color: #cbd5e1 !important; }

/* Layout */
.app-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-fg); overflow-y: auto; z-index: 1030; }
.app-sidebar .brand { padding: 1rem 1.25rem; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .5rem; }
.app-sidebar .nav-link { color: var(--sidebar-fg); padding: .55rem 1.25rem; border-radius: 0; display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.app-sidebar .nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.app-sidebar .nav-link.active { background: var(--sidebar-active); color: #fff; }
.app-sidebar .nav-section { padding: .75rem 1.25rem .25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.app-topbar { background: #fff; padding: .65rem 1.25rem; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1020; }
.app-content { padding: 1.25rem; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-header h4 { margin: 0; }

.card-table { border: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.table thead th { background: #f9fafb; font-weight: 600; font-size: .85rem; }
.table td, .table th { vertical-align: middle; }

@media (max-width: 768px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .app-sidebar.show { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

/* Sidebar search */
.sidebar-search { padding: .5rem .75rem .25rem; }
.sidebar-search input {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: #fff; font-size: .85rem;
}
.sidebar-search input::placeholder { color: #94a3b8; }
.sidebar-search input:focus { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: none; }

/* Collapsed-to-icons mode */
body.sidebar-icons { --sidebar-w: 64px; }
body.sidebar-icons .app-sidebar .brand-label,
body.sidebar-icons .app-sidebar .sidebar-search,
body.sidebar-icons .app-sidebar .sb-section-toggle,
body.sidebar-icons .app-sidebar .nav-link-label { display: none !important; }
body.sidebar-icons .app-sidebar .brand { justify-content: center; padding: .75rem .25rem; }
body.sidebar-icons .app-sidebar .nav-link {
  justify-content: center; padding: .65rem 0; gap: 0;
}
body.sidebar-icons .app-sidebar .nav-link i { font-size: 1.1rem; }
body.sidebar-icons .app-sidebar .sb-section { border-top: 1px solid rgba(255,255,255,.05); }
body.sidebar-icons .app-sidebar .sb-section-items { max-height: none !important; }
body.sidebar-icons .app-sidebar #sbSearchEmpty { display: none !important; }
