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

:root {
  --blue:       #abdcf1;
  --blue-dim:   rgba(171,220,241,0.18);
  --blue-mid:   rgba(171,220,241,0.4);
  --blue-dark:  #3a9dc4;
  --gray-lt:    #c1c1c1;
  --gray-mid:   #747474;
  --black:      #000000;

  --bg:         #f5f7f9;
  --surface:    #ffffff;
  --surface2:   #f0f3f6;
  --border:     #e4e8ed;
  --border2:    #d0d6de;
  --text:       #111111;
  --muted:      #747474;
  --placeholder:#c1c1c1;

  --success:    #2e9e6b;
  --success-bg: rgba(46,158,107,0.10);
  --warning:    #b87c10;
  --warning-bg: rgba(224,158,76,0.12);
  --danger:     #c0392b;
  --danger-bg:  rgba(192,57,43,0.10);
  --info:       #3a9dc4;
  --info-bg:    rgba(171,220,241,0.18);
}

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── LOGIN ───────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.login-brand-panel {
  width: 420px;
  flex-shrink: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(171,220,241,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo { width: 180px; }

.brand-tagline h2 {
  font-size: 26px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  margin-bottom: 12px;
}

.brand-tagline h2 span { color: var(--blue); }

.brand-tagline p {
  font-size: 13px;
  color: #666;
  line-height: 1.65;
  max-width: 280px;
}

.brand-footer {
  font-size: 11px;
  color: #333;
  letter-spacing: 0.04em;
  margin-top: 3rem;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: var(--bg);
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-welcome { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.login-sub     { font-size: 13px; color: var(--muted); margin-bottom: 2.5rem; }

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--gray-mid); margin-bottom: 8px;
}

.field input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 13px 14px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.field input::placeholder { color: var(--placeholder); }

.login-btn {
  width: 100%; padding: 14px;
  background: var(--black); color: #fff;
  border: none; border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 0.75rem;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.login-btn:hover  { background: #1a1a1a; }
.login-btn:active { transform: scale(0.99); }

.login-error {
  font-size: 12px; color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: 6px; padding: 10px 12px;
  margin-top: 12px; display: none;
}

.login-form-footer {
  margin-top: 2.5rem;
  font-size: 11px; color: var(--placeholder);
  text-align: center; letter-spacing: 0.03em;
  line-height: 1.6;
}

/* ── TOPBAR ──────────────────────────────────────── */
#dashboard-page { display: none; min-height: 100vh; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}

.topbar-left  { display: flex; align-items: center; gap: 14px; }
.topbar-logo  { height: 22px; }
.topbar-divider { width: 1px; height: 20px; background: var(--border2); }
.topbar-label { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.agent-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 13px;
}

.agent-avatar {
  width: 26px; height: 26px;
  background: var(--blue-dim);
  border: 1.5px solid var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  color: var(--blue-dark);
  font-family: 'DM Mono', monospace;
}

.logout-btn {
  font-family: 'Sora', sans-serif; font-size: 12px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px;
  cursor: pointer; transition: all 0.15s;
}
.logout-btn:hover { color: var(--text); border-color: var(--border2); }

/* ── MAIN ────────────────────────────────────────── */
.main {
    padding: 2.5rem 2rem;
    max-width: 100%;
    margin: 0 auto;
}

.page-header { margin-bottom: 2rem; }
.page-title  { font-size: 22px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--muted); }

/* ── METRICS ─────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  position: relative; overflow: hidden;
}

.metric-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--blue);
}

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

.metric-value {
  font-size: 26px; font-weight: 600;
  font-family: 'DM Mono', monospace;
  color: var(--text); line-height: 1; margin-bottom: 6px;
}

.metric-sub      { font-size: 11px; color: var(--muted); }
.metric-sub.up   { color: var(--success); }
.metric-sub.warn { color: var(--warning); }

/* ── TABLE SECTION ───────────────────────────────── */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: visible;
}

.section-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.section-title { font-size: 14px; font-weight: 600; }

.tabs { display: flex; gap: 4px; }

.tab {
  font-family: 'Sora', sans-serif;
  font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer; background: none;
  color: var(--muted); transition: all 0.15s;
}

.tab.active {
  background: var(--blue-dim);
  border-color: var(--blue-mid);
  color: var(--blue-dark);
}

.tab:hover:not(.active) { color: var(--text); background: var(--surface2); }

table { width: 100%; border-collapse: collapse; }

thead th {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted); padding: 12px 1.5rem;
  text-align: left; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

tbody td { padding: 14px 1.5rem; color: var(--text); font-size: 13px; }

.client-name { font-weight: 500; }
.mono        { font-family: 'DM Mono', monospace; font-size: 12px; }
.muted-cell  { color: var(--muted); }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; letter-spacing: 0.03em;
}
.badge::before {
  content: ''; width: 5px; height: 5px;
  border-radius: 50%; background: currentColor;
}
.badge.approved  { background: var(--success-bg); color: var(--success); }
.badge.pending   { background: var(--warning-bg); color: var(--warning); }
.badge.declined  { background: var(--danger-bg);  color: var(--danger);  }
.badge.submitted { background: var(--info-bg);    color: var(--info);    }

.empty-state { text-align: center; padding: 3rem; color: var(--muted); font-size: 13px; }

/* ── IFRAME REPORT ───────────────────────────────── */
.iframe-wrap {
    width: 100%;
    background: var(--surface2);
    min-height: 1400px;
    position: relative;
}

    .iframe-wrap iframe {
        display: block;
        width: 100%;
        min-height: 1400px;
        border: none;
    }

.report-status {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 768px) {
  .login-brand-panel { display: none; }
}
