:root{
  --bg:#f4f6f8;
  --panel:#ffffff;
  --ink:#182230;
  --muted:#667085;
  --line:#d9e0e8;
  --sidebar:#e6e9ee;
  --sidebar-deep:#d8dde4;
  --accent:#10367d;
  --accent-light:#6f8bc2;
  --blue:#2d6cdf;
  --shadow:0 8px 22px rgba(16,24,40,.06);
  --radius:8px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,Segoe UI,Arial,sans-serif;
  font-size:13px;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}

.is-hidden{
  display:none !important;
}

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

.login-card{
  width:min(420px,100%);
  display:grid;
  gap:16px;
  padding:30px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--panel);
  box-shadow:var(--shadow);
}

.login-brand{
  color:var(--accent);
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0;
}

.login-card h1{
  margin:8px 0 0;
  font-size:24px;
}

.error-notice{
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#b42318;
  border-radius:6px;
  padding:10px 12px;
  font-weight:700;
}

.login-feedback{
  border:1px solid #d1e7dd;
  background:#ecf8f1;
  color:#1f8f5f;
  border-radius:6px;
  padding:10px 12px;
  font-weight:700;
}

.login-button{
  width:100%;
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:248px minmax(0,1fr);
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  background:linear-gradient(180deg,var(--sidebar),var(--sidebar-deep));
  border-right:1px solid #cbd2dc;
  overflow:hidden;
}

.sidebar-inner{
  width:248px;
  min-height:100vh;
  padding:10px 12px 24px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.brand{
  display:grid;
  gap:4px;
  margin:4px 0 2px;
  line-height:1;
}

.brand-subtitle{
  color:var(--accent);
  font-size:13px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:0;
}

.nav{
  display:grid;
  gap:6px;
}

.nav button,
.control-tabbar button{
  min-height:42px;
  border:0;
  border-left:3px solid transparent;
  background:transparent;
  color:#344054;
  text-align:left;
  border-radius:6px;
  padding:0 12px;
  font-weight:750;
  font-size:13px;
}

.nav button.active,
.nav button:hover{
  color:var(--ink);
  background:#ffffffbd;
  border-left-color:var(--accent);
}

.sidebar-footer{
  margin-top:auto;
  display:grid;
  gap:10px;
  padding-top:12px;
  border-top:1px solid #cbd2dc;
}

.sidebar-user{
  min-height:38px;
  display:flex;
  align-items:center;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#ffffff73;
  color:var(--ink);
  font-weight:750;
}

.logout-button{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
}

.main{
  min-width:0;
  padding:26px;
}

.control-page{
  display:grid;
  gap:18px;
}

.control-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.panel-body{
  padding:16px;
}

.dld-grid{
  display:grid;
  gap:16px;
}

.field{
  display:grid;
  gap:7px;
}

.field span{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

input,select,textarea{
  width:100%;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:var(--ink);
  min-height:38px;
  padding:8px 10px;
}

.compact-field{
  max-width:320px;
}

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

.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background:#fff;
  color:var(--ink);
  min-height:36px;
  padding:8px 13px;
  border-radius:6px;
  font-weight:750;
}

.button.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

.button:active{
  transform:translateY(1px);
}

.button:disabled{
  opacity:.5;
  cursor:not-allowed;
  transform:none;
}

.helper-text{
  margin:0;
  color:var(--muted);
  line-height:1.45;
}

.helper-text code{
  font-family:Consolas,Menlo,Monaco,ui-monospace,monospace;
  font-size:12px;
}

.note-box{
  border:1px solid #d7e0ef;
  background:#f7faff;
  color:#29405f;
  border-radius:6px;
  padding:10px 12px;
  line-height:1.5;
}

select option:disabled{
  color:#9aa3af;
}

@media (max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .main{padding:18px}
}
