:root {
  --bg: #09111b;
  --bg-2: #101a29;
  --panel: #111d2d;
  --panel-2: #152235;
  --line: rgba(193, 212, 255, 0.10);
  --line-strong: rgba(193, 212, 255, 0.18);
  --text: #edf3ff;
  --muted: #95a6c6;
  --accent: #5d9fff;
  --accent-2: #8fc3ff;
  --success: #27c084;
  --warning: #ffcf66;
  --danger: #ff758e;
  --radius: 22px;
  --shadow: 0 22px 50px rgba(0,0,0,.28);
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(93, 159, 255, .09), transparent 28%),
    linear-gradient(180deg, #08111a 0%, #0b1420 100%);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
strong { font-weight: 700; }

.site-shell { min-height: 100vh; display: grid; grid-template-columns: 320px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 22px 18px; background: #0c1624; border-right: 1px solid var(--line);
}
.brand-pro {
  gap: 14px; padding: 16px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line);
}
.brand { display: flex; align-items: center; }
.brand-mark {
  width: 74px; height: 74px; border-radius: 22px; padding: 12px;
  display: grid; place-items: center; background: linear-gradient(180deg, #102033, #0f1c2d);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.brand h1 { margin: 6px 0 4px; font-size: 1rem; line-height: 1.4; }
.brand-subtitle, .muted, .profile-card p, .topbar-card small, .log-card p { color: var(--muted); }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--accent-2); }

.menu { display: grid; gap: 8px; margin: 18px 0; }
.menu a {
  padding: 14px 16px; border-radius: 16px; color: #c7d4ef;
  border: 1px solid transparent; background: transparent; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.menu a:hover, .menu a.active {
  background: rgba(93, 159, 255, .10); border-color: rgba(93, 159, 255, .20); color: #fff;
}
.profile-card, .topbar-card, .card, .stat-card, .hero-panel, .auth-card, .rank-card, .log-card {
  background: linear-gradient(180deg, rgba(18, 29, 46, .96), rgba(13, 23, 36, .98));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.profile-card {
  display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 20px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(39, 192, 132, .15); }

.main-content { padding: 28px; }
.topbar-pro {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  margin-bottom: 24px; padding: 0 4px;
}
.topbar h2 { margin: 6px 0 0; font-size: 2rem; }
.topbar-card {
  min-width: 220px; border-radius: 18px; padding: 16px 18px; text-align: right;
}
.topbar-card span { display: block; color: var(--muted); font-size: .84rem; margin-bottom: 5px; }
.topbar-card strong { display: block; font-size: 1.1rem; }

.hero, .hero-metrics, .stats-grid, .grid-3, .dashboard-layout, .two-col, .doc-layout, .rank-grid { display: grid; gap: 18px; }
.hero { grid-template-columns: 1.2fr .86fr; margin-bottom: 24px; }
.hero-pro-copy {
  padding: 32px; border-radius: 28px; background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-copy h1 { font-size: clamp(2.4rem, 4vw, 4.3rem); line-height: 1.03; margin: 12px 0 16px; max-width: 13ch; }
.hero-copy p { color: var(--muted); font-size: 1.02rem; max-width: 60ch; }
.hero-panel { padding: 30px; border-radius: 28px; }
.glass { background: linear-gradient(180deg, #132132, #0e1826); }
.command-stack { display: grid; gap: 12px; margin-top: 18px; }
.command-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03); padding: 14px 16px;
}
.command-item span { color: var(--muted); }
.command-item strong { text-align: right; }
.hero-actions { display: flex; gap: 12px; margin: 26px 0 0; }
.hero-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 24px; }
.hero-metrics div, .stat-card {
  padding: 18px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.hero-metrics strong, .stat-card strong { display: block; font-size: 1.85rem; margin-bottom: 8px; }
.hero-metrics span, .stat-card span { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 15px; border: 0; cursor: pointer; font: inherit; font-weight: 700;
}
.btn-primary { background: linear-gradient(180deg, #5d9fff, #447fe0); color: #fff; }
.btn-secondary { background: rgba(255,255,255,.04); color: #fff; border: 1px solid var(--line); }

.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 20px; }
.dashboard-layout, .two-col, .doc-layout { grid-template-columns: 1fr 1fr; }
.rank-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card, .auth-card, .rank-card, .log-card, .stat-card { border-radius: 24px; padding: 22px; }
.card h3, .hero-panel h3, .auth-card h1 { margin-top: 0; }
.card-feature p { margin-bottom: 0; }

.auth-wrap { max-width: 720px; margin: 8vh auto; }
.auth-card { padding: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .94rem; }
input, textarea, select {
  width: 100%; padding: 14px 15px; border-radius: 15px; font: inherit; color: var(--text);
  background: #0d1724; border: 1px solid var(--line); outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(93, 159, 255, .45); box-shadow: 0 0 0 4px rgba(93, 159, 255, .10);
}
textarea { resize: vertical; min-height: 120px; }
.alert { padding: 14px 16px; border-radius: 16px; margin-bottom: 16px; }
.alert-success { background: rgba(39, 192, 132, .10); border: 1px solid rgba(39, 192, 132, .24); }
.alert-danger { background: rgba(255, 117, 142, .12); border: 1px solid rgba(255, 117, 142, .24); }
.alert-info { background: rgba(93, 159, 255, .10); border: 1px solid rgba(93, 159, 255, .22); }
.section-title, .log-top, .panel-head, .list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: grid; gap: 12px; }
.list-item {
  padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.badge, .pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  background: rgba(93, 159, 255, .10); border: 1px solid rgba(93, 159, 255, .20); color: var(--accent-2); font-size: .84rem;
}
.badge-muted, .pill-muted { background: rgba(255,255,255,.04); border-color: var(--line); color: var(--muted); }
.link { color: var(--accent-2); font-weight: 600; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); }
table { width: 100%; min-width: 620px; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .87rem; text-transform: uppercase; letter-spacing: .08em; }
.scroll-area { max-height: 820px; overflow: auto; padding-right: 4px; }
.rank-card h4 { margin: 14px 0 10px; font-size: 1.18rem; }
.rank-card span { color: var(--accent-2); font-weight: 800; }
.doc-card { padding: 28px; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; color: var(--muted); }
.feature-list li, .number-list li { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.number-list { display: grid; gap: 12px; padding-left: 22px; color: var(--muted); }
.miranda-box {
  margin: 18px 0; padding: 24px; border-left: 4px solid var(--accent); border-radius: 18px;
  background: rgba(93, 159, 255, .08); color: var(--text); font-size: 1.04rem; line-height: 1.7;
}
.report-layout { align-items: start; }
.report-form-card, .report-history-card { min-height: 200px; }
.reports-feed { gap: 16px; }
.report-card-pro { padding: 20px; }
.report-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.report-meta-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0;
}
.report-meta-grid div, .upload-preview {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.report-meta-grid span { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.report-sections { display: grid; gap: 12px; margin-bottom: 14px; }
.report-sections p { margin: 0; line-height: 1.7; }
.report-image-link {
  display: block; margin: 14px 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
}
.report-image-link img { width: 100%; max-height: 320px; object-fit: cover; }
.uploader-panel {
  padding: 16px; border-radius: 18px; border: 1px dashed rgba(143, 195, 255, .35);
  background: rgba(143, 195, 255, .04);
}
.uploader-panel input[type="file"] { margin-top: 12px; }
.upload-preview {
  margin-top: 14px; min-height: 130px; display: grid; place-items: center; color: var(--muted);
  overflow: hidden; text-align: center;
}
.upload-preview img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; }
.single { grid-template-columns: 1fr; max-width: 980px; }

@media (max-width: 1180px) {
  .site-shell, .hero, .dashboard-layout, .two-col, .doc-layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid-3, .rank-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .main-content, .sidebar { padding: 18px; }
  .topbar-pro { flex-direction: column; align-items: flex-start; }
  .grid-3, .hero-metrics, .stats-grid, .rank-grid, .form-grid, .report-meta-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-copy h1 { font-size: 2.15rem; }
}

.btn-danger { background: rgba(255, 117, 142, .14); color: #fff; border: 1px solid rgba(255, 117, 142, .28); }
.btn-mini { padding: 10px 12px; border-radius: 12px; font-size: .88rem; }
.action-cell, .action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.action-cell form, .action-row form { margin: 0; }
.scroll-area { max-height: 820px; overflow: auto; padding-right: 4px; }

.home-pro { display: grid; gap: 20px; }
.home-hero {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 24px; align-items: stretch;
  padding: 28px; border-radius: 28px;
}
.home-copy h1 { font-size: clamp(2.4rem, 4vw, 4rem); margin: 10px 0 12px; }
.home-copy p { color: var(--muted); max-width: 64ch; }
.home-side-panel { display: grid; gap: 14px; }
.home-stat {
  padding: 18px 20px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.home-stat strong { display: block; font-size: 1.8rem; margin-bottom: 8px; }
.home-stat span { color: var(--muted); }
.quick-links-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.quick-link-box {
  display: flex; align-items: center; min-height: 84px; padding: 18px; border-radius: 18px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); transition: transform .15s ease, border-color .15s ease;
}
.quick-link-box:hover { transform: translateY(-1px); border-color: rgba(93,159,255,.28); }

.admin-panel-shell { display: grid; gap: 18px; }
.admin-hero {
  display: grid; grid-template-columns: 1.2fr .9fr; gap: 20px; align-items: center;
  border-radius: 28px; padding: 26px;
}
.admin-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.admin-hero-stats div, .admin-kpi {
  padding: 16px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.admin-hero-stats strong, .admin-kpi strong { display: block; font-size: 1.5rem; margin-bottom: 8px; }
.admin-hero-stats span, .admin-kpi span { color: var(--muted); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-tabs a {
  padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: #d4def4;
}
.admin-tabs a.active { background: rgba(93, 159, 255, .12); border-color: rgba(93,159,255,.26); color: #fff; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.admin-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 10px; }
.toggle-line { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.toggle-line input { width: auto; }
.doc-preview {
  padding: 18px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 18px; color: #dce7fb; line-height: 1.7;
}
.doc-long { min-height: 420px; }
.doc-embed-wrap { margin-top: 16px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.doc-embed { width: 100%; min-height: 70vh; border: 0; background: #fff; }

@media (max-width: 1200px) {
  .home-hero, .admin-hero, .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-hero-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .site-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .stats-grid, .rank-grid, .grid-3, .dashboard-layout, .two-col, .doc-layout, .hero, .hero-metrics, .quick-links-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

.public-home-minimal {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
}
.public-home-card {
  width: min(620px, 100%);
  text-align: center;
  padding: 42px 28px;
  border-radius: 28px;
}
.public-home-logo {
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
  padding: 18px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #102033, #0f1c2d);
  border: 1px solid rgba(193, 212, 255, 0.18);
}
.public-home-card h1 {
  margin: 10px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}
.public-home-card .muted {
  margin-bottom: 22px;
}
.public-home-actions {
  justify-content: center;
}
