:root { color-scheme: light; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: #eef3f8; color: #172033; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; display: flex; flex-direction: column; gap: 22px; padding: 24px; background: #0f172a; color: #e2e8f0; }
.brand { display: grid; gap: 3px; padding-bottom: 18px; border-bottom: 1px solid rgba(226, 232, 240, .14); }
.brand strong { font-size: 22px; }
.brand span { color: #94a3b8; }
nav { display: grid; gap: 8px; }
nav a { color: #cbd5e1; border-radius: 8px; padding: 11px 12px; font-weight: 800; }
nav a.active, nav a:hover { color: #ffffff; background: #1e293b; text-decoration: none; }
.shell { margin-left: 260px; min-height: 100vh; }
header { padding: 26px 32px 18px; background: #ffffff; border-bottom: 1px solid #dde6f2; }
h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
header p { margin: 6px 0 0; color: #64748b; }
main { max-width: 1180px; padding: 26px 32px 40px; }
.login { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 28px; background: #ffffff; border: 1px solid #dde6f2; border-radius: 10px; box-shadow: 0 18px 45px rgba(15, 23, 42, .12); }
.login-card h1 { margin-bottom: 22px; }
.panel, .snippet-card, .stat { background: #ffffff; border: 1px solid #dde6f2; border-radius: 8px; box-shadow: 0 10px 26px rgba(15, 23, 42, .06); }
.panel { padding: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 20px; }
.panel p { color: #64748b; }
.panel-head, .cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; }
.stat span { display: block; color: #64748b; font-weight: 800; }
.stat strong { display: block; margin-top: 8px; font-size: 34px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.rank-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rank-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; background: #f8fafc; border-radius: 8px; }
.rank-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar { display: flex; justify-content: space-between; margin-bottom: 14px; }
.filter-panel { margin-bottom: 14px; }
.filter-form { display: grid; grid-template-columns: minmax(220px, 1fr) 220px auto; gap: 14px; align-items: end; }
.filter-actions { display: flex; gap: 10px; }
.toolbar { align-items: center; }
.toolbar span { color: #64748b; font-weight: 900; }
.snippet-list { display: grid; gap: 14px; }
.snippet-card { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 18px; padding: 16px; }
.snippet-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.snippet-title h2 { margin: 0; font-size: 20px; }
.snippet-main p { margin: 0 0 10px; color: #64748b; }
.snippet-actions { display: grid; align-content: start; gap: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; background: #e0f2fe; color: #075985; }
.pill.favorite { background: #fef3c7; color: #92400e; }
.pill.muted { background: #e2e8f0; color: #475569; }
code { display: block; max-height: 150px; overflow: auto; white-space: pre-wrap; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px; font-size: 13px; }
small { display: block; margin-top: 9px; color: #64748b; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 800; color: #334155; }
label.check { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
input, textarea, select { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px 12px; font: inherit; background: #ffffff; color: #172033; }
input[type="checkbox"] { width: auto; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 0; border-radius: 8px; padding: 9px 13px; background: #e2e8f0; color: #172033; font: inherit; font-weight: 900; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { text-decoration: none; filter: brightness(.97); }
.primary, .button.primary { background: #2563eb; color: #ffffff; }
.danger { background: #fee2e2; color: #991b1b; }
.ghost { background: #1e293b; color: #e2e8f0; }
.full { width: 100%; }
.actions { display: flex; gap: 10px; }
.error-text { color: #b91c1c; font-weight: 800; }
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; }
  .shell { margin-left: 0; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid, .dashboard-grid, .form-grid, .snippet-card, .filter-form { grid-template-columns: 1fr; }
  main, header { padding-left: 18px; padding-right: 18px; }
  .snippet-actions { grid-template-columns: 1fr; }
}

