:root{
  --bg:#f7fafc;
  --fg:#111827;
  --card:#ffffff;
  --accent:#0a7;
  --muted:#6b7280;
  --border:#e5e7eb;
  --shadow:0 8px 20px rgba(0,0,0,.06);
  --radius:14px;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family:Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--fg);
}


.container{
  padding:16px;
  max-width:1200px;
  margin:0 auto;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:16px;
  box-shadow:0 1px 0 rgba(0,0,0,.02);
}

.card h1,.card h2,.card h3{
  margin:0 0 10px;
  line-height:1.2;
}
.card p{ margin:0 0 10px; }
.note{ color:var(--muted); font-size:12px; }
.muted{ color:var(--muted); }
.small{ font-size:12px; color:var(--muted); }


.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:10px 14px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-width:160px;
}
.brand{
  font-weight:800;
  letter-spacing:.2px;
}

.nav-toggle{
  display:none;
  background:#fff;
  border:1px solid #d1d5db;
  color:#111827;
  border-radius:12px;
  padding:6px 10px;
  font-size:18px;
  cursor:pointer;
  line-height:1;
}

.links{
  display:flex;
  gap:8px;
  align-items:center;
  flex:1 1 auto;
  flex-wrap:wrap;
  justify-content:center;
}

.links a{
  text-decoration:none;
  color:#0369a1;
  padding:8px 10px;
  border-radius:12px;
  white-space:nowrap;
}
.links a:hover{ background:#f1f5f9; }

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.gov-logo{
  width:40px;
  height:40px;
  object-fit:contain;
}

.lang-switch{
  font-size:12px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:6px;
}
.lang-switch a{
  text-decoration:none;
  font-weight:600;
  color:#0f172a;
  opacity:.8;
}
.lang-switch a.active{ opacity:1; font-weight:800; }


input, select, textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid #d1d5db;
  border-radius:12px;
  font-size:14px;
  background:#fff;
}
label{
  display:block;
  font-size:13px;
  color:#111827;
  margin:10px 0 6px;
}

button, .btn{
  background:var(--accent);
  color:#fff;
  border:none;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  text-decoration:none;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.btn.alt{ background:#334155; }
.btn.warn{ background:#b91c1c; }
.btn.ghost{
  background:#fff;
  color:#0f172a;
  border:1px solid #d1d5db;
}
.btn:active{ transform:translateY(1px); }

.btns{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}


.table{
  width:100%;
  border-collapse:collapse;
}
.table th, .table td{
  border:1px solid var(--border);
  padding:8px;
  font-size:14px;
  vertical-align:top;
}
.table th{
  background:#f8fafc;
  text-align:left;
}
.table .num{ text-align:right; }


.grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; }
.grid-3{ grid-template-columns:repeat(3, minmax(0,1fr)); }
.grid-4{ grid-template-columns:repeat(4, minmax(0,1fr)); }
.grid-5{ grid-template-columns:repeat(5, minmax(0,1fr)); }


.error{
  color:#b91c1c;
  background:#fee2e2;
  border:1px solid #fecaca;
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0;
}
.success{
  color:#065f46;
  background:#d1fae5;
  border:1px solid #a7f3d0;
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0;
}


.footer{
  padding:16px;
  text-align:center;
  color:var(--muted);
}


.chart-wrap{
  width:100%;
  height:320px;
  position:relative;
}
.chart-wrap canvas{
  width:100% !important;
  height:100% !important;
}


@media (max-width: 980px){
  .grid-4{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .grid-5{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px){
  .nav-toggle{ display:inline-flex; }
  .links{ display:none; width:100%; justify-content:flex-start; }
  .links.open{ display:flex; flex-direction:column; align-items:stretch; }
  .links a{ width:100%; }
  .topbar-right{ width:100%; justify-content:space-between; flex-wrap:wrap; }
}


@media (max-width: 720px), (hover: none) and (pointer: coarse){

  
  html, body{
    font-size:18px;
    line-height:1.45;
  }

  .container{ padding:12px; }
  .card{
    padding:14px;
    border-radius:16px;
  }

  
  .card h1{ font-size:22px; }
  .card h2{ font-size:19px; }
  .card h3{ font-size:17px; }

  .card p{ font-size:16px; }

  
  label{
    font-size:15px;
    margin:12px 0 6px;
  }

  input, select, textarea{
    font-size:18px;
    padding:12px 14px;
    border-radius:14px;
  }

  
  button, .btn{
    font-size:17px;
    padding:12px 14px;
    border-radius:14px;
  }

  .btns{
    flex-direction:column;
    align-items:stretch;
  }
  .btns > *{
    width:100%;
    justify-content:center;
  }

  
  .topbar{
    padding:10px 12px;
    gap:10px;
  }
  .brand{ font-size:18px; }

  .nav-toggle{
    padding:10px 12px;
    font-size:20px;
    border-radius:14px;
  }

  .gov-logo{
    width:34px;
    height:34px;
  }

  
  .lang-switch{
    font-size:16px;
    gap:10px;
  }
  .lang-switch a{
    font-size:16px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 14px;
    min-height:44px;
    border:1px solid var(--border);
    border-radius:14px;
    background:#fff;
    opacity:1;
  }
  .lang-switch a.active{
    background:#f1f5f9;
    font-weight:800;
  }

  
  .grid, .grid-3, .grid-4, .grid-5{
    display:block;
  }
  .grid > *, .grid-3 > *, .grid-4 > *, .grid-5 > *{
    width:100%;
    margin-bottom:12px;
  }
  .grid > *:last-child,
  .grid-3 > *:last-child,
  .grid-4 > *:last-child,
  .grid-5 > *:last-child{
    margin-bottom:0;
  }

  
  .table{
    display:block;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    border-radius:12px;
  }
  .table th, .table td{
    font-size:16px;
    padding:10px 12px;
    white-space:nowrap;
  }

  .note, .small{ font-size:14px; }
  .muted{ font-size:16px; }

  
  .chart-wrap{ height:260px; }
}


.topbar .gov-logo{
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
  flex: 0 0 auto !important;
  display: block;
}


@media (min-width: 992px){
  .topbar .gov-logo{
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
  }
}
