/* =========================================================================
   QA Management Portal — theme.
   Reskinned to match support.witmeg.dev so the two tools read as one product:
   DM Sans + Tabler icons, white sidebar, primary #1B4FD8, light surfaces.
   The QA page-level class names (.panel, .cards, .badge, .chip, .btn …) are
   preserved so the templates are untouched; only the look changes.
   ========================================================================= */
:root {
  --bg: #F4F4F5;
  --surface: #ffffff;
  --border: #E4E4E7;
  --border-soft: #F4F4F5;
  --text: #0C0C0D;
  --text-2: #27272A;
  --text-3: #52525B;
  --text-muted: #A1A1AA;
  --primary: #1B4FD8;
  --primary-dark: #1139A8;
  --primary-soft: #EEF3FD;
  --success: #15803D;
  --success-soft: #F0FDF4;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

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

/* ---- Layout shell (support .shell/.sidebar/.main) ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sb-logo {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
}
.sb-logo .ti { color: var(--primary); font-size: 18px; }
.sb-logo-text { font-size: 15px; font-weight: 600; color: var(--text); }
.sb-sec {
  padding: 12px 12px 4px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em;
}
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 0; }
.sbi {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: var(--radius-sm);
  margin: 1px 7px; font-size: 14px; font-weight: 500;
  color: var(--text-3); cursor: pointer;
  transition: background .1s, color .1s;
}
.sbi:hover { background: var(--border-soft); text-decoration: none; }
.sbi.active { background: var(--primary-soft); color: var(--primary); }
.sbi .ti { font-size: 16px; flex-shrink: 0; }
.sb-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-top: 1px solid var(--border-soft); flex-shrink: 0;
}
.sb-avatar-initials {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.sb-ident { min-width: 0; flex: 1; }
.sb-user-name { font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 12px; color: var(--text-muted); }
.sb-logout {
  margin-left: auto; color: var(--text-muted); font-size: 16px;
  padding: 5px; border-radius: var(--radius-sm); display: flex;
  transition: color .1s, background .1s;
}
.sb-logout:hover { color: var(--danger); background: var(--danger-soft); text-decoration: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 22px 26px; max-width: 1180px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; font-weight: 600; margin: 0; }

/* ---- Cards / stats ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card .num { font-size: 26px; font-weight: 600; color: var(--text); }
.card .label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* ---- Panels / tables ---- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel h2 { font-size: 14px; font-weight: 600; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); background: #FAFAFA; }
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- Badges (soft pills, support palette) ---- */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 9px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: #991B1B; }
.badge.gray { background: var(--border-soft); color: var(--text-3); }
.badge.blue { background: var(--primary-soft); color: var(--primary); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .1s, border-color .1s; }
.btn:hover { background: var(--border-soft); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: #FECACA; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }

/* ---- Forms ---- */
input[type=text], input[type=email], input[type=number], input[type=password], textarea, select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: var(--font); background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,79,216,0.12); }
label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 5px; color: var(--text-3); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 180px; }
form.inline { display: inline; }

/* ---- Toolbar / filters ---- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ---- Access chips (per-portal grant) ---- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--border-soft);
  border: 1px solid var(--border); padding: 3px 9px; border-radius: 16px; font-size: 12px; color: var(--text-3); cursor: pointer; }
.chip.on { background: var(--success-soft); border-color: #BBF7D0; color: var(--success); }
.chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 13px; padding: 0; line-height: 1; }

/* ---- Centered auth pages (login / no-access / request-sent) ---- */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #0F1F6B 0%, #1B4FD8 60%, #3B6FFF 100%); }
.auth-card { background: var(--surface); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 40px; max-width: 420px; width: 100%; text-align: center; }
.auth-card h1 { font-size: 21px; font-weight: 600; margin: 0 0 8px; }
.auth-card p { color: var(--text-3); margin: 0 0 22px; font-size: 14px; line-height: 1.55; }
.auth-card code { font-family: var(--mono); font-size: 12.5px; background: var(--border-soft); padding: 1px 6px; border-radius: 5px; }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px;
  border: 1.5px solid #D4D4D8; border-radius: 8px; font-weight: 500; background: #fff; color: var(--text-2);
  transition: border-color .15s, box-shadow .15s; }
.google-btn:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(27,79,216,0.15); text-decoration: none; }

.muted { color: var(--text-muted); }
details summary { cursor: pointer; font-weight: 500; display: inline-flex; }
details[open] summary { margin-bottom: 4px; }
.empty { padding: 30px; text-align: center; color: var(--text-muted); }
