:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --danger: #dc2626;
  --ok: #059669;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  min-height: 60px;
  background: #0f172a;
  color: #e2e8f0;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2px; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.brand-sub { color: #94a3b8; font-weight: 400; font-size: 12px; margin-left: 4px; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav-link {
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.nav-link:hover { background: #1e293b; text-decoration: none; }
.nav-link.is-active { background: #1e293b; color: #fff; }
.nav-spacer { flex: 1; }
.nav-button { background: none; border: 0; cursor: pointer; font: inherit; color: #cbd5e1; }
.inline-form { display: inline; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; }
.page-head .muted { margin: 0 0 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.card-value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.card-note { font-size: 12px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table tbody tr:hover { background: #f9fafb; }
.table-input input { width: 100%; }

.form label { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: #374151; }
.form input, .form select, .form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 2px solid #bfdbfe; border-color: var(--brand);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .form-row { grid-template-columns: 1fr; } }

.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 6px 0 16px; }
.fieldset legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: #374151; }

.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.btn-danger { border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-mini { padding: 6px 10px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-ready { background: #dbeafe; color: #1d4ed8; }
.badge-completed { background: #d1fae5; color: #047857; }

.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.tabs { display: flex; gap: 6px; margin: 6px 0 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: #374151; font-size: 13.5px;
}
.tab:hover { background: #f3f4f6; text-decoration: none; }
.tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.notes { background: #f8fafc; border-left: 3px solid var(--brand); padding: 8px 12px; border-radius: 6px; }
.ok-text { color: var(--ok); font-weight: 600; }

.meta { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; margin: 12px 0 18px; }
.meta dt { color: var(--muted); font-size: 13px; }
.meta dd { margin: 0; }
@media (max-width: 620px) { .meta { grid-template-columns: 1fr; } }

.pdf-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 10px; }

.service { font-size: 13.5px; color: #374151; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: #10b981; }
.dot-off { background: #ef4444; }

hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card {
  width: 360px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .08);
}
.login-card label { display: block; margin: 14px 0; font-size: 13px; font-weight: 600; color: #374151; }
.login-card input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 8px; font: inherit;
}
.login-card .btn { width: 100%; margin-top: 6px; }
.brand-login { margin-bottom: 6px; color: var(--ink); }

.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0 28px; }

.install-panel { max-width: 780px; margin: 0 auto; }
.install-actions { display: flex; gap: 12px; align-items: center; margin: 8px 0 16px; flex-wrap: wrap; }
.flash-list { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.checkbox { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.checkbox input { width: auto; margin: 0; }
.login-footer { text-align: center; margin: 16px 0 0; }
.advanced { margin: 10px 0 4px; border-top: 1px dashed var(--line); padding-top: 10px; }
.advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #4b5563; margin-bottom: 8px; }
.advanced input, .advanced select { margin-bottom: 8px; }
.preflight { list-style: none; margin: 6px 0 16px; padding: 0; font-size: 13px; }
.preflight li { padding: 3px 0; color: #374151; }
.preflight li.ok { color: #047857; }
.preflight li.bad { color: #b91c1c; font-weight: 600; }
.hint { background: #f8fafc; border-left: 3px solid #93c5fd; padding: 8px 12px; border-radius: 6px; }

