/* SAS — Security Assessment Automation System
   Minimal, self-contained CSS (no framework dependency) */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  color: #1a1a1a;
  background: #f7f8fa;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #2E5395; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: #1F3864; color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.brand { font-weight: 600; color: white; font-size: 16px; }
.topnav { flex: 1; display: flex; gap: 18px; }
.topnav a { color: #d7e3f4; font-size: 13px; }
.topnav a:hover { color: white; text-decoration: none; }
.topright { display: flex; align-items: center; gap: 12px; }
.user-badge { font-size: 13px; color: #d7e3f4; }
.user-badge small { color: #a8bcd7; }
.btn-link {
  background: transparent; border: 1px solid #8fa8ce; color: #d7e3f4;
  padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.btn-link:hover { background: rgba(255,255,255,.1); }

/* ---- Content ---- */
.content { max-width: 1280px; margin: 24px auto; padding: 0 24px; }
.footer { text-align: center; color: #888; padding: 20px 0 40px; font-size: 12px; }
h1 { font-size: 22px; margin: 0 0 16px; color: #1F3864; }
h2 { font-size: 17px; margin: 20px 0 12px; color: #1F3864; }
h3 { font-size: 14px; margin: 16px 0 8px; color: #555; }

/* ---- Cards ---- */
.card {
  background: white; border-radius: 6px;
  border: 1px solid #e1e4e8;
  padding: 16px; margin-bottom: 16px;
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* ---- KPI cards ---- */
.kpi {
  background: white; border-radius: 6px; border: 1px solid #e1e4e8;
  padding: 16px 20px;
}
.kpi .label { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.kpi .value { font-size: 28px; font-weight: 700; color: #1F3864; }
.kpi .unit  { font-size: 14px; color: #6b7280; font-weight: 400; }

/* ---- Tables ---- */
table.data {
  width: 100%; border-collapse: collapse; background: white;
  font-size: 13px; border: 1px solid #e1e4e8; border-radius: 6px;
  overflow: hidden;
}
table.data th, table.data td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef0f2;
}
table.data th {
  background: #f4f6f9; color: #1F3864; font-weight: 600; font-size: 12px;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: #fafbfc; }

/* ---- Severity badges ---- */
.sev { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; }
.sev.Critical { background: #fdecec; color: #A32D2D; }
.sev.High     { background: #fdeee3; color: #993C1D; }
.sev.Medium   { background: #fdf4e0; color: #BA7517; }
.sev.Low      { background: #eef6df; color: #3B6D11; }
.sev.Info     { background: #eef0f2; color: #5F5E5A; }

/* ---- Status badges ---- */
.st { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; }
.st.open       { background: #fdecec; color: #A32D2D; }
.st.confirmed  { background: #fdeee3; color: #993C1D; }
.st.fixed      { background: #eef6df; color: #3B6D11; }
.st.fp         { background: #eef0f2; color: #5F5E5A; }
.st.ignored    { background: #eef0f2; color: #888; }
.st.queued     { background: #e6f1fb; color: #185FA5; }
.st.running    { background: #fdf4e0; color: #BA7517; }
.st.success    { background: #eef6df; color: #3B6D11; }
.st.partial    { background: #fdf4e0; color: #BA7517; }
.st.failed     { background: #fdecec; color: #A32D2D; }
.st.pending    { background: #fdf4e0; color: #BA7517; }
.st.approved   { background: #eef6df; color: #3B6D11; }
.st.rejected   { background: #eef0f2; color: #5F5E5A; }

/* ---- Forms ---- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #333; margin-bottom: 4px; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
  width: 100%; padding: 8px 10px; font-size: 14px;
  border: 1px solid #d1d5da; border-radius: 4px; background: white;
  font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group small.hint { color: #888; font-size: 12px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 7px 14px; border-radius: 4px;
  border: 1px solid transparent; cursor: pointer;
  font-size: 13px; text-decoration: none; font-family: inherit;
}
.btn-primary { background: #2E5395; color: white; border-color: #2E5395; }
.btn-primary:hover { background: #1F3864; color: white; text-decoration: none; }
.btn-secondary { background: white; color: #333; border-color: #d1d5da; }
.btn-secondary:hover { background: #f4f6f9; text-decoration: none; }
.btn-danger { background: #A32D2D; color: white; border-color: #A32D2D; }
.btn-danger:hover { background: #791F1F; color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- Alerts ---- */
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; font-size: 13px; border: 1px solid; }
.alert-error { background: #fdecec; color: #791F1F; border-color: #f5c1c1; }
.alert-success { background: #eef6df; color: #173404; border-color: #c0dd97; }
.alert-info { background: #e6f1fb; color: #042C53; border-color: #b5d4f4; }
.alert-warning { background: #fdf4e0; color: #633806; border-color: #fac775; }

/* ---- Login box ---- */
.login-wrapper { max-width: 400px; margin: 80px auto; }
.login-card { background: white; padding: 32px; border-radius: 8px; border: 1px solid #e1e4e8; }
.login-card h1 { text-align: center; margin-bottom: 24px; }

/* ---- Filters/toolbar ---- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 6px 10px; font-size: 13px; border: 1px solid #d1d5da; border-radius: 4px; background: white; }
.toolbar .spacer { flex: 1; }

/* ---- Inline form ---- */
form.inline { display: inline-block; margin: 0; }

/* ---- Code/JSON ---- */
pre.code {
  background: #f4f4f4; border: 1px solid #e1e4e8; border-radius: 4px;
  padding: 10px 14px; font-size: 12px; overflow-x: auto;
  font-family: "Consolas", "Monaco", monospace;
}

/* ---- Donut (simple CSS) ---- */
.donut-list { list-style: none; padding: 0; margin: 0; }
.donut-list li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eee; font-size: 13px; }
.donut-list li:last-child { border-bottom: none; }

.muted { color: #888; }
.mono { font-family: "Consolas", monospace; font-size: 12px; }
