/* ---------------------------------------------------------------------------
 * OpenVision GRC — shared styles for the auth and administration pages.
 *
 * The design tokens are copied from index.html's :root block so these pages
 * read as part of the same product. They are deliberately self-contained: the
 * shell's CSS is minified and inline, and nobody should have to untangle it to
 * restyle a login form.
 * ------------------------------------------------------------------------- */

:root {
  --navy: #071225;
  --navy2: #0d1d38;
  --blue: #1677ff;
  --cyan: #11bfd2;
  --orange: #f59e0b;
  --red: #e84d5b;
  --green: #16a36f;
  --purple: #7657d9;
  --ink: #152238;
  --muted: #6b7890;
  --bg: #f3f6fa;
  --card: #fff;
  --line: #e0e7f0;
  --soft: #eef4fb;
  --shadow: 0 12px 35px rgba(7, 18, 37, .08);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ auth layout */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.auth-aside {
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(17, 191, 210, .25), transparent 60%),
    radial-gradient(900px 500px at 90% 100%, rgba(118, 87, 217, .28), transparent 55%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy2) 100%);
  color: #eaf1ff;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-aside .logo-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: .5px;
  color: #fff;
}

.auth-aside h2 { font-size: 26px; margin: 26px 0 10px; font-weight: 700; }
.auth-aside p { color: #9fb0cf; max-width: 44ch; }

.auth-aside ul { list-style: none; padding: 0; margin: 24px 0 0; }
.auth-aside li { padding: 6px 0 6px 26px; position: relative; color: #c7d4ec; }
.auth-aside li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-weight: 700;
}

.auth-frameworks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.auth-frameworks span {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  color: #b9c9e6;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 22px; }

/* ---------------------------------------------------------------- fields */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input, .field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .15);
}

.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.checkbox { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.checkbox input { width: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, background .15s, border-color .15s;
}

.btn:hover { border-color: #c8d4e6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 7px; }

/* --------------------------------------------------------------- notices */

.alert {
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: none;
}
.alert.show { display: block; }
.alert.error { background: #fdecef; border-color: #f3c4cc; color: #a1253a; }
.alert.ok { background: #e9f8f1; border-color: #bde8d4; color: #0f7a51; }
.alert.info { background: var(--soft); border-color: #cfe0f5; color: #274b76; }
.alert.warn { background: #fdf4e3; border-color: #f4ddb0; color: #8a5c07; }

.auth-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-meta { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }

.pw-meter { height: 6px; border-radius: 999px; background: var(--soft); margin-top: 8px; overflow: hidden; }
.pw-meter > i { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

/* ------------------------------------------------------------------ app bar */

.admin-top {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
}
.admin-top .logo-badge {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.admin-top .grow { flex: 1; }
.admin-top .who { color: #9fb0cf; font-size: 13px; }
.admin-top a, .admin-top button { color: #d5e0f4; }

.admin-shell { max-width: 1180px; margin: 0 auto; padding: 26px 20px 60px; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.admin-head h1 { font-size: 22px; margin: 0; }
.admin-head .grow { flex: 1; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  border: none; background: none; padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }

.panel { display: none; }
.panel.active { display: block; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.grid th, table.grid td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
table.grid th {
  background: var(--soft);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr:hover { background: #fafcff; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
}
.badge.ok { background: #e9f8f1; color: #0f7a51; }
.badge.warn { background: #fdf4e3; color: #8a5c07; }
.badge.danger { background: #fdecef; color: #a1253a; }
.badge.info { background: var(--soft); color: #274b76; }
.badge.muted { background: #eef1f6; color: #64707f; }

.card-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-box h3 { margin: 0 0 14px; font-size: 15px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi-mini { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-mini .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.kpi-mini .num { font-size: 24px; font-weight: 800; margin-top: 4px; }

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

.empty { padding: 30px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.modal {
  position: fixed; inset: 0; background: rgba(7, 18, 37, .55);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal.show { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow);
}
.modal-box h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
}
