/* Settlement Automation — GlobalPayNG Brand Theme */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── GlobalPayNG Brand Colours ── */
  --brand-green:    #2a9a4e;
  --brand-yellow:   #fece05;
  --brand-orange:   #ec6b2f;
  --brand-dark:     #0a1628;
  --brand-gradient: linear-gradient(90deg, #2a9a4e 0%, #ec6b2f 55%, #fece05 100%);

  /* ── Backgrounds ── */
  --bg:        #eef1f6;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;

  /* ── Borders ── */
  --border:    #e2e8f0;
  --border-2:  #ccd5e0;

  /* ── Accent (primary interactive) ── */
  --accent:      #2a9a4e;
  --accent-dim:  #1e7a3a;
  --accent-glow: rgba(42, 154, 78, 0.14);

  /* ── Status colours ── */
  --green:      #2a9a4e;
  --green-dim:  #dcfce7;
  --red:        #ef4444;
  --red-dim:    #fef2f2;
  --yellow:     #d97706;
  --yellow-dim: #fefce8;
  --blue:       #2563eb;
  --blue-dim:   #eff6ff;
  --orange:     #ec6b2f;
  --orange-dim: #fff3ed;

  /* ── Text ── */
  --text:       #0f172a;
  --text-muted: #64748b;
  --text-dim:   #475569;

  /* ── Typography ── */
  --font:      'Plus Jakarta Sans', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --radius:    10px;
  --radius-sm: 6px;

  /* ── Shadows ── */
  --shadow-card: 0 1px 3px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.04);
  --shadow-raise: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--surface-2); }
::-webkit-scrollbar-thumb        { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Tri-colour brand gradient bar */
nav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-gradient);
  pointer-events: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-logo {
  height: 34px;
  width: auto;
}

.nav-brand-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.04em;
  line-height: 1;
}

.nav-brand-text em {
  font-style: normal;
  color: inherit;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

nav a:hover { color: var(--text); }

nav a.active {
  color: var(--brand-green);
  border-bottom-color: var(--brand-green);
  font-weight: 600;
}

.nav-spacer { flex: 1; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-green);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Gradient accent bar — green → orange */
.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, var(--brand-green), var(--brand-orange));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Summary grid ────────────────────────────────────────────────────────── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.stat-box:hover {
  box-shadow: var(--shadow-raise);
  transform: translateY(-1px);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-all;
}

.stat-value.ok   { color: var(--green); }
.stat-value.warn { color: var(--yellow); }
.stat-value.err  { color: var(--red); }

/* ── Upload area ─────────────────────────────────────────────────────────── */
.upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.upload-box {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
  background: var(--surface-2);
}

.upload-box:hover,
.upload-box.dragover {
  border-color: var(--accent);
  background: rgba(42, 154, 78, 0.04);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.upload-icon {
  font-size: 22px;
  margin-bottom: 6px;
  display: block;
  opacity: 0.4;
}

.upload-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  margin-top: 8px;
  min-height: 16px;
  word-break: break-all;
}

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

input[type="date"],
input[type="text"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

input[type="date"]:focus,
input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(42,154,78,0.3), 0 4px 10px rgba(42,154,78,0.12);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.btn:hover {
  background: var(--accent-dim);
  box-shadow: 0 2px 6px rgba(42,154,78,0.4), 0 6px 18px rgba(42,154,78,0.15);
}

.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(42,154,78,0.2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(42, 154, 78, 0.04);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.btn-sm   { padding: 5px 12px; font-size: 12px; }
.btn-red  { background: var(--red); box-shadow: 0 1px 3px rgba(239,68,68,0.25); }
.btn-red:hover { background: #dc2626; box-shadow: 0 2px 6px rgba(239,68,68,0.35); }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--brand-green);
  border-bottom-color: var(--brand-green);
  font-weight: 600;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-green  { background: var(--green-dim);  color: #166534; }
.badge-red    { background: var(--red-dim);    color: #991b1b; }
.badge-yellow { background: var(--yellow-dim); color: #92400e; }
.badge-blue   { background: var(--blue-dim);   color: #1e40af; }
.badge-gray   { background: #f1f5f9;           color: var(--text-muted); }
.badge-purple { background: rgba(139,92,246,.12); color: #6d28d9; }

/* ── Table ───────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: #f1f5f9;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover    { background: #f5fdf8; }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  white-space: normal;
  word-break: break-word;
  max-width: 220px;
}

/* ── Loading / empty ─────────────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 7px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  border-left: 3px solid transparent;
  font-weight: 500;
  line-height: 1.5;
}

.alert.show    { display: block; }
.alert-success { background: #f0fdf4; border-color: var(--green); color: #166534; }
.alert-error   { background: #fef2f2; border-color: var(--red);   color: #991b1b; }
.alert-info    { background: #eff6ff; border-color: var(--blue);   color: #1e40af; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .upload-row    { grid-template-columns: 1fr; }
  .summary-grid  { grid-template-columns: repeat(2, 1fr); }
  nav            { padding: 0 16px; gap: 14px; }
  .container     { padding: 20px 16px; }
  nav a          { font-size: 12px; }
}
