:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --ink: #11263d;
  --muted: #5d6d7e;
  --brand: #0f4c81;
  --brand-dark: #0a3558;
  --accent: #c98a2e;
  --border: #dbe3ec;
  --ok: #1f7a3f;
  --warn: #8a4a00;
  --bad: #9f1c1c;
  --shadow: 0 10px 30px rgba(17, 38, 61, 0.08);
  font-family: "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.page-shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.hero, .card, .module-card, .table-card, .form-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.hero { padding: 28px; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.brand-row { display: flex; align-items: center; gap: 18px; }
.brand-row img { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--border); }
.hero h1 { margin: 0 0 6px; font-size: 30px; }
.hero p { margin: 0; color: var(--muted); }
.toolbar, .suite-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button, button { border: 0; border-radius: 12px; background: var(--brand); color: #fff; padding: 10px 16px; font-weight: 600; cursor: pointer; }
.button.secondary, button.secondary { background: #e8eef5; color: var(--ink); }
.button.warn, button.warn { background: var(--accent); color: #fff; }
.button.bad, button.bad { background: var(--bad); }
.button:hover, button:hover { filter: brightness(0.97); text-decoration: none; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.module-card { padding: 18px; min-height: 180px; display: flex; flex-direction: column; }
.module-card .icon { width: 52px; height: 52px; border-radius: 14px; background: #edf3f9; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: 14px; }
.module-card h3 { margin: 0 0 8px; }
.module-card p { margin: 0 0 12px; color: var(--muted); flex: 1; }
.meta { color: var(--muted); font-size: 13px; }
.card, .table-card, .form-card { padding: 22px; }
.status { padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-weight: 600; }
.status.info { background: #edf3f9; color: var(--brand-dark); }
.status.ok { background: #e9f6ed; color: var(--ok); }
.status.error { background: #fdeeee; color: var(--bad); }
label { display: block; font-weight: 600; margin-bottom: 6px; }
input, textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #c8d3df; border-radius: 10px; font: inherit; }
textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; }
.auth-card img { width: 72px; height: 72px; display: block; margin-bottom: 16px; }
.auth-card h1 { margin: 0 0 10px; }
.footer-note { color: var(--muted); font-size: 13px; margin-top: 14px; }
.code-block { background: #0f1720; color: #dbe9f4; padding: 14px; border-radius: 12px; overflow-x: auto; font-family: Consolas, monospace; font-size: 13px; }
.small-list { margin: 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 720px) { .hero { flex-direction: column; align-items: flex-start; } }
.table-wrap { overflow-x: auto; }
.table-header-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; }
.checkbox-row input { width: auto; }
.compact-actions { gap: 8px; }
.compact-actions button { padding: 8px 10px; }
.admin-shell .card h2,
.admin-shell .form-card h2,
.admin-shell .table-card h2 { margin-top: 0; }
@media (max-width: 720px) {
  .table-header-row { flex-direction: column; align-items: flex-start; }
}


/* ===== Safe full-width/admin-center overrides ===== */
main.page-shell {
  max-width: min(1680px, calc(100vw - 32px));
  width: min(1680px, calc(100vw - 32px));
  padding-left: 16px;
  padding-right: 16px;
}

.admin-shell .card,
.admin-shell .hero,
.admin-shell .form-card,
.admin-shell .table-card {
  width: 100%;
}

.admin-shell .admin-grid.grid.two {
  grid-template-columns: minmax(360px, 0.95fr) minmax(760px, 1.65fr);
  align-items: start;
}

.admin-shell .table-card {
  min-width: 0;
}

.admin-shell .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

.admin-shell table {
  min-width: 980px;
}

.admin-shell th,
.admin-shell td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-shell td:last-child,
.admin-shell th:last-child {
  min-width: 170px;
}

@media (max-width: 1200px) {
  .admin-shell .admin-grid.grid.two {
    grid-template-columns: 1fr;
  }

  .admin-shell table {
    min-width: 760px;
  }
}
