
:root {
  --bg: #f3f6fb;
  --bg-2: #eef3ff;
  --card: rgba(255,255,255,.82);
  --line: rgba(17,24,39,.08);
  --text: #102034;
  --muted: #5f728b;
  --primary: #1c5bd9;
  --primary-2: #3d83f6;
  --success: #1f9d63;
  --warning: #d18b10;
  --danger: #d24b4b;
  --info: #4d69e8;
  --shadow: 0 22px 70px rgba(16,32,52,.10);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: radial-gradient(circle at top left, #ffffff 0, #eef4ff 32%, #f4f7fb 100%); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
body { min-height: 100vh; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(255,255,255,.9); color: var(--text); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(28,91,217,.45); box-shadow: 0 0 0 4px rgba(28,91,217,.08); }
textarea { min-height: 118px; resize: vertical; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 11px 16px; cursor: pointer; text-decoration: none; font-weight: 600;
}
.button:hover { text-decoration: none; }
.button.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 14px 28px rgba(28,91,217,.22); }
.button.secondary { background: rgba(28,91,217,.08); color: var(--primary); }
.button.ghost { background: rgba(16,32,52,.05); color: var(--text); }
.button.tiny { padding: 7px 10px; border-radius: 12px; font-size: 13px; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; font-size: 11px; letter-spacing: .14em; color: var(--primary); font-weight: 700; margin-bottom: 6px; }
.app-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  padding: 22px; border-right: 1px solid rgba(255,255,255,.6); background: linear-gradient(180deg, rgba(10,27,55,.96), rgba(18,39,73,.95)); color: #dfe9ff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.brand-card {
  display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 24px; background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.brand-mark { width: 56px; height: 56px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.96); }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.35; }
.brand-sub { font-size: 12px; opacity: .78; margin-top: 4px; }
.nav-list { display: grid; gap: 8px; margin: 22px 0; }
.nav-link {
  color: #d3dfff; padding: 13px 16px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.04); transition: .18s ease;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.14); text-decoration: none; transform: translateX(1px); }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.user-box { display: grid; gap: 2px; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.08); }
.user-box span { font-size: 13px; opacity: .8; }
.sidebar-actions { display: flex; gap: 12px; }
.mini-link { color: #dfe9ff; font-size: 13px; }
.main-area { padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.topbar h1 { margin: 0 0 6px; font-size: 34px; line-height: 1.08; }
.top-search { min-width: 290px; }
.top-search input { background: rgba(255,255,255,.85); }
.card, .hero-strip, .stat-card, .modal-card, .login-panel, .glass-card {
  background: var(--card); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card, .hero-strip { padding: 24px; }
.card.narrow { max-width: 920px; }
.hero-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; background: linear-gradient(135deg, rgba(29,91,217,.92), rgba(95,142,255,.88)); color: white;
}
.hero-strip .eyebrow, .hero-strip .muted { color: rgba(255,255,255,.85); }
.hero-strip h2 { margin: 0 0 8px; font-size: 30px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .button.secondary { background: rgba(255,255,255,.18); color: white; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stats-grid.compact { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 18px; }
.stat-card { padding: 18px; }
.stat-card.success { background: linear-gradient(180deg, rgba(31,157,99,.10), rgba(255,255,255,.88)); }
.stat-card.warning { background: linear-gradient(180deg, rgba(209,139,16,.10), rgba(255,255,255,.88)); }
.stat-card.danger { background: linear-gradient(180deg, rgba(210,75,75,.10), rgba(255,255,255,.88)); }
.stat-card.info { background: linear-gradient(180deg, rgba(77,105,232,.10), rgba(255,255,255,.88)); }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stat-hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.content-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.content-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.section-head.split { align-items: center; }
.section-head h2, .section-head h3 { margin: 0; }
.section-head p { margin: 6px 0 0; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: 2fr repeat(4, minmax(0,1fr)) auto auto; gap: 12px; align-items: center; margin-bottom: 18px; }
.filters > * { min-width: 0; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; min-width: 980px; }
.table th, .table td { padding: 14px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.table th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: rgba(244,247,252,.78); position: sticky; top: 0; }
.table tr:hover td { background: rgba(28,91,217,.03); }
.row-title { font-weight: 650; margin-bottom: 4px; }
.row-sub { color: var(--muted); font-size: 13px; }
.row-actions { white-space: nowrap; display: flex; gap: 8px; }
.badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.badge.success { background: rgba(31,157,99,.12); color: var(--success); }
.badge.warning { background: rgba(209,139,16,.13); color: var(--warning); }
.badge.danger { background: rgba(210,75,75,.13); color: var(--danger); }
.badge.info { background: rgba(77,105,232,.13); color: var(--info); }
.badge.neutral { background: rgba(16,32,52,.08); color: var(--muted); }
.stack-list { display: grid; gap: 12px; }
.stack-item {
  display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,.78); border: 1px solid rgba(17,24,39,.06);
}
.stack-item strong { font-size: 14px; }
.stack-item span { color: var(--muted); font-size: 13px; }
.stack-item small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.card-lite { padding: 16px; }
.stack-top { display: flex; justify-content: space-between; gap: 12px; }
.scroll-list { max-height: 560px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; justify-content: flex-start; align-items: center; }
.flash { padding: 14px 16px; border-radius: 18px; margin-bottom: 16px; font-weight: 600; }
.flash.success { background: rgba(31,157,99,.11); color: var(--success); }
.flash.danger { background: rgba(210,75,75,.11); color: var(--danger); }
.pagination { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.page-link { display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 12px; background: rgba(255,255,255,.8); border: 1px solid var(--line); color: var(--text); }
.page-link.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; border-color: transparent; }
.modal-root.hidden { display: none; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(7,15,27,.48); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 60;
}
.modal-card {
  position: relative; width: min(980px, 100%); max-height: 88vh; overflow: auto; padding: 24px;
}
.modal-close {
  position: sticky; top: 0; margin-left: auto; display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; border: 0; background: rgba(16,32,52,.08); cursor: pointer; font-size: 24px;
}
.detail-hero { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-hero h2 { margin: 0 0 6px; font-size: 28px; }
.detail-hero p { margin: 0; color: var(--muted); }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.detail-grid > div { padding: 14px; border-radius: 18px; background: rgba(244,247,252,.78); border: 1px solid var(--line); }
.detail-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.detail-grid strong { font-size: 14px; }
.detail-section { margin-bottom: 18px; }
.detail-section h3 { margin: 0 0 10px; }
.prewrap { white-space: pre-wrap; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.inline-form { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; margin-top: 12px; }
.login-hero { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 440px); gap: 24px; align-items: center; justify-content: center; padding: 40px; }
.login-panel { padding: 32px; }
.login-panel h1 { margin: 0 0 10px; font-size: 42px; line-height: 1.04; }
.login-panel p { color: var(--muted); font-size: 16px; }
.login-form { display: grid; gap: 14px; margin: 24px 0 14px; }
.login-note { color: var(--muted); font-size: 14px; }
.login-side { display: grid; gap: 16px; }
.glass-card { padding: 24px; }
.glass-card h3 { margin-top: 0; }
.guest-shell { min-height: 100vh; }
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .content-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main-area { padding: 18px; }
  .content-grid, .content-grid.two, .content-grid.three, .stats-grid, .stats-grid.compact, .detail-grid, .form-grid, .login-hero { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .topbar, .hero-strip, .section-head.split, .detail-hero { flex-direction: column; }
  .top-search { width: 100%; min-width: 0; }
}
