:root{
  --bg:#f5f7fb;
  --panel:#fff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --primary:#111827;
  --danger:#b91c1c;
  --success:#047857;
  --soft:#f9fafb;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Inter,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

button,
input,
select,
textarea{
  font:inherit;
}

.login-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:18px;
  padding:28px;
  box-shadow:0 12px 36px rgba(17,24,39,.06);
}

.login-card{
  width:min(430px,100%);
}

h1,
h2,
h3{
  margin-top:0;
}

.muted{
  color:var(--muted);
}

label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin:16px 0 7px;
}

input,
select,
textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
}

textarea{
  min-height:130px;
  resize:vertical;
}

.btn{
  border:0;
  border-radius:10px;
  padding:11px 14px;
  background:var(--primary);
  color:#fff;
  font-weight:700;
  cursor:pointer;
}

.btn.secondary{
  background:#fff;
  color:var(--text);
  border:1px solid var(--line);
}

.btn.danger{
  background:var(--danger);
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

#loginButton{
  margin-top:12px;
}

#loginForm .message{
  margin-top:14px;
}

.message{
  margin-top:14px;
  font-size:14px;
}

.error{
  color:var(--danger);
}

.success{
  color:var(--success);
}

.app{
  display:grid;
  grid-template-columns:240px 1fr;
  min-height:100vh;
}

.sidebar{
  background:#111827;
  color:#fff;
  padding:22px;
}

.brand{
  font-size:20px;
  font-weight:800;
  margin-bottom:28px;
}

.nav button{
  display:block;
  width:100%;
  text-align:left;
  background:transparent;
  color:#d1d5db;
  border:0;
  padding:11px 12px;
  border-radius:9px;
  cursor:pointer;
  margin:3px 0;
}

.nav button.active,
.nav button:hover{
  background:#1f2937;
  color:#fff;
}

.main{
  padding:28px;
}

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

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

.stat{
  padding:18px;
}

.stat strong{
  font-size:28px;
  display:block;
  margin-top:8px;
}

.panel{
  display:none;
}

.panel.active{
  display:block;
}

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  text-align:left;
  padding:11px;
  border-bottom:1px solid var(--line);
  font-size:14px;
}

.row{
  display:flex;
  gap:10px;
  align-items:end;
}

.row>*{
  flex:1;
}

.row .fit{
  flex:0 0 auto;
}

.code{
  white-space:pre-wrap;
  background:#0b1020;
  color:#e5e7eb;
  padding:16px;
  border-radius:12px;
  max-height:480px;
  overflow:auto;
  font:13px/1.45 monospace;
}

.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  background:#eef2ff;
  font-size:12px;
}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

@media(max-width:850px){
  .app{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:static;
  }

  .grid{
    grid-template-columns:1fr;
  }

  .row{
    flex-direction:column;
    align-items:stretch;
  }
}
