* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --sidebar-bg: #303a4f; --sidebar-hover: #3d4a63; --accent: #189eff;
  --bg: #f4f6f8; --card: #ffffff; --text: #2b3852; --muted: #7a8ba6;
  --border: #e3e8ef;
}
body { font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); }
.layout { display: flex; min-height: 100vh; }

.sidebar { width: 250px; background: var(--sidebar-bg); color: #cdd5e3; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { font-size: 18px; font-weight: 700; color: #fff; padding: 22px 20px; letter-spacing: .3px; }
.brand span { color: var(--accent); font-weight: 400; margin-left: 6px; }
.nav { flex: 1; padding: 8px 12px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #cdd5e3; text-decoration: none; font-size: 14px; margin-bottom: 2px; transition: background .15s; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item svg, .nav-group-title svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-group { margin-top: 14px; }
.nav-group-title { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: #8d9bb5; }
.nav-sub { padding-left: 40px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #3d4a63; }
.user-mail { font-size: 12px; color: #8d9bb5; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { width: 100%; padding: 8px; background: transparent; border: 1px solid #4a5871; border-radius: 8px; color: #cdd5e3; font-size: 13px; cursor: pointer; }
.btn-logout:hover { background: var(--sidebar-hover); color: #fff; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 18px 28px; }
.topbar h1 { font-size: 20px; font-weight: 600; }
.content { padding: 28px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 16px; margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat { margin-bottom: 0; }
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.table td { padding: 12px; border-bottom: 1px solid var(--border); }
.table .empty { text-align: center; color: var(--muted); padding: 40px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.login-card { background: var(--card); border-radius: 14px; padding: 40px; width: 380px; max-width: calc(100vw - 40px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.brand-login { color: var(--text); padding: 0 0 24px; text-align: center; font-size: 22px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.login-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.btn-primary { width: 100%; margin-top: 22px; padding: 12px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { filter: brightness(1.08); }
.login-error { background: #fdecec; color: #c0392b; border: 1px solid #f5c6c6; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 6px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-green { background: #e3f6e8; color: #1c7c3c; }
.badge-blue { background: #e1f1ff; color: #0d6dbb; }
.badge-yellow { background: #fdf3dc; color: #a3720a; }
.badge-red { background: #fdecec; color: #c0392b; }
.badge-gray { background: #eef1f5; color: #64748c; }

.table .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.table .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.filter-tabs { display: flex; gap: 6px; }
.filter-tab { padding: 6px 14px; border-radius: 20px; font-size: 13px; text-decoration: none; color: var(--muted); border: 1px solid var(--border); }
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.table-count { font-size: 13px; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 16px; font-size: 14px; }
.pagination a { color: var(--accent); text-decoration: none; font-weight: 600; }
.pagination span { color: var(--muted); }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; }
}
