/* repo-map shared stylesheet — teal/green light theme */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f6f8;
  color: #1e2430;
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Page layout ── */
.page-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 900px;
  padding: 32px 24px;
}

h1 { font-size: 1.4rem; font-weight: 700; color: #1e2430; margin-bottom: 4px; }
h2 { font-size: 1rem; font-weight: 700; color: #1e2430; margin-bottom: 16px; }

/* ── App header ── */
.app-header {
  background: linear-gradient(125deg, #0d2d27 0%, #1b5449 28%, #297969 52%, #31877a 76%, #1a4d44 100%);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header-brand h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.app-header-brand .subtitle {
  font-size: 0.68rem;
  color: #b0e8de;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Page content wrapper (used below sticky header) ── */
.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ── Page header (within content) ── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e2430;
}

.subtitle { color: #7a8394; font-size: 0.82rem; margin-bottom: 20px; }

/* ── Navigation links ── */
.nav-link {
  color: #1b5449;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
}
.nav-link:hover { text-decoration: underline; color: #297969; }

/* ── Form elements ── */
.field { margin-bottom: 14px; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3a4255;
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #1e2430;
  font-size: 0.875rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: #31877a;
  box-shadow: 0 0 0 3px rgba(49, 135, 122, 0.12);
}

textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
input[type="number"] { -moz-appearance: textfield; text-align: center; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ── Buttons ── */
.btn {
  padding: 9px 20px;
  background: #1b5449;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  min-width: 120px;
  transition: background 0.15s;
}
.btn:hover:not(:disabled) { background: #297969; }
.btn:disabled { background: #d1d5db; color: #9ca3af; cursor: not-allowed; }

.btn-secondary {
  padding: 7px 14px;
  background: #fff;
  color: #1b5449;
  border: 1px solid #c0ddd6;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover:not(:disabled) { background: #e8f5f0; border-color: #31877a; }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  padding: 7px 14px;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-danger:hover:not(:disabled) { background: #fef2f2; }

.btn-ghost {
  padding: 6px 12px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.2); }

.btn-row       { margin-top: 14px; }
.btn-row-right { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e2430;
  margin: 0;
}

.card-meta {
  font-size: 0.75rem;
  color: #7a8394;
  margin-top: 4px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-accent {
  border-left: 4px solid #31877a;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th {
  background: #f3f8f5;
  text-align: left;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1b5449;
  border-bottom: 2px solid #c0ddd6;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #374151;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8faf9; }

/* ── Status badges ── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid;
  white-space: nowrap;
}

/* severity */
.badge.critical  { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge.high      { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.badge.medium    { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.badge.low       { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge.pass      { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge.fail      { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* scan statuses */
.badge.queued    { background: #f8fafc; color: #7a8394; border-color: #e2e5ea; }
.badge.running   { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.badge.completed { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge.failed    { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge.cancelled { background: #f8fafc; color: #9ca3af; border-color: #e2e5ea; }

/* providers */
.badge.github    { background: #f8fafc; color: #374151; border-color: #e2e5ea; }
.badge.gitlab    { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.badge.bitbucket { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.badge.azure     { background: #f0f4ff; color: #3b5bdb; border-color: #c5d0fa; }
.badge.upload    { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }

/* ── Messages ── */
.error-msg {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  margin-top: 10px;
  display: none;
}
.error-msg.visible { display: block; }

.success-msg {
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  margin-top: 10px;
  display: none;
}
.success-msg.visible { display: block; }

.info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #1d4ed8;
  margin-bottom: 16px;
  display: none;
}
.info-banner.visible { display: block; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #7a8394;
  font-size: 0.875rem;
}
.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state p { margin-bottom: 8px; }

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #c0ddd6;
  border-top-color: #31877a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: none;
  align-items: center;
  color: #7a8394;
  font-size: 0.82rem;
  padding: 16px 0;
}
.loading-row.visible { display: flex; }

/* ── Collapsible section ── */
.collapsible-toggle {
  background: #e8f5f0;
  border: 1px solid #c0ddd6;
  border-radius: 6px;
  color: #1b5449;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  font-family: inherit;
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
  transition: background 0.15s;
}
.collapsible-toggle:hover { background: #d0ece4; }

.collapsible-body { display: none; }
.collapsible-body.open { display: block; }

/* ── Auth pages ── */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 24px;
  min-height: 100vh;
  background: #f5f6f8;
}

.auth-card {
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  padding: 30px 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 1px 6px rgba(49, 135, 122, 0.08);
  border-top: 4px solid #31877a;
}

.auth-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1e2430;
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand .brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1b5449;
}

.auth-brand .brand-sub {
  font-size: 0.78rem;
  color: #7a8394;
  margin-top: 2px;
}

.auth-footer {
  margin-top: 18px;
  font-size: 0.82rem;
  color: #7a8394;
  text-align: center;
}

.auth-footer a {
  color: #1b5449;
  text-decoration: none;
  font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; color: #297969; }

/* ── Section label ── */
.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #1b5449;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8f5f0;
}

/* ── Action link ── */
a.action-link {
  color: #1b5449;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
a.action-link:hover { text-decoration: underline; color: #297969; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid #e2e5ea;
  margin: 16px 0;
}

/* ── Monospace (repo URLs, branches) ── */
.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.8rem;
  color: #374151;
}
