:root{
  --bg:#0b0d10;
  --panel:#10141a;
  --panel2:#0f1217;
  --text:#e9edf3;
  --muted:#a9b4c3;
  --line:#1d2632;
  --accent:#7aa7ff;

  --r:14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --max: 980px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html[data-theme="light"]{
  --bg:#f7f8fb;
  --panel:#ffffff;
  --panel2:#ffffff;
  --text:#0b0d10;
  --muted:#4d5b6a;
  --line:#e6eaf0;
  --accent:#2b63ff;
  --shadow: 0 12px 30px rgba(10,20,30,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height:1.45;
}

a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 14px 26px;
}

header{ margin-bottom: 14px; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}
.logo{
  width: 34px;
  height: 34px;
  display:grid;
  place-items:center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  font-weight: 700;
  flex: 0 0 auto;
}
.titles{ min-width:0; }
.titles h1{
  font-size: 16px;
  margin: 0;
  letter-spacing:.2px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.tagline{
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}
.lang{
  display:flex;
  align-items:center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.lang a{
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 9px;
  border: 1px solid transparent;
}
.lang a[aria-current="page"]{
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.03);
  text-decoration:none;
}

.themeBtn{
  cursor:pointer;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
}

.nav{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nav a{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size: 13px;
}
.nav a[aria-current="page"]{
  background: rgba(122,167,255,.10);
  border-color: rgba(122,167,255,.35);
  text-decoration:none;
}

.ad{
  margin: 12px 0;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 10px 12px 12px;
  background: rgba(255,255,255,.02);
}
.ad .label{
  margin:0 0 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing:.3px;
}
.ad .box{
  height: 92px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.02),
    rgba(255,255,255,.02) 10px,
    rgba(255,255,255,.04) 10px,
    rgba(255,255,255,.04) 20px
  );
}

.card{
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: var(--shadow);
}
.card h2{
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing:.2px;
}
.muted{ color: var(--muted); }
.small{ font-size: 12px; }

hr.sep{
  border: 0;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.kpis{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.kpi{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.02);
}
.kpi .label{
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
}
.kpi .value{
  font-family: var(--mono);
  font-size: 16px;
  margin: 0;
}
.kpi .sub{
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

.row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.field{
  display:flex;
  flex-direction:column;
  gap: 6px;
  min-width: 160px;
  flex: 1 1 180px;
}
label{
  font-size: 12px;
  color: var(--muted);
}
input, select, textarea{
  font: inherit;
  color: var(--text);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
}
textarea{ min-height: 84px; resize: vertical; }

.btn{
  cursor:pointer;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.btn.primary{
  background: rgba(122,167,255,.14);
  border-color: rgba(122,167,255,.35);
}
.btn.danger{
  background: rgba(255,90,90,.12);
  border-color: rgba(255,90,90,.28);
}
.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.table{
  width:100%;
  border-collapse: collapse;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: top;
}
.table th{
  text-align:left;
  color: var(--muted);
  font-weight: 600;
  background: rgba(255,255,255,.02);
}
.table tr:last-child td{ border-bottom: 0; }

.pill{
  display:inline-flex;
  align-items:center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,.02);
}

.hint{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-size: 12px;
}
.hint strong{ color: var(--text); }

.footer{
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer .row{
  gap: 10px;
  flex-wrap: wrap;
}
.footer a{ color: var(--muted); }
.footer a:hover{ color: var(--text); text-decoration: none; }

@media (min-width: 740px){
  .container{ padding: 22px 18px 34px; }
  .kpis{ grid-template-columns: 1fr 1fr; }
  .grid{ grid-template-columns: 1fr; }
}

@media (min-width: 980px){
  .kpis{ grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 380px){
  .topbar{ padding: 12px 12px; }
  .logo{ width: 30px; height:30px; border-radius: 10px; }
  .titles h1{ font-size: 15px; }
  .field{ min-width: 140px; }
  input,select,textarea{ padding: 9px 9px; }
  .btn{ padding: 9px 10px; }
}
