/* ---- Corriente Digital brand tokens (see brand/Brand_Guidelines.pdf) ---- */
:root {
  --flow-blue: #1E6EFF;
  --mid-violet: #7A2BFF;
  --flow-violet: #B038FF;
  --brand-dark: #0B1120;
  --ink: #1E293B;
  --body-text: #334155;
  --muted: #64748B;
  --muted-light: #94A3B8;
  --border-light: #E2E8F0;
  --success: #0F6E56;
  --success-bg: #E7F5F1;
  --danger: #A32D2D;
  --danger-bg: #FBEAEA;
  --brand-gradient: linear-gradient(90deg, var(--flow-blue), var(--flow-violet));
}

* { box-sizing: border-box; }
body {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  padding: 24px 32px;
  background: #F4F6FB;
  color: var(--body-text);
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
h1 { font-size: 22px; font-weight: 700; margin: 0; color: var(--brand-dark); }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11,17,32,0.08);
  border-radius: 8px;
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: top;
}
th {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
}
tr.row-approved { background: var(--success-bg); }
tr.row-sent { background: #f0f0f0; color: #888; }
.opener { max-width: 320px; }
.score {
  display: inline-block;
  min-width: 26px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
}
.score-high { background: var(--success); }
.score-mid { background: #ef6c00; }
.score-low { background: var(--muted); }
.actions { white-space: nowrap; }
.btn {
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
}
.btn.approve { background: var(--success); color: #fff; }
.btn.reject { background: var(--danger); color: #fff; }
.btn.send { background: var(--brand-gradient); color: #fff; }
.btn.secondary { background: var(--brand-dark); color: #fff; }
.btn.brand { background: var(--brand-gradient); color: #fff; }
.btn.brand:hover, .btn.send:hover { filter: brightness(1.08); }
.btn:disabled { background: #ccc; cursor: not-allowed; filter: none; }
.empty { color: var(--muted); font-style: italic; }
.contact-form { display: flex; gap: 4px; white-space: nowrap; }
.contact-form input { font-size: 12px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; width: 150px; }

/* ---- Nav / header brand lockup ---- */
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { height: 30px; width: auto; display: block; }
.navbar { display: flex; gap: 16px; font-size: 13px; }
.navbar a { color: var(--flow-blue); text-decoration: none; font-weight: 600; }
.navbar a:hover { text-decoration: underline; }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }

/* ---- Sidebar layout ---- */
body.with-sidebar { padding: 0; }
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--brand-dark);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.sidebar-logo { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto 28px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 6px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--brand-gradient); color: #fff; }
.sidebar-section {
  margin: 18px 0 4px;
  padding: 0 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-light);
}
.sidebar-logout {
  color: #CBD5E1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logout:hover { color: #fff; }
.main-content { flex: 1; min-width: 0; padding: 24px 32px; }

/* ---- Auth screens (login / forgot / reset password) ---- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background: var(--brand-dark); }
.auth-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.28);
  padding: 36px 36px 32px;
  width: 340px;
  text-align: center;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-gradient);
}
.auth-logo { width: 120px; height: auto; margin: 0 auto 16px; display: block; }
.auth-sub { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.auth-error { background: var(--danger-bg); color: var(--danger); font-size: 12.5px; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.auth-form label { font-size: 12px; color: #444; margin-top: 8px; }
.auth-form input { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; font-family: inherit; }
.auth-form input:focus { outline: none; border-color: var(--flow-blue); box-shadow: 0 0 0 3px rgba(30,110,255,0.15); }
.auth-submit { margin-top: 16px; width: 100%; padding: 10px; font-size: 14px; }
.auth-link-btn { display: block; text-decoration: none; box-sizing: border-box; }
.auth-footnote { margin: 16px 0 0; font-size: 12.5px; }
.auth-footnote a { color: var(--flow-blue); text-decoration: none; font-weight: 600; }
.auth-footnote a:hover { text-decoration: underline; }
.auth-remember { margin-top: 10px !important; font-size: 12.5px; color: #444; }

/* ---- Show/hide password toggle (injected by _head.html's script) ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 54px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--flow-blue); font-size: 11.5px;
  font-weight: 600; cursor: pointer; padding: 2px 6px; font-family: inherit;
}
.pw-toggle:hover { text-decoration: underline; }

/* ---- Settings / admin forms ---- */
.settings-form { max-width: 640px; }
.panel { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(11,17,32,0.08); padding: 18px 22px; margin-bottom: 18px; }
.panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; color: var(--brand-dark); }
.panel label { display: block; font-size: 12.5px; font-weight: 600; color: #333; margin-top: 12px; margin-bottom: 4px; }
.panel label:first-child { margin-top: 0; }
.panel input[type="text"], .panel input[type="password"], .panel input[type="email"], .panel input[type="number"], .panel textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.panel input:focus, .panel textarea:focus { outline: none; border-color: var(--flow-blue); box-shadow: 0 0 0 3px rgba(30,110,255,0.15); }
.panel textarea { resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.checkbox-row input { width: auto; }
.radio-group { display: flex; gap: 16px; font-weight: 400; font-size: 13px; margin-bottom: 6px; }
.radio-group label { display: flex; align-items: center; gap: 4px; font-weight: 400; margin: 0; }
.shared-note { font-size: 12.5px; color: var(--muted); background: #f0f1f3; padding: 6px 10px; border-radius: 6px; margin: 0; }
.flash-ok { background: var(--success-bg); color: var(--success); padding: 8px 12px; border-radius: 6px; font-size: 13px; max-width: 640px; }
.src-badge { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }
.src-badge.src-own { background: var(--success-bg); color: var(--success); }
.src-badge.src-shared { background: #eef4fb; color: var(--flow-blue); }

/* ---- Branded confirm modal (replaces window.confirm()) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,17,32,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 28px 30px;
  width: 340px;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 8px 32px rgba(11,17,32,0.28);
}
.modal-icon { width: 34px; height: auto; margin-bottom: 12px; }
.modal-message { font-size: 14px; color: var(--ink); margin: 0 0 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { flex: 1; padding: 9px 12px; font-size: 13px; margin-right: 0; }
