Files

858 lines
23 KiB
CSS

/* ─── NX9-Auth Enterprise UI ─────────────────────────────────────────────── */
:root {
--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
--radius-sm: 6px;
--radius: 10px;
--radius-lg: 14px;
--header-h: 56px;
--sidebar-w: 240px;
--sidebar-w-collapsed: 64px;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
--shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
--transition: 150ms ease;
/* Light palette (GitHub / Linear inspired) */
--bg: #f6f8fa;
--bg-elevated: #ffffff;
--bg-muted: #eef1f5;
--bg-hover: #e8ecf1;
--border: #d0d7de;
--border-muted: #e6ebf0;
--text: #1f2328;
--text-secondary: #656d76;
--text-muted: #8b949e;
--text-inverse: #ffffff;
--accent: #2563eb;
--accent-hover: #1d4ed8;
--accent-soft: rgba(37, 99, 235, 0.1);
--success: #1a7f37;
--success-soft: rgba(26, 127, 55, 0.12);
--warning: #9a6700;
--warning-soft: rgba(154, 103, 0, 0.12);
--danger: #cf222e;
--danger-soft: rgba(207, 34, 46, 0.12);
--info: #0969da;
--info-soft: rgba(9, 105, 218, 0.12);
--glass: rgba(255, 255, 255, 0.72);
--glass-border: rgba(255, 255, 255, 0.4);
--overlay: rgba(15, 23, 42, 0.45);
--focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
[data-theme="dark"] {
--bg: #0d1117;
--bg-elevated: #161b22;
--bg-muted: #21262d;
--bg-hover: #2a3139;
--border: #30363d;
--border-muted: #21262d;
--text: #e6edf3;
--text-secondary: #aab2bb;
--text-muted: #7d8590;
--text-inverse: #0d1117;
--accent: #58a6ff;
--accent-hover: #79b8ff;
--accent-soft: rgba(88, 166, 255, 0.15);
--success: #3fb950;
--success-soft: rgba(63, 185, 80, 0.15);
--warning: #d29922;
--warning-soft: rgba(210, 153, 34, 0.15);
--danger: #f85149;
--danger-soft: rgba(248, 81, 73, 0.15);
--info: #58a6ff;
--info-soft: rgba(88, 166, 255, 0.15);
--glass: rgba(22, 27, 34, 0.78);
--glass-border: rgba(48, 54, 61, 0.8);
--overlay: rgba(0, 0, 0, 0.6);
--focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.4);
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
--shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #0d1117;
--bg-elevated: #161b22;
--bg-muted: #21262d;
--bg-hover: #2a3139;
--border: #30363d;
--border-muted: #21262d;
--text: #e6edf3;
--text-secondary: #aab2bb;
--text-muted: #7d8590;
--text-inverse: #0d1117;
--accent: #58a6ff;
--accent-hover: #79b8ff;
--accent-soft: rgba(88, 166, 255, 0.15);
--success: #3fb950;
--success-soft: rgba(63, 185, 80, 0.15);
--warning: #d29922;
--warning-soft: rgba(210, 153, 34, 0.15);
--danger: #f85149;
--danger-soft: rgba(248, 81, 73, 0.15);
--info: #58a6ff;
--info-soft: rgba(88, 166, 255, 0.15);
--glass: rgba(22, 27, 34, 0.78);
--glass-border: rgba(48, 54, 61, 0.8);
--overlay: rgba(0, 0, 0, 0.6);
--focus-ring: 0 0 0 3px rgba(88, 166, 255, 0.4);
}
}
/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
font-family: var(--font);
font-size: 14px;
line-height: 1.5;
color: var(--text);
background: var(--bg);
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }
code, kbd {
font-family: var(--mono);
font-size: 0.9em;
background: var(--bg-muted);
padding: 0.1em 0.35em;
border-radius: 4px;
}
/* ─── Shell ──────────────────────────────────────────────────────────────── */
.app-shell {
display: grid;
grid-template-rows: var(--header-h) 1fr;
grid-template-columns: var(--sidebar-w) 1fr;
grid-template-areas:
"header header"
"sidebar main";
min-height: 100vh;
}
.app-shell.sidebar-collapsed {
grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}
.app-header {
grid-area: header;
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
gap: 1rem;
padding: 0 1rem;
height: var(--header-h);
background: var(--glass);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
}
.app-header .brand {
display: flex;
align-items: center;
gap: 0.6rem;
font-weight: 700;
color: var(--text);
text-decoration: none;
min-width: 140px;
}
.app-header .brand:hover { text-decoration: none; }
.app-header .brand-mark {
width: 28px; height: 28px;
border-radius: 8px;
background: linear-gradient(135deg, var(--accent), #7c3aed);
display: grid; place-items: center;
color: white; font-size: 13px; font-weight: 800;
}
.app-header .search {
flex: 1;
max-width: 420px;
}
.app-header .header-actions {
margin-left: auto;
display: flex;
align-items: center;
gap: 0.5rem;
}
.app-sidebar {
grid-area: sidebar;
border-right: 1px solid var(--border);
background: var(--bg-elevated);
padding: 0.75rem 0.5rem;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.nav-section {
margin: 0.75rem 0.5rem 0.35rem;
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
}
.nav-link {
display: flex;
align-items: center;
gap: 0.65rem;
padding: 0.5rem 0.75rem;
border-radius: var(--radius-sm);
color: var(--text-secondary);
text-decoration: none;
transition: background var(--transition), color var(--transition);
}
.nav-link:hover {
background: var(--bg-hover);
color: var(--text);
text-decoration: none;
}
.nav-link.active {
background: var(--accent-soft);
color: var(--accent);
font-weight: 600;
}
.nav-link .icon { width: 18px; text-align: center; flex-shrink: 0; }
.app-main {
grid-area: main;
display: flex;
flex-direction: column;
min-width: 0;
}
.main-inner {
flex: 1;
padding: 1.25rem 1.5rem 2rem;
max-width: 1280px;
width: 100%;
margin: 0 auto;
}
.breadcrumb {
display: flex;
align-items: center;
gap: 0.4rem;
flex-wrap: wrap;
font-size: 13px;
color: var(--text-muted);
margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }
.app-footer {
padding: 1rem 1.5rem;
border-top: 1px solid var(--border-muted);
color: var(--text-muted);
font-size: 12px;
display: flex;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
/* ─── Auth layout ────────────────────────────────────────────────────────── */
.auth-page {
min-height: 100vh;
display: grid;
place-items: center;
padding: 1.5rem;
background:
radial-gradient(ellipse at 20% 0%, var(--accent-soft), transparent 50%),
radial-gradient(ellipse at 80% 100%, rgba(124, 58, 237, 0.08), transparent 45%),
var(--bg);
}
.auth-card {
width: 100%;
max-width: 400px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
padding: 2rem;
}
.auth-card .logo-row {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1.5rem;
}
.auth-card h1 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.auth-card .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }
/* ─── Components ─────────────────────────────────────────────────────────── */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
padding: 0.45rem 0.9rem;
border-radius: var(--radius-sm);
border: 1px solid transparent;
background: var(--bg-muted);
color: var(--text);
font-weight: 500;
transition: background var(--transition), border-color var(--transition), opacity var(--transition);
white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger {
background: var(--danger);
color: #fff;
border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-ghost {
background: transparent;
border-color: transparent;
color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-outline {
background: transparent;
border-color: var(--border);
}
.btn-sm { padding: 0.25rem 0.6rem; font-size: 12px; }
.btn-icon {
width: 34px; height: 34px; padding: 0;
border-radius: var(--radius-sm);
}
.form-group { margin-bottom: 1rem; }
.form-label {
display: block;
font-size: 13px;
font-weight: 500;
margin-bottom: 0.35rem;
color: var(--text);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 0.3rem; }
.form-control {
width: 100%;
padding: 0.5rem 0.7rem;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--bg-elevated);
color: var(--text);
transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
outline: none;
border-color: var(--accent);
box-shadow: var(--focus-ring);
}
.form-control.is-invalid { border-color: var(--danger); }
.password-field {
position: relative;
display: flex;
align-items: center;
}
.password-field .form-control { padding-right: 2.5rem; }
.password-field .toggle {
position: absolute;
right: 0.35rem;
background: transparent;
border: none;
color: var(--text-muted);
padding: 0.35rem 0.5rem;
border-radius: 4px;
}
.password-field .toggle:hover { color: var(--text); background: var(--bg-hover); }
.checkbox-row, .radio-row {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
}
.card {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow-sm);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.9rem 1.1rem;
border-bottom: 1px solid var(--border-muted);
}
.card-body { padding: 1.1rem; }
.card-footer {
padding: 0.75rem 1.1rem;
border-top: 1px solid var(--border-muted);
background: var(--bg-muted);
border-radius: 0 0 var(--radius) var(--radius);
}
.stat-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 0.85rem;
margin-bottom: 1.25rem;
}
.stat-card {
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1rem;
box-shadow: var(--shadow-sm);
}
.stat-card .label {
font-size: 12px;
color: var(--text-muted);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.stat-card .value {
font-size: 1.65rem;
font-weight: 700;
margin-top: 0.25rem;
letter-spacing: -0.02em;
}
.stat-card .hint { font-size: 12px; color: var(--text-secondary); margin-top: 0.25rem; }
.page-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
margin-bottom: 1.25rem;
}
.page-header h1 { margin: 0; }
.page-header .desc { color: var(--text-secondary); margin: 0.25rem 0 0; }
.toolbar {
display: flex;
align-items: center;
gap: 0.6rem;
flex-wrap: wrap;
margin-bottom: 1rem;
}
.toolbar .spacer { flex: 1; }
.toolbar .search-input { max-width: 280px; min-width: 180px; }
.table-wrap {
overflow-x: auto;
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--bg-elevated);
}
table.data-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
table.data-table th,
table.data-table td {
text-align: left;
padding: 0.7rem 0.9rem;
border-bottom: 1px solid var(--border-muted);
vertical-align: middle;
}
table.data-table th {
font-size: 12px;
font-weight: 600;
color: var(--text-secondary);
background: var(--bg-muted);
white-space: nowrap;
user-select: none;
}
table.data-table th.sortable { cursor: pointer; }
table.data-table th.sortable:hover { color: var(--text); }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--bg-hover); }
table.data-table .actions {
display: flex;
gap: 0.35rem;
justify-content: flex-end;
white-space: nowrap;
}
.badge, .chip {
display: inline-flex;
align-items: center;
gap: 0.25rem;
padding: 0.15rem 0.5rem;
border-radius: 999px;
font-size: 12px;
font-weight: 500;
background: var(--bg-muted);
color: var(--text-secondary);
border: 1px solid transparent;
}
.badge-success, .chip-success { background: var(--success-soft); color: var(--success); }
.badge-warning, .chip-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger, .chip-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info, .chip-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.avatar {
width: 32px; height: 32px;
border-radius: 50%;
background: linear-gradient(135deg, var(--accent), #7c3aed);
color: #fff;
display: grid; place-items: center;
font-weight: 700; font-size: 12px;
flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.empty-state, .error-state {
text-align: center;
padding: 2.5rem 1.5rem;
color: var(--text-secondary);
}
.empty-state .icon, .error-state .icon {
font-size: 2rem;
margin-bottom: 0.75rem;
opacity: 0.7;
}
.error-state { color: var(--danger); }
.spinner {
width: 20px; height: 20px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.7s linear infinite;
display: inline-block;
}
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-hover) 50%, var(--bg-muted) 75%);
background-size: 200% 100%;
animation: shimmer 1.2s infinite;
border-radius: 4px;
height: 1em;
}
@keyframes shimmer {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
.loading-center {
display: grid;
place-items: center;
padding: 3rem;
gap: 0.75rem;
color: var(--text-muted);
}
/* ─── Modal / Dialog ─────────────────────────────────────────────────────── */
.modal-backdrop {
position: fixed;
inset: 0;
z-index: 100;
background: var(--overlay);
display: grid;
place-items: center;
padding: 1rem;
animation: fadeIn 120ms ease;
}
.modal {
width: 100%;
max-width: 480px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-lg);
max-height: 90vh;
overflow: auto;
animation: slideUp 150ms ease;
}
.modal-lg { max-width: 640px; }
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.15rem;
border-bottom: 1px solid var(--border-muted);
}
.modal-body { padding: 1.15rem; }
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
padding: 0.85rem 1.15rem;
border-top: 1px solid var(--border-muted);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast-stack {
position: fixed;
top: calc(var(--header-h) + 0.75rem);
right: 1rem;
z-index: 200;
display: flex;
flex-direction: column;
gap: 0.5rem;
max-width: 360px;
width: calc(100% - 2rem);
pointer-events: none;
}
.toast {
pointer-events: auto;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 0.75rem 1rem;
display: flex;
gap: 0.65rem;
align-items: flex-start;
animation: slideUp 150ms ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast .msg { flex: 1; font-size: 13px; }
.toast .close {
background: none; border: none; color: var(--text-muted); padding: 0;
line-height: 1; font-size: 16px;
}
/* ─── Dropdown / User menu ───────────────────────────────────────────────── */
.dropdown {
position: relative;
}
.dropdown-menu {
position: absolute;
right: 0;
top: calc(100% + 0.35rem);
min-width: 200px;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: var(--radius);
box-shadow: var(--shadow);
padding: 0.35rem;
z-index: 60;
}
.dropdown-item {
display: flex;
align-items: center;
gap: 0.5rem;
width: 100%;
padding: 0.5rem 0.7rem;
border: none;
background: transparent;
border-radius: var(--radius-sm);
color: var(--text);
text-align: left;
text-decoration: none;
font-size: 13px;
}
.dropdown-item:hover {
background: var(--bg-hover);
text-decoration: none;
}
.dropdown-divider {
height: 1px;
background: var(--border-muted);
margin: 0.3rem 0;
}
/* ─── Permission matrix ──────────────────────────────────────────────────── */
.perm-group {
margin-bottom: 1.25rem;
}
.perm-group h3 {
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-muted);
margin-bottom: 0.5rem;
}
.perm-list {
display: grid;
gap: 0.35rem;
}
.perm-item {
display: flex;
align-items: flex-start;
gap: 0.75rem;
padding: 0.65rem 0.85rem;
border: 1px solid var(--border-muted);
border-radius: var(--radius-sm);
background: var(--bg-elevated);
}
.perm-item code { color: var(--accent); }
/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
padding: 0.75rem 0;
font-size: 13px;
color: var(--text-secondary);
}
.pagination .pages {
display: flex;
gap: 0.25rem;
}
/* ─── Grid helpers ───────────────────────────────────────────────────────── */
.grid-2 {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}
@media (max-width: 800px) {
.grid-2 { grid-template-columns: 1fr; }
.app-shell {
grid-template-columns: 1fr;
grid-template-areas:
"header"
"main";
}
.app-sidebar {
display: none;
}
.app-shell.mobile-nav-open .app-sidebar {
display: flex;
position: fixed;
top: var(--header-h);
left: 0; bottom: 0;
width: min(280px, 85vw);
z-index: 40;
box-shadow: var(--shadow-lg);
}
}
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.row { display: flex; align-items: center; gap: 0.5rem; }
.gap-1 { gap: 0.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mono { font-family: var(--mono); font-size: 12px; }
.sr-only {
position: absolute; width: 1px; height: 1px;
padding: 0; margin: -1px; overflow: hidden;
clip: rect(0,0,0,0); border: 0;
}
/* ─── Alert ──────────────────────────────────────────────────────────────── */
.alert {
padding: 0.75rem 1rem;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
margin-bottom: 1rem;
font-size: 13px;
}
.alert-error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.alert-info { background: var(--info-soft); border-color: transparent; color: var(--info); }
/* ─── Token reveal ───────────────────────────────────────────────────────── */
.secret-box {
background: var(--bg-muted);
border: 1px dashed var(--border);
border-radius: var(--radius-sm);
padding: 0.75rem;
font-family: var(--mono);
font-size: 12px;
word-break: break-all;
display: flex;
gap: 0.5rem;
align-items: flex-start;
}
.secret-box code { flex: 1; background: none; padding: 0; }
/* Toggle switch */
.toggle {
position: relative;
width: 40px;
height: 22px;
background: var(--bg-muted);
border: 1px solid var(--border);
border-radius: 999px;
cursor: pointer;
transition: background var(--transition);
flex-shrink: 0;
}
.toggle.on {
background: var(--accent);
border-color: var(--accent);
}
.toggle::after {
content: "";
position: absolute;
top: 2px; left: 2px;
width: 16px; height: 16px;
border-radius: 50%;
background: #fff;
transition: transform var(--transition);
box-shadow: var(--shadow-sm);
}
.toggle.on::after { transform: translateX(18px); }