/* ── Coda Technologies — Internal Tools Design System ──────────────────────── */

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-page:    #060d16;
  --bg-surface: #0d1117;
  --bg-raised:  #111827;
  --bg-hover:   #0f1823;
  --bg-header:  #161b27;

  /* Borders */
  --border:     #21293a;
  --border-subtle: #1a2235;

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #e2e8f0;
  --text-muted:     #94a3b8;
  --text-faint:     #64748b;
  --text-ghost:     #4b5563;

  /* Accent — blue */
  --accent:         #3b5bdb;
  --accent-hover:   #4c6ef5;
  --accent-subtle:  rgba(96, 165, 250, 0.1);
  --accent-text:    #60a5fa;

  /* Semantic colors */
  --green-bg:   #14532d;
  --green-border: #166534;
  --green-text: #86efac;
  --green-bright: #4ade80;

  --yellow-bg:  #2d2510;
  --yellow-text: #fcd34d;

  --red-bg:     #2d1a1a;
  --red-text:   #fca5a5;
  --red-bright: #f87171;

  --purple-bg:  #1e1b4b;
  --purple-border: #3730a3;
  --purple-text: #a5b4fc;

  --blue-text:  #93c5fd;

  /* Spacing */
  --radius-sm:  6px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  14px;
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-secondary);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Site Header ──────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.site-logo svg { display: block; flex-shrink: 0; }
.site-logo-sub {
  font-size: 10px;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 600;
}

.site-nav { display: flex; align-items: center; gap: 2px; }
.nav-link {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  color: var(--text-ghost);
  transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text-muted); }
.nav-link.active {
  color: var(--accent-text);
  background: var(--accent-subtle);
}

/* ── Page Wrapper ─────────────────────────────────────────────────────────── */
.page-body {
  padding: 28px 20px 60px;
}
.page-main {
  max-width: 1300px;
  margin: 0 auto;
}
.page-main-md {
  max-width: 900px;
  margin: 0 auto;
}
.page-main-sm {
  max-width: 700px;
  margin: 0 auto;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
  letter-spacing: -.02em;
}
h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}
.subtitle {
  font-size: 13px;
  color: var(--text-ghost);
  margin: 0 0 28px;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 16px;
}

/* ── Form Elements ────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

input[type=text],
input[type=date],
input[type=number],
input[type=email],
select,
textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
input[type=text]:focus,
input[type=date]:focus,
input[type=number]:focus,
input[type=email]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input::placeholder,
textarea::placeholder { color: var(--text-ghost); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary {
  background: #1a2235;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover:not(:disabled) { background: var(--border); color: var(--text-primary); }

.btn-green { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-text); }
.btn-green:hover:not(:disabled) { background: var(--green-border); }

.btn-danger { background: var(--red-bg); border: 1px solid #7f1d1d; color: var(--red-text); }
.btn-danger:hover:not(:disabled) { background: #7f1d1d; }

.btn-sm {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: .15s;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-yes     { background: var(--green-bg);   color: var(--green-text); }
.badge-partial { background: var(--yellow-bg);  color: var(--yellow-text); }
.badge-no      { background: var(--red-bg);     color: var(--red-text); }
.badge-na      { background: #1a2235;           color: var(--text-faint); }
.badge-blue    { background: var(--purple-bg);  color: var(--purple-text); }
.badge-green   { background: var(--green-bg);   color: var(--green-text); }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-ghost);
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border-subtle); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 10px 14px; vertical-align: top; color: var(--text-secondary); }

/* ── Progress Bar ─────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 6px;
  margin-bottom: 16px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width .4s;
  width: 0%;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 20px;
  width: fit-content;
}
.tab-btn {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-faint);
  font-family: inherit;
  transition: .15s;
}
.tab-btn.active { background: #1a2235; color: var(--text-primary); }

/* ── Status Messages ──────────────────────────────────────────────────────── */
.status-msg       { font-size: 13px; margin-top: 10px; }
.status-msg.error { color: var(--red-bright); }
.status-msg.ok    { color: var(--green-bright); }

/* ── Step Log (progress steps) ────────────────────────────────────────────── */
.step-log { display: flex; flex-direction: column; gap: 4px; }
.step-item {
  font-size: 12px;
  color: var(--text-ghost);
  display: flex;
  align-items: center;
  gap: 6px;
}
.step-item.done   { color: var(--green-bright); }
.step-item.active { color: var(--blue-text); }
.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
[hidden] { display: none !important; }
.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-green  { color: var(--green-bright); }
.text-red    { color: var(--red-bright); }
.text-blue   { color: var(--accent-text); }
.text-bold   { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
