:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --brand:#2563eb;
  --brand2:#1d4ed8;
  --danger:#ef4444;
  --warn:#f59e0b;
  --ok:#10b981;
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --radius:16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 600px at 30% -10%, rgba(37,99,235,.18), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(16,185,129,.12), transparent 55%),
              var(--bg);
  color:var(--text);
  line-height:1.4;
}

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

.container{
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px;
}

.topbar{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}

.brand{
  display:flex; align-items:center; gap:10px;
}
.brand .logo{
  width:40px; height:40px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #22c55e);
  box-shadow: 0 10px 20px rgba(37,99,235,.22);
}
.brand h2{ margin:0; font-size:20px; letter-spacing:-.02em; }
.brand .sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card h2, .card h3{
  margin: 0 0 10px 0;
  letter-spacing: -.02em;
}

.small{ font-size:12px; color: var(--muted); }
hr{
  border:none;
  border-top:1px solid var(--line);
  margin: 14px 0;
}

/* Forms */
label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}
input, select, textarea, button{
  width:100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
textarea{ min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(37,99,235,.6);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* Buttons */
.actions{ display:flex; gap:10px; flex-wrap:wrap; }
button{
  cursor:pointer;
  background: linear-gradient(180deg, var(--brand), var(--brand2));
  color:white;
  border:none;
  font-weight: 800;
  letter-spacing: .01em;
}
button:hover{ filter: brightness(1.02); }
button:active{ transform: translateY(1px); }
button.secondary{
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 700;
}
button.secondary:hover{
  box-shadow: 0 6px 18px rgba(2,6,23,.08);
}

/* Layout helpers */
.row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 860px){
  .row, .row3{ grid-template-columns: 1fr; }
  .container{ padding: 16px; }
}

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}
.badge.ok{
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.25);
  color: #047857;
}
.badge.warn{
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.25);
  color: #92400e;
}
.badge.danger{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: #991b1b;
}

/* Tables */
.tablewrap{ width:100%; overflow:auto; border-radius: 14px; border:1px solid var(--line); }
table{ width:100%; border-collapse: collapse; min-width: 760px; background:#fff; }
th, td{
  border-bottom:1px solid var(--line);
  padding: 12px 10px;
  text-align:left;
  vertical-align: top;
}
th{
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}
tr:hover td{ background: #fbfdff; }

/* Pre blocks in prices */
pre{
  white-space: pre-wrap;
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #fbfdff;
  color: #0f172a;
}

/* Login sizing */
.login-card{
  max-width: 720px;
  margin: 50px auto;
}
@media (max-width: 860px){
  .login-card{ margin: 18px auto; }
}
