:root {
  color: #17212f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f7fb; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #101820; color: #c8d2df; display: flex; flex-direction: column; padding: 24px 18px; }
.brand { align-items: center; color: #fff; display: flex; font-size: 17px; font-weight: 800; gap: 12px; padding: 0 8px 28px; }
.brand-mark, .login-mark { align-items: center; background: #1f7a5c; border-radius: 8px; color: #fff; display: flex; font-weight: 900; height: 36px; justify-content: center; width: 36px; }
.nav { display: grid; gap: 7px; }
.nav a { border-radius: 7px; padding: 12px 14px; }
.nav a:hover, .nav a.active { background: #1f7a5c; color: #fff; }
.logout { margin-top: auto; }
.logout button { background: transparent; border: 1px solid #3d4855; border-radius: 7px; color: #c8d2df; cursor: pointer; padding: 10px 14px; width: 100%; }

.main { min-width: 0; padding: 28px; }
.topbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 24px; }
.topbar h1 { font-size: 26px; margin: 0; }
.topbar p { color: #7a8494; font-size: 14px; margin: 7px 0 0; }
.user-pill { background: #eef4f1; border-radius: 999px; color: #1f7a5c; font-size: 14px; font-weight: 700; padding: 9px 14px; }

.metric-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
.metric-card, .panel-card { background: #fff; border: 1px solid #e5eaf1; border-radius: 8px; }
.metric-card { display: flex; flex-direction: column; gap: 13px; padding: 22px; }
.metric-card span { color: #7a8494; font-size: 14px; }
.metric-card strong { font-size: 28px; }
.status-ok { color: #1f7a5c; }
.panel-card { margin-bottom: 20px; padding: 22px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading h2 { font-size: 18px; margin: 0; }
.panel-heading p, .muted { color: #7a8494; line-height: 1.65; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #edf1f5; font-size: 14px; padding: 13px 10px; text-align: left; }
th { color: #7a8494; font-weight: 700; }
.empty-cell { color: #7a8494; text-align: center; }

form label { color: #445062; display: grid; font-size: 14px; font-weight: 700; gap: 8px; margin-bottom: 18px; }
input, textarea { background: #f8fafc; border: 1px solid #dce2ea; border-radius: 7px; color: #17212f; outline: 0; padding: 11px 12px; width: 100%; }
input:focus, textarea:focus { border-color: #1f7a5c; box-shadow: 0 0 0 3px rgba(31, 122, 92, .12); }
.primary { background: #1f7a5c; border: 0; border-radius: 7px; color: #fff; cursor: pointer; font-weight: 800; padding: 12px 18px; }
.form-panel { max-width: 720px; }
.toggle-row { align-items: center; border-bottom: 1px solid #edf1f5; display: flex; justify-content: space-between; padding: 5px 0 18px; }
.toggle-row span { display: grid; gap: 5px; }
.toggle-row small { color: #7a8494; font-weight: 400; }
.toggle-row input { accent-color: #1f7a5c; height: 22px; width: 42px; }
.sticky-save { bottom: 20px; position: sticky; }
.alert { border-radius: 7px; font-size: 14px; margin-bottom: 18px; padding: 12px 14px; }
.alert.success { background: #eef4f1; color: #1f7a5c; }
.alert.error { background: #fff0f0; color: #b33535; }

.login-body { align-items: center; display: flex; justify-content: center; padding: 24px; }
.login-card { background: #fff; border: 1px solid #e5eaf1; border-radius: 8px; max-width: 390px; padding: 32px; width: 100%; }
.login-card h1 { font-size: 25px; margin: 20px 0 8px; }
.login-card > p { color: #7a8494; margin: 0 0 25px; }
.login-card .primary { width: 100%; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { padding: 16px; }
  .brand { padding-bottom: 16px; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .nav a { padding: 10px 7px; text-align: center; }
  .logout { display: none; }
  .main { padding: 18px; }
  .metric-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; gap: 12px; }
}
