:root {
  --bg: #061817;
  --surface: #0b2724;
  --surface-2: #123733;
  --surface-3: #194a44;
  --text: #f5fffc;
  --muted: #b8d8d1;
  --border: #2f6760;
  --accent: #2de0b2;
  --accent-strong: #64f7d2;
  --accent-dark: #053f34;
  --gold: #ffd166;
  --danger: #ff8b8b;
  --success: #73f2be;
  --warning: #ffd98a;
  --shadow: 0 20px 55px rgba(0,0,0,.28);
  --radius: 20px;
}
html[data-theme="light"] {
  --bg: #f2faf7;
  --surface: #ffffff;
  --surface-2: #e5f5ef;
  --surface-3: #d0ece3;
  --text: #082a26;
  --muted: #385e58;
  --border: #9bc9bd;
  --accent: #087c65;
  --accent-strong: #056451;
  --accent-dark: #dff7ef;
  --gold: #9a6300;
  --danger: #9c1c1c;
  --success: #0a6a45;
  --warning: #7a4e00;
  --shadow: 0 20px 55px rgba(18,70,62,.14);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 999; background: var(--accent); color: #041714; padding: .75rem 1rem; border-radius: 10px; }
.skip-link:focus { top: 1rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg,#041312,var(--surface)); border-right: 1px solid var(--border); padding: 1.2rem; display: flex; flex-direction: column; z-index: 40; }
html[data-theme="light"] .sidebar { background: linear-gradient(180deg,#ffffff,#e7f7f1); }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--text); padding: .55rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 1.6rem; background: linear-gradient(135deg,var(--accent),var(--gold)); box-shadow: 0 10px 25px rgba(45,224,178,.22); }
.brand strong { display: block; font-size: 1.06rem; }
.brand small { display: block; color: var(--muted); font-size: .78rem; }
.nav-stack { display: grid; gap: .3rem; margin-top: 1.4rem; }
.nav-link { display: block; width: 100%; padding: .78rem .9rem; border-radius: 12px; color: var(--muted); border: 1px solid transparent; text-align: left; background: transparent; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); border-color: var(--border); text-decoration: none; }
.sidebar-footer { margin-top: auto; display: grid; gap: .3rem; }
.button-link { border: 0; }
.theme-button { width: 100%; padding: .72rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.main-area { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { height: 74px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; padding: 0 2rem; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 91%, transparent); backdrop-filter: blur(18px); }
.topbar-title { flex: 1; color: var(--muted); font-weight: 700; }
.mobile-menu { display: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .45rem .7rem; }
.content-wrap { padding: 2rem; width: min(1500px,100%); margin: 0 auto; flex: 1; }
.footer { padding: 1.5rem 2rem; text-align: center; color: var(--muted); border-top: 1px solid var(--border); font-size: .9rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-header h1 { margin: 0; font-size: clamp(1.8rem,3vw,3rem); letter-spacing: -.04em; }
.page-header p { margin: .35rem 0 0; color: var(--muted); max-width: 830px; }
.page-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h2,.card h3 { margin-top: 0; }
.card-subtle { background: var(--surface-2); box-shadow: none; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.metric { min-height: 135px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -35px; bottom: -50px; width: 125px; height: 125px; border-radius: 50%; background: color-mix(in srgb,var(--accent) 20%,transparent); }
.metric-label { color: var(--muted); font-size: .9rem; }
.metric-value { font-size: clamp(1.55rem,2.5vw,2.35rem); font-weight: 800; margin-top: .3rem; }
.metric-note { color: var(--muted); font-size: .84rem; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; border-radius: 12px; border: 1px solid var(--border); padding: .72rem 1rem; color: var(--text); background: var(--surface-2); font-weight: 750; text-decoration: none; }
.btn:hover { transform: translateY(-1px); text-decoration: none; border-color: var(--accent); }
.btn-primary { background: var(--accent); color: #031a16; border-color: var(--accent); }
html[data-theme="light"] .btn-primary { color: white; }
.btn-secondary { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb,var(--danger) 65%,var(--border)); }
.btn-ghost { background: transparent; }
.btn-small { padding: .52rem .76rem; font-size: .9rem; }
.btn-block { width: 100%; }
.form-card { max-width: 1060px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.form-group { display: grid; gap: .38rem; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 750; }
.help { color: var(--muted); font-size: .84rem; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: .72rem .78rem; background: var(--bg); color: var(--text); outline: none; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { background: white; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent); }
textarea { min-height: 125px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: .55rem; }
.checkbox-row input { width: auto; }
.flash-stack { display: grid; gap: .6rem; margin-bottom: 1rem; }
.flash { padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.flash.success { border-color: var(--success); }
.flash.error { border-color: var(--danger); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th,td { text-align: left; padding: .78rem .86rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; font-weight: 800; }
.badge.success { color: var(--success); }
.badge.warning { color: var(--warning); }
.badge.danger { color: var(--danger); }
.progress { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg,var(--accent),var(--gold)); border-radius: inherit; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.4rem; align-items: stretch; margin-bottom: 1.4rem; }
.hero-copy { background: radial-gradient(circle at top right,color-mix(in srgb,var(--accent) 20%,transparent),transparent 35%),var(--surface); padding: clamp(1.5rem,4vw,3.8rem); border-radius: 30px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.eyebrow { display: inline-flex; gap: .4rem; color: var(--accent-strong); font-weight: 850; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.hero h1 { font-size: clamp(2.3rem,5.4vw,5.2rem); line-height: .98; margin: .8rem 0 1rem; letter-spacing: -.065em; }
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 760px; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; }
.hero-image { border-radius: 30px; overflow: hidden; border: 1px solid var(--border); min-height: 380px; position: relative; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.hero-caption { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; padding: .75rem; border-radius: 12px; background: rgba(2,20,17,.78); color: white; font-size: .83rem; }
.public-header { width: min(1440px,100%); margin: 0 auto; padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.public-header nav { display: flex; align-items: center; gap: 1rem; }
.public-main { width: min(1440px,100%); margin: 0 auto; padding: 1.5rem; min-height: calc(100vh - 170px); }
.auth-wrap { min-height: 75vh; display: grid; place-items: center; }
.auth-card { width: min(520px,100%); }
.auth-card h1 { margin-bottom: .3rem; }
.auth-card > p { color: var(--muted); }
.stack { display: grid; gap: .85rem; }
.inline { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .85rem; }
.module-card { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; }
.module-card .emoji { font-size: 2rem; }
.module-card strong { font-size: 1.02rem; }
.module-card small { color: var(--muted); }
.project-banner { background: linear-gradient(135deg,var(--surface),var(--surface-2)); border: 1px solid var(--border); border-radius: 24px; padding: 1.4rem; margin-bottom: 1rem; }
.project-banner h1 { margin: 0; }
.case-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.case-card { display: flex; flex-direction: column; gap: .7rem; }
.case-card p { color: var(--muted); margin: 0; }
.case-card .actions { margin-top: auto; display: flex; gap: .55rem; flex-wrap: wrap; }
.filter-bar { display: grid; grid-template-columns: 2fr repeat(3,1fr) auto; gap: .7rem; margin-bottom: 1rem; }
.pagination { display: flex; justify-content: center; gap: .7rem; margin-top: 1.5rem; }
.guide-nav { position: sticky; top: 90px; }
.guide-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; }
.guide-section { scroll-margin-top: 95px; }
.guide-section h2 { margin-top: 0; }
.callout { padding: 1rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 10px; }
.code-like { white-space: pre-wrap; font-family: Consolas, monospace; background: #020c0b; color: #e7fff8; padding: 1rem; border-radius: 12px; overflow-x: auto; }
.photo-strip { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.photo-strip figure { margin: 0; }
.photo-strip img { width: 100%; height: 300px; object-fit: cover; border-radius: 18px; }
.photo-strip figcaption { color: var(--muted); font-size: .82rem; margin-top: .45rem; }
.kpi-ring { width: 130px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--value)*1%),var(--surface-3) 0); position: relative; }
.kpi-ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.kpi-ring strong { z-index: 1; font-size: 1.65rem; }
.actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; }
.danger-zone { border-color: color-mix(in srgb,var(--danger) 60%,var(--border)); }
@media (max-width: 1200px) { .grid-4,.module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .case-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -310px; width: 280px; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .mobile-menu { display: inline-flex; }
  .content-wrap { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .hero,.guide-layout { grid-template-columns: 1fr; }
  .guide-nav { position: static; }
  .grid-3,.grid-2,.form-grid,.case-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1 / -1; }
  .public-header nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) { .grid-4,.module-grid,.filter-bar,.photo-strip { grid-template-columns: 1fr; } .page-header { flex-direction: column; } .topbar-title { display: none; } .hero-image { min-height: 260px; } }
@media print { .sidebar,.topbar,.footer,.page-actions,.btn,.flash-stack { display:none!important; } .app-shell { display:block; } .content-wrap { padding:0; } .card { box-shadow:none; break-inside:avoid; } body { background:white; color:black; } }
