/* src/dashboard/public/style.css
 * Minimal, dependency-free stylesheet for the Ensales Triage dashboard.
 * Deliberately plain — swap for a real design pass later. No build step.
 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --border: #e2e5ea;
  --text: #1c2230;
  --muted: #6b7280;
  --accent: #2952e3;
  --accent-contrast: #ffffff;
  --success: #1a7f37;
  --error: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.topbar .brand { font-weight: 700; font-size: 1.05rem; }

.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { color: var(--text); text-decoration: none; font-size: 0.92rem; }
.topbar nav a:hover { color: var(--accent); }

.topbar .who { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--muted); }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}

.page { max-width: 960px; margin: 2rem auto; padding: 0 1.5rem; }
.page h1 { margin-bottom: 0.25rem; }

.muted { color: var(--muted); font-size: 0.92rem; }
.note { margin-top: 1.5rem; font-style: italic; }
.empty { padding: 1.5rem; background: var(--panel); border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th { background: #fafbfc; font-weight: 600; }
tr:last-child td { border-bottom: none; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #eef1fb;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.pill-unmatched { background: #fdecea; color: var(--error); }
.pill-shadow { background: #fff4e5; color: #a15c00; }
.pill-forwarded, .pill-categorized { background: #e8f5e9; color: var(--success); }

.footer {
  max-width: 960px;
  margin: 3rem auto 1.5rem;
  padding: 0 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* --- Login page --- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}

.login-card h1 { margin: 0 0 0.4rem; font-size: 1.3rem; }

.login-card form { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.login-card label { font-size: 0.85rem; color: var(--muted); }
.login-card input {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.login-card button {
  margin-top: 0.4rem;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.95rem;
  cursor: pointer;
}

.login-card button:hover { opacity: 0.92; }

.success { color: var(--success); font-size: 0.92rem; }
.error { color: var(--error); font-size: 0.92rem; }

/* --- Phase 1 dashboard additions --- */

.page-wide { max-width: 1280px; }

.pill-ooo { background: #fff4e5; color: #a15c00; }
.pill-inactive { background: #eceff3; color: var(--muted); }

.flash { padding: 0.6rem 0.9rem; border-radius: 6px; font-size: 0.9rem; margin: 0.75rem 0; }
.flash-success { background: #e8f5e9; color: var(--success); border: 1px solid #cfe9d1; }
.flash-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6c2; }

.callout {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  background: var(--panel);
}
.callout h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.callout p { margin: 0.35rem 0; font-size: 0.9rem; }

.callout-coverage { border-left: 4px solid #a15c00; background: #fffaf2; }
.callout-warning { border-left: 4px solid var(--error); background: #fff6f5; }

.ooo-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }

.panel {
  margin-top: 1.75rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1rem; }

.stacked-form { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.stacked-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.stacked-form input[type="text"],
.stacked-form input[type="email"],
.stacked-form input[type="number"],
.stacked-form select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 200px;
}
.stacked-form .checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.92rem;
}
.stacked-form button { align-self: flex-start; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; }

button, .btn-primary {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.88rem;
  cursor: pointer;
}
button:hover, .btn-primary:hover { opacity: 0.92; }

.link-button-danger { color: var(--error); }

.btn-toggle {
  background: #eef1fb;
  color: var(--accent);
}
.btn-toggle-on {
  background: #fff4e5;
  color: #a15c00;
}

table input[type="text"],
table input[type="email"],
table select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
  width: 100%;
  min-width: 110px;
}

.actions-cell { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; white-space: nowrap; }
.actions-cell form { display: inline-flex; margin: 0; }

.inline-edit-form, .inline-toggle-form { margin: 0; display: inline-flex; }

.hidden-forms { display: none; }

.row-inactive { opacity: 0.55; }
.row-flagged { background: #fff8f0; }

.nowrap { white-space: nowrap; }

.assign-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.assign-form select { min-width: 130px; }

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.filter-form select, .filter-form input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* --- Reports page (Phase 3: leadership activity reporting) --- */

.preset-buttons { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.preset-buttons a.btn-toggle { text-decoration: none; }

.custom-range-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.custom-range-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.custom-range-form input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.stat-tile {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-label { margin-top: 0.35rem; color: var(--muted); font-size: 0.82rem; }

.method-breakdown { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.9rem 0 0; }

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.panel-subhead { margin: 0 0 0.5rem; font-size: 0.88rem; color: var(--text); }

/* Horizontal bar charts (manufacturer / category / rep / location volume) */
.bar-chart { display: flex; flex-direction: column; gap: 0.5rem; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 2.5rem; align-items: center; gap: 0.6rem; }
.bar-label {
  font-size: 0.82rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 0.9rem;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  min-width: 2px;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}
.bar-value { font-size: 0.8rem; color: var(--muted); text-align: right; }

/* Daily volume trend — server-rendered CSS bar chart, no client JS */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 0.5rem 0.25rem 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.trend-bar-wrap {
  flex: 1 1 auto;
  min-width: 3px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.trend-bar {
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.trend-day {
  margin-top: 0.25rem;
  font-size: 0.6rem;
  color: var(--muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 3.2rem;
}
