*{ box-sizing:border-box; }
html{ scrollbar-gutter:stable; }
body{ margin:0; background:var(--bg); color:var(--text); font:14px/1.5 system-ui, Segoe UI, Roboto, sans-serif; }
a{ color:inherit; }
.sidebar{ position:fixed; top:0; bottom:0; left:0; width:var(--sidebar-open); background:var(--card); border-right:1px solid var(--border); display:flex; flex-direction:column; transition:width .2s; overflow:visible; z-index:1200; }
.brand{ display:flex; align-items:center; gap:.5rem; padding:.75rem 1rem; border-bottom:1px solid var(--border); }
.brand-icon{ width:12px; height:12px; border-radius:999px; background:linear-gradient(135deg,#6366f1,#60a5fa); box-shadow:0 0 0 4px rgba(99,102,241,.12); }
.brand-text{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.collapse-btn{ background:none; border:0; color:var(--text); cursor:pointer; width:32px; height:32px; border-radius:10px; }
.collapse-btn:hover{ background:var(--surface-subtle); }
.nav{ display:flex; flex-direction:column; padding:.5rem; gap:.2rem; }
.nav-item{ display:flex; align-items:center; gap:.75rem; padding:.7rem .85rem; border-radius:.75rem; color:var(--text); text-decoration:none; }
.nav-item:hover,.nav-item.is-active{ background:rgba(99,102,241,.15); }
.sidebar-footer{ margin-top:auto; padding:.75rem .5rem; border-top:1px solid var(--border); background:var(--card); }
.theme-toggle{ width:100%; text-align:left; }
.avatar{ width:42px; height:42px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#6366f1,#60a5fa); color:#fff; font-weight:700; }
.avatar.initials{ display:inline-flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#6366f1,#60a5fa); color:#fff; font-weight:700; font-size:14px; }
.user-name{ font-weight:700; }
.user-role{ font-size:12px; color:var(--muted); }
.content{ position:relative; z-index:1; background:var(--bg); margin-left:var(--sidebar-open); transition:margin-left .2s; }
.content-inner{ padding:24px var(--page-gutter) 72px; }
.sidebar + .divider{ position:fixed; top:0; bottom:0; left:var(--sidebar-open); width:1px; background:var(--border); transition:left .2s; pointer-events:none; z-index:0; }
.sidebar[data-collapsed="true"],body.sidebar-collapsed .sidebar{ width:var(--sidebar-collapsed); }
.sidebar[data-collapsed="true"] .brand-text,.sidebar[data-collapsed="true"] .nav-item span,body.sidebar-collapsed .sidebar .brand-text,body.sidebar-collapsed .sidebar .nav-item span{ display:none; }
.sidebar[data-collapsed="true"] .brand,body.sidebar-collapsed .sidebar .brand{ justify-content:center; }
.sidebar[data-collapsed="true"] ~ .content,body.sidebar-collapsed .content{ margin-left:var(--sidebar-collapsed); }
.sidebar[data-collapsed="true"] + .divider,body.sidebar-collapsed .divider{ display:none !important; }
.topbar{ max-width:var(--page-max); margin:0 auto 18px; display:flex; justify-content:flex-end; position:relative; z-index:1300; }
.user-menu{ position:relative; }
.user-menu summary{ list-style:none; }
.user-menu summary::-webkit-details-marker,.user-menu summary::marker{ display:none; }
.user-trigger{ display:flex; align-items:center; gap:.75rem; min-width:220px; padding:.65rem .85rem; border:1px solid var(--border); border-radius:16px; background:var(--surface-elevated); box-shadow:var(--shadow-elevated); cursor:pointer; }
.user-trigger:hover{ background:var(--surface-subtle); }
.user-trigger .caret{ margin-left:auto; color:var(--muted); }
.user-meta{ min-width:0; }
.user-menu__panel{ position:absolute; top:calc(100% + .5rem); right:0; width:300px; padding:.9rem; border:1px solid var(--border); border-radius:16px; background:var(--surface-elevated); box-shadow:var(--shadow-panel); opacity:0; visibility:hidden; transform:translateY(-8px); transition:opacity .18s ease, transform .18s ease, visibility .18s ease; }
.user-menu[open] .user-menu__panel{ opacity:1; visibility:visible; transform:translateY(0); }
.user-menu__header{ display:flex; gap:.85rem; align-items:center; padding-bottom:.85rem; margin-bottom:.85rem; border-bottom:1px solid var(--border); }
.user-menu__actions{ display:grid; gap:.45rem; }
.user-menu__action{ display:flex; align-items:center; gap:.65rem; width:100%; padding:.75rem .8rem; border:1px solid var(--border); border-radius:12px; background:var(--card); text-decoration:none; }
.user-menu__action:hover{ background:var(--surface-subtle); }
.page-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; max-width:var(--page-max); margin:0 auto 20px; }
.page-head h1{ margin:0; font-size:32px; line-height:1.1; }
.page-head p{ margin:8px 0 0; color:var(--muted); }
.head-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.dashboard-grid{ display:grid; grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr); gap:20px; max-width:var(--page-max); margin:0 auto; }
.stack{ display:grid; gap:20px; }
.card{ background:var(--card); border:1px solid var(--border); border-radius:18px; padding:22px; box-shadow:var(--shadow-elevated); }
.card h2,.card h3{ margin:0 0 10px; font-size:20px; }
.small{ font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.metrics{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-top:18px; }
.metric{ background:var(--surface-subtle); border:1px solid var(--border); border-radius:16px; padding:15px; }
.metric .k{ font-size:12px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.metric .v{ font-size:24px; font-weight:700; margin-top:6px; }
.form-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.form-grid.wide{ grid-template-columns:repeat(4,1fr); }
label{ display:block; font-size:13px; font-weight:600; margin-bottom:6px; color:var(--text); }
input,select,textarea{ width:100%; box-sizing:border-box; padding:11px 12px; border:1px solid var(--border); border-radius:12px; background:var(--surface-input); color:var(--text); }
textarea{ min-height:110px; resize:vertical; }
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 14px; border-radius:12px; border:1px solid var(--border); background:var(--card); color:var(--text); text-decoration:none; cursor:pointer; }
.btn.primary{ background:var(--accent); color:#fff; border-color:transparent; }
.btn.danger{ background:#991b1b; color:#fff; border-color:#991b1b; }
.actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:16px; flex-wrap:wrap; }
.toolbar{ max-width:var(--page-max); margin:0 auto 16px; display:flex; gap:.5rem; justify-content:flex-end; flex-wrap:wrap; }
.alert{ margin:0 auto 16px; max-width:var(--page-max); padding:12px 14px; border-radius:12px; border:1px solid; }
.alert.success{ background:#dcfce7; color:#166534; border-color:#86efac; }
.alert.error{ background:#fee2e2; color:#991b1b; border-color:#fca5a5; }
.table-card{ max-width:var(--page-max); margin:0 auto; }
.table-wrap{ overflow:auto; border:1px solid var(--border); border-radius:16px; }
table{ width:100%; border-collapse:collapse; }
th,td{ text-align:left; padding:12px 10px; border-bottom:1px solid var(--border); vertical-align:top; }
th{ font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); background:rgba(96,165,250,.02); }
tr:last-child td{ border-bottom:none; }
.section-title{ max-width:var(--page-max); margin:0 auto 6px; }
.section-divider{ max-width:var(--page-max); margin:0 auto 16px; border:0; border-top:1px solid var(--border); }
.mono{ font-family:Consolas, monospace; word-break:break-all; }
.badge{ display:inline-flex; padding:.15rem .45rem; border-radius:.35rem; font-size:12px; font-weight:600; }
.badge.active,.badge.enabled,.badge-green{ background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.badge.revoked,.badge.disabled,.badge-red{ background:#fee2e2; color:#991b1b; border:1px solid #fecaca; }
.badge.expired{ background:#fef3c7; color:#92400e; }
.badge-blue{ background:#e0f2fe; color:#075985; border:1px solid #bae6fd; }
.badge-gray{ background:#f1f5f9; color:#334155; border:1px solid #e2e8f0; }
.profile-wrap{ max-width:900px; margin:0 auto; }
.profile-card{ display:grid; grid-template-columns:minmax(220px,240px) minmax(320px,1fr); gap:1.25rem; align-items:start; }
.avatar-box{ display:flex; flex-direction:column; align-items:center; gap:.85rem; }
.avatar-big{ width:160px; height:160px; border-radius:9999px; overflow:hidden; border:1px solid var(--border); background:linear-gradient(135deg,#6366f1,#60a5fa); display:flex; align-items:center; justify-content:center; color:#fff; font-size:48px; font-weight:800; }
.avatar-big img{ width:100%; height:100%; object-fit:cover; display:block; }
.info-grid{ display:grid; grid-template-columns:minmax(120px,140px) minmax(0,1fr); gap:.55rem 1rem; align-items:center; }
.info-grid .label{ color:var(--muted); font-size:.92rem; }
.info-grid .value{ word-break:break-word; line-height:1.6; }
.pw-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; max-width:720px; margin:0 auto; }
.modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; background:rgba(0,0,0,.45); z-index:1600; padding:20px; }
.modal.open{ display:flex; }
.modal .card{ width:min(920px,96vw); max-height:90vh; overflow:auto; }
.actions-menu summary{ list-style:none; cursor:pointer; padding:8px 10px; border:1px solid var(--border); border-radius:10px; display:inline-flex; align-items:center; justify-content:center; }
.actions-menu summary::-webkit-details-marker,.actions-menu summary::marker{ display:none; }
.actions-menu{ position:relative; display:none; }
.actions__list{ position:absolute; right:0; top:calc(100% + .35rem); display:grid; gap:.35rem; min-width:140px; padding:.5rem; background:var(--card); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-elevated); z-index:20; }
pre{ margin:0; white-space:pre-wrap; overflow:auto; background:var(--surface-subtle); border:1px solid var(--border); border-radius:14px; padding:14px; }
.site-footer{ position:fixed; left:var(--sidebar-open); right:0; bottom:0; height:44px; background:var(--card); border-top:1px solid var(--border); z-index:500; }
.site-footer__inner{ max-width:var(--page-max); margin:0 auto; height:100%; padding:0 16px; display:flex; align-items:center; justify-content:flex-end; color:var(--muted); font-size:12px; }
body.sidebar-collapsed .site-footer{ left:var(--sidebar-collapsed); }
body.auth{ min-height:100vh; display:grid; place-items:center; background:radial-gradient(circle at top left, rgba(96,165,250,.24), transparent 28%),radial-gradient(circle at bottom right, rgba(99,102,241,.18), transparent 30%),var(--bg); }
.auth-card{ width:min(440px,92vw); background:var(--card); border:1px solid var(--border); border-radius:22px; box-shadow:var(--shadow-panel); padding:28px; }
.auth-card h1{ margin:0 0 8px; font-size:30px; }
.auth-card p{ margin:0 0 18px; color:var(--muted); }
@media (max-width:1200px){ .dashboard-grid{ grid-template-columns:1fr; } .metrics{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:900px){ .profile-card,.pw-grid{ grid-template-columns:1fr; } .info-grid{ grid-template-columns:1fr; } }
@media (max-width:720px){ .sidebar{ position:static; width:100%; height:auto; border-right:0; border-bottom:1px solid var(--border); } .content,body.sidebar-collapsed .content{ margin-left:0; } .sidebar + .divider,.site-footer{ display:none; } .content-inner{ padding:16px; } .page-head,.form-grid,.form-grid.wide,.metrics{ grid-template-columns:1fr; } .page-head{ display:grid; } .toolbar{ justify-content:stretch; } .toolbar > *{ width:100%; } .actions{ display:none; } .actions-menu{ display:inline-block; } .user-trigger{ min-width:auto; width:100%; } .topbar{ margin-bottom:14px; } }
