/* AEOS Operator Dashboard — v0.00001 */
/* Colour palette: dark base, gold accent, clean */

:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --border:    #2a2a2a;
  --gold:      #c9a84c;
  --gold-dim:  #8a7035;
  --text:      #e8e8e8;
  --text-muted:#888;
  --green:     #4caf6e;
  --amber:     #e0a030;
  --red:       #c94c4c;
  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:    8px;
}

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

body { font-family: var(--font); background: var(--bg); color: var(--text); }

/* ── BRAND ── */
.brand-ae  { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.5px; color: var(--gold); }
.brand-os  { font-weight: 300; font-size: 1.4rem; color: var(--text-muted); }
.header-version { font-size: 0.65rem; color: var(--text-muted); margin-left: 8px; vertical-align: middle; }

/* ── LOGIN ── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.login-container {
  width: 320px; padding: 2.5rem 2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.login-brand { margin-bottom: 0.25rem; }
.login-sub { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 2rem; }
.login-error {
  background: #3a1a1a; border: 1px solid var(--red);
  color: #e88; padding: 0.6rem 1rem; border-radius: 4px;
  font-size: 0.82rem; margin-bottom: 1rem;
}
.login-form { display: flex; flex-direction: column; gap: 0.75rem; }
.login-form input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.7rem 0.9rem;
  border-radius: 4px; font-size: 0.9rem;
  outline: none; transition: border-color 0.15s;
}
.login-form input:focus { border-color: var(--gold); }
.login-form button {
  background: var(--gold); color: #000; font-weight: 700;
  padding: 0.75rem; border: none; border-radius: 4px;
  font-size: 0.9rem; cursor: pointer; transition: opacity 0.15s;
  margin-top: 0.25rem;
}
.login-form button:hover { opacity: 0.88; }

/* ── DASHBOARD HEADER ── */
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.header-meta { display: flex; align-items: center; gap: 1.5rem; }
.header-time { font-size: 0.82rem; color: var(--text-muted); }
.logout-link { font-size: 0.78rem; color: var(--gold-dim); text-decoration: none; }
.logout-link:hover { color: var(--gold); }

/* ── DASHBOARD GRID ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 1px;
  background: var(--border);
  min-height: calc(100vh - 57px - 36px);
}

.panel {
  background: var(--surface);
  padding: 1.5rem;
}

/* Priorities spans full width on mobile, left col on desktop */
.panel-priorities { grid-column: 1; }
.panel-streams    { grid-column: 2; }
.panel-pipeline   { grid-column: 1; }
.panel-actions    { grid-column: 2; }
.panel-invoices   { grid-column: 1; }

.panel-title {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.panel-subtitle {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
  margin-top: 1.25rem; margin-bottom: 0.6rem;
}
.panel-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ── PRIORITIES ── */
.priority-list { list-style: none; counter-reset: prio; }
.priority-list li {
  counter-increment: prio;
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem; line-height: 1.4;
}
.priority-list li::before {
  content: counter(prio);
  min-width: 20px; height: 20px;
  background: var(--gold); color: #000;
  border-radius: 50%; font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.priority-list li:last-child { border-bottom: none; }
.priority-list li { justify-content: space-between; }
.priority-text { flex: 1; }
.priority-done-form { margin: 0; }
.priority-done-btn {
  background: transparent; border: 1px solid var(--border); color: var(--green);
  border-radius: 4px; width: 22px; height: 22px; font-size: 0.75rem;
  cursor: pointer; line-height: 1; flex-shrink: 0;
}
.priority-done-btn:hover { background: rgba(76,175,110,0.12); border-color: var(--green); }
.priority-add-form {
  display: flex; gap: 0.5rem; margin-top: 1rem;
}
.priority-add-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.82rem;
  outline: none;
}
.priority-add-form input:focus { border-color: var(--gold); }
.priority-add-form button {
  background: var(--gold); color: #000; font-weight: 700; border: none;
  padding: 0.5rem 0.9rem; border-radius: 4px; font-size: 0.78rem; cursor: pointer;
}

.done-list { list-style: none; }
.done-list li {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.35rem 0;
  padding-left: 1rem;
  position: relative;
}
.done-list li::before {
  content: '✓';
  position: absolute; left: 0; color: var(--green); font-size: 0.75rem;
}

/* ── STREAMS ── */
.stream-list { list-style: none; }
.stream-item {
  font-size: 0.82rem; padding: 0.6rem 0.75rem;
  border-radius: 4px; margin-bottom: 0.4rem;
  border-left: 3px solid var(--border);
  line-height: 1.4;
}
.stream-live    { border-left-color: var(--green); background: rgba(76,175,110,0.06); }
.stream-building { border-left-color: var(--amber); background: rgba(224,160,48,0.06); }

/* ── PIPELINE LIVE SNAPSHOT ── */
.stage-count-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.stage-count-item {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.65rem; border-radius: 14px;
  border: 1px solid var(--border); font-size: 0.75rem;
}
.stage-count-name { color: var(--text-muted); letter-spacing: 0.03em; }
.stage-count-value { color: var(--text); font-weight: 700; }
.stage-count-item.stage-closing  { border-color: var(--green); }
.stage-count-item.stage-engaged  { border-color: var(--gold); }
.stage-count-item.stage-warm     { border-color: var(--amber); }

.attention-list { list-style: none; }
.attention-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  font-size: 0.8rem; padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.attention-list li:last-child { border-bottom: none; }
.attention-venue { color: var(--text); }
.attention-detail { color: var(--red); font-size: 0.72rem; white-space: nowrap; }

/* ── PIPELINE + ACTIONS ── */
.flag-list, .action-list { list-style: none; }
.flag-list li, .action-list li {
  font-size: 0.82rem; padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.4; color: var(--text);
}
.flag-list li:last-child, .action-list li:last-child { border-bottom: none; }

.action-list li {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem;
}
.action-text { flex: 1; }
.action-done-form { margin: 0; }
.action-done-btn {
  background: transparent; border: 1px solid var(--border); color: var(--green);
  border-radius: 4px; width: 22px; height: 22px; font-size: 0.75rem;
  cursor: pointer; line-height: 1; flex-shrink: 0;
}
.action-done-btn:hover { background: rgba(76,175,110,0.12); border-color: var(--green); }
.action-add-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.action-add-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.82rem;
  outline: none;
}
.action-add-form input:focus { border-color: var(--gold); }
.action-add-form button {
  background: var(--gold); color: #000; font-weight: 700; border: none;
  padding: 0.5rem 0.9rem; border-radius: 4px; font-size: 0.78rem; cursor: pointer;
}

/* ── INVOICES ── */
.invoice-list { list-style: none; }
.invoice-item {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: baseline;
  font-size: 0.82rem; padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding-left: 0.5rem;
  line-height: 1.4;
}
.invoice-item:last-child { border-bottom: none; }
.invoice-item.invoice-overdue {
  border-left-color: var(--red);
  background: rgba(201,76,76,0.06);
}
.invoice-ref    { font-weight: 700; color: var(--gold); }
.invoice-amount { color: var(--text); }
.invoice-due    { color: var(--text-muted); font-size: 0.75rem; }
.invoice-status { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }
.invoice-overdue .invoice-status { color: var(--red); }

.empty-state { color: var(--text-muted); font-size: 0.82rem; font-style: italic; }

/* ── FOOTER ── */
.dash-footer {
  padding: 0.6rem 1.5rem;
  font-size: 0.65rem; color: var(--border);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .dash-grid { grid-template-columns: 1fr; }
  .panel-priorities, .panel-streams,
  .panel-pipeline, .panel-actions,
  .panel-invoices { grid-column: 1; }
}

/* ── ADMIN SCREENS (portal login management, 9 Jul 2026) ── */
.admin-main { padding: 1.5rem; max-width: 900px; margin: 0 auto; }
.admin-main-narrow { max-width: 480px; }
.admin-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.admin-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.admin-subtext { font-size: 0.8rem; color: var(--text-muted); margin: -0.5rem 0 1rem; }

.admin-btn-primary {
  background: var(--gold); color: #000; font-weight: 700;
  border: none; border-radius: 4px; padding: 0.5rem 1rem;
  font-size: 0.8rem; text-decoration: none; cursor: pointer;
  display: inline-block;
}
.admin-btn-primary:hover { opacity: 0.88; }
.admin-btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.5rem 1rem; font-size: 0.8rem;
  text-decoration: none; display: inline-block;
}
.admin-btn-ghost:hover { border-color: var(--text-muted); }

.admin-message {
  background: rgba(76,175,110,0.1); border: 1px solid var(--green);
  color: var(--green); padding: 0.6rem 1rem; border-radius: 4px;
  font-size: 0.82rem; margin-bottom: 1rem;
}
.admin-error {
  background: rgba(201,76,76,0.1); border: 1px solid var(--red);
  color: #e88; padding: 0.6rem 1rem; border-radius: 4px;
  font-size: 0.82rem; margin-bottom: 1rem;
}

/* ── PORTAL USERS TABLE ── */
.pu-table {
  border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.pu-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.6fr 0.9fr 1.5fr;
  gap: 0.5rem; align-items: center;
  padding: 0.65rem 0.9rem; font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.pu-row:last-child { border-bottom: none; }
.pu-row-head {
  background: var(--surface); font-size: 0.68rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.pu-username { font-family: monospace; color: var(--text); }
.pu-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.venue-badge {
  background: rgba(76,175,110,0.12); color: var(--green);
  font-size: 0.7rem; padding: 0.15rem 0.55rem; border-radius: 10px;
}
.pu-noaccess { color: var(--red); font-size: 0.75rem; }
.pu-created { color: var(--text-muted); font-size: 0.75rem; }
.pu-actions { display: flex; gap: 0.75rem; font-size: 0.75rem; }
.pu-actions a { color: var(--gold); text-decoration: none; }
.pu-actions a:hover { text-decoration: underline; }
.pu-action-dim { color: var(--gold-dim) !important; }

/* ── ADMIN FORMS ── */
.admin-form { display: flex; flex-direction: column; gap: 1rem; }
.admin-label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.78rem; color: var(--text-muted);
}
.admin-label-standalone {
  font-size: 0.78rem; color: var(--text-muted); margin: 0.25rem 0 -0.5rem;
}
.admin-label input {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.6rem 0.8rem; border-radius: 4px;
  font-size: 0.88rem; outline: none;
}
.admin-label input:focus { border-color: var(--gold); }
.checkbox-list {
  display: flex; flex-direction: column; gap: 0.5rem;
  border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 0.9rem;
}
.checkbox-item {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.85rem; color: var(--text);
}
.admin-form-actions { display: flex; gap: 0.75rem; margin-top: 0.25rem; }

/* ── RESPONSIVE (admin screens) ── */
@media (max-width: 680px) {
  .pu-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .pu-row-head { display: none; }
  .pu-row:not(.pu-row-head) { padding: 0.75rem 0.9rem; }
  .pu-actions { margin-top: 0.4rem; }
}
