:root {
  --bg: #0a0b0d;
  --surface: #111317;
  --surface-raised: #171a1f;
  --line: #2a2e35;
  --line-soft: rgba(255,255,255,.07);
  --text: #f4f5f2;
  --muted: #969ca5;
  --signal: #c8ff3d;
  --signal-dark: #1d2908;
  --blue: #6f88ff;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 0 30px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    var(--bg);
  background-size: 80px 80px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(200,255,61,.35);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.ambient { position: fixed; pointer-events: none; filter: blur(90px); opacity: .22; border-radius: 50%; }
.ambient-one { width: 320px; height: 320px; top: -120px; right: 6%; background: var(--blue); }
.ambient-two { width: 260px; height: 260px; bottom: -110px; left: 4%; background: var(--signal); opacity: .11; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; letter-spacing: -.04em; }
.brand-mark { font-size: 1.55rem; font-weight: 850; }
.brand-product { padding: 6px 9px; color: var(--bg); background: var(--signal); border-radius: 6px; font-size: .85rem; font-weight: 800; letter-spacing: -.01em; }
.brand-small .brand-mark { font-size: 1.15rem; }
.brand-small .brand-product { padding: 4px 7px; font-size: .7rem; }

/* === GOVIQHUB BRAND === */
.goviqhub-brand { padding: 0; gap: 0; }
.login-logo-img { width: 320px; max-width: 100%; height: auto; object-fit: contain; display: block; }
.goviqhub-brand-small { padding: 0; gap: 0; }
.topbar-logo-img { height: 56px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.eyebrow, .card-kicker, .section-index { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; font-weight: 800; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.eyebrow span { width: 27px; height: 2px; background: var(--signal); }

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .7fr);
  gap: clamp(42px, 8vw, 120px);
  align-items: center;
  padding: 60px 0;
}
.login-story h1 { max-width: 720px; margin: 42px 0 26px; font-size: clamp(3.5rem, 7vw, 7.8rem); line-height: .86; letter-spacing: -.075em; }
.login-story h1 em { color: var(--signal); font-style: normal; }
.login-copy { max-width: 580px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.28rem); line-height: 1.65; }
.flow-line { display: flex; gap: 7px; margin-top: 52px; }
.flow-line span { width: clamp(48px, 7vw, 92px); height: 4px; border-radius: 99px; background: var(--line); }
.flow-line .active { background: linear-gradient(90deg, var(--signal), #eaffaa); box-shadow: 0 0 24px rgba(200,255,61,.22); }

.login-card {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(17,19,23,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.card-kicker { margin: 0 0 10px; color: var(--signal); }
.login-card h2, .dialog-head h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.035em; }
.login-card > div > p:last-child { margin: 10px 0 32px; color: var(--muted); line-height: 1.5; }
label { display: grid; gap: 8px; margin: 18px 0 0; color: #d8dbe0; font-size: .82rem; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #0c0e11;
}
textarea { padding: 12px 14px; resize: vertical; min-height: 64px; }
input:hover, select:hover, textarea:hover { border-color: #454b55; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 780; }
.button-primary { margin-top: 26px; width: 100%; color: #101308; background: var(--signal); }
.button-primary:hover { background: #dcff82; transform: translateY(-1px); }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-secondary { margin: 18px auto 0; color: var(--text); background: var(--surface); border-color: var(--line); }
.button-danger { color: #ffd5d5; background: rgba(255,107,107,.1); border-color: rgba(255,107,107,.25); }
.security-note { margin: 24px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.security-note span { color: var(--signal); margin-right: 5px; }
.form-error { min-height: 20px; margin: 12px 0 0; color: #ff9a9a; font-size: .82rem; }

.app-shell { min-height: 100vh; position: relative; z-index: 1; }
.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(10,11,13,.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.tenant { display: flex; align-items: center; gap: 10px; }
.tenant-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 16px var(--blue); }
.tenant small, .tenant strong { display: block; }
.tenant small { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.tenant strong { margin-top: 2px; font-size: .85rem; }
.topbar-actions { justify-self: end; display: flex; gap: 10px; align-items: center; }
.environment { padding: 7px 10px; border: 1px solid rgba(200,255,61,.2); border-radius: 99px; color: var(--signal); background: rgba(200,255,61,.07); font-size: .7rem; font-weight: 750; }

.workspace { width: min(1420px, calc(100% - 40px)); margin: auto; padding: 56px 0 100px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 36px; }
.page-intro h1 { margin: 13px 0 8px; font-size: clamp(2.5rem, 5vw, 5.6rem); line-height: .9; letter-spacing: -.065em; }
.page-intro > div > p:last-child { margin: 0; color: var(--muted); }
.system-status { min-width: 190px; display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.system-status small, .system-status strong { display: block; }
.system-status small { color: var(--muted); font-size: .7rem; }
.system-status strong { margin-top: 3px; font-size: .86rem; }
.pulse { width: 12px; height: 12px; border: 3px solid rgba(200,255,61,.24); border-radius: 50%; background: var(--signal); box-shadow: 0 0 20px rgba(200,255,61,.4); }

.metrics { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; padding: 24px; background: var(--surface); border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric-main { background: var(--signal); color: #101308; }
.metric span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-main span, .metric-main small { color: #3b451e; }
.metric strong { font-size: clamp(2.1rem, 4vw, 4rem); letter-spacing: -.07em; line-height: 1; }
.metric small { color: #6f7580; font-size: .68rem; }

.automation-strip { margin: 18px 0 54px; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(100deg, rgba(111,136,255,.1), rgba(17,19,23,.9) 35%); }
.automation-strip > div { display: flex; align-items: center; gap: 13px; }
.automation-strip strong, .automation-strip small { display: block; }
.automation-strip small { color: var(--muted); margin-top: 3px; }
.automation-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); font-size: 1.3rem; }
.automation-strip dl { display: flex; gap: clamp(24px, 5vw, 70px); margin: 0; }
.automation-strip dl div { display: grid; gap: 3px; }
.automation-strip dt { color: var(--muted); font-size: .68rem; }
.automation-strip dd { margin: 0; font-size: 1.05rem; font-weight: 800; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-index { color: var(--signal); margin: 0 0 8px; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: -.045em; }
.filters { display: flex; gap: 10px; }
.filters label { margin: 0; }
.filters input { min-width: 250px; }
.filters select { min-width: 190px; }
.table-frame { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; background: rgba(17,19,23,.9); }
table { width: 100%; min-width: 960px; border-collapse: collapse; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line-soft); }
th { color: #777f8a; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; }
td { color: #c7cbd1; font-size: .82rem; }
td strong { color: var(--text); font-size: .88rem; }
.lead-company { display: block; margin-top: 4px; color: var(--muted); font-size: .72rem; }
.lead-row-clickable { cursor: pointer; }
.lead-row-clickable:hover { background: rgba(200,255,61,.03); }
.status-pill { display: inline-flex; padding: 6px 9px; border-radius: 99px; color: #dfe5ef; background: #272c35; font-size: .68rem; font-weight: 750; }
.status-qualified, .status-scheduled, .status-attended, .status-won { color: var(--signal); background: var(--signal-dark); }
.status-disqualified, .status-lost { color: #ffaaaa; background: #321b1d; }
.row-action { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; }
.row-action:hover { border-color: var(--signal); }
.empty-state { min-height: 250px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.empty-state span { color: var(--signal); font-size: 2rem; }
.empty-state p { margin: 0; font-size: .8rem; }

dialog { width: min(520px, calc(100% - 32px)); color: var(--text); border: 1px solid var(--line); border-radius: 22px; background: var(--surface-raised); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
dialog form { padding: 12px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: transparent; font-size: 1.4rem; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.dialog-actions .button-primary { width: auto; margin: 0; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 380px; padding: 14px 18px; color: var(--bg); background: var(--signal); border-radius: 10px; font-size: .82rem; font-weight: 750; transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { color: white; background: #a7333b; }

/* === LEAD DETAIL VIEW === */
.detail-breadcrumb { margin-bottom: 24px; }
.detail-breadcrumb .button-quiet { font-size: .82rem; padding: 8px 14px; }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 28px;
}
.detail-identity h1 { margin: 0; font-size: 2rem; letter-spacing: -.04em; }
.detail-company { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.detail-actions { display: flex; align-items: center; gap: 14px; }
.detail-actions .button-secondary { margin: 0; }

.detail-section {
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 20px;
}
.detail-section-title {
  margin: 0 0 18px;
  font-size: 1rem;
  font-weight: 750;
  color: var(--signal);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .72rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.detail-grid-item {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(10,11,13,.5);
}
.detail-grid-item dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.detail-grid-item dd {
  margin: 0;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
}
.detail-grid-item dd.not-informed {
  color: #555;
  font-style: italic;
}

/* Conversation Timeline */
.conversation-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}
.message-bubble {
  padding: 14px 18px;
  border-radius: 14px;
  max-width: 85%;
}
.message-lead {
  background: rgba(111,136,255,.12);
  border: 1px solid rgba(111,136,255,.2);
  align-self: flex-start;
}
.message-bot {
  background: rgba(200,255,61,.06);
  border: 1px solid rgba(200,255,61,.12);
  align-self: flex-end;
}
.message-meta {
  font-size: .68rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.message-text {
  margin: 0;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text);
}
.empty-conversation, .empty-notes {
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
  margin: 0;
}

/* Notes */
.note-card {
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(10,11,13,.5);
  margin-bottom: 10px;
}
.note-meta {
  font-size: .68rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.note-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 14px;
}
.note-form textarea {
  flex: 1;
}
.note-form .button-secondary {
  margin: 0;
  white-space: nowrap;
}

/* Meet Link */
.meet-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 650;
}
.meet-link:hover {
  text-decoration: underline;
}

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; padding: 36px 0 60px; }
  .login-story h1 { margin-top: 34px; }
  .login-card { max-width: 620px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { border-top: 1px solid var(--line); }
  .metric-main { grid-column: span 2; }
  .automation-strip { align-items: flex-start; flex-direction: column; }
  .section-head { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; }
  .filters label, .filters input, .filters select { width: 100%; min-width: 0; }
  .detail-header { flex-direction: column; align-items: flex-start; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  body { background-size: 44px 44px; }
  .login-shell, .workspace { width: min(100% - 24px, 1180px); }
  .login-story h1 { font-size: clamp(3.15rem, 17vw, 5rem); }
  .flow-line span:last-child { display: none; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .tenant { display: none; }
  .environment { display: none; }
  .workspace { padding-top: 34px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .system-status { width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 138px; padding: 18px; }
  .automation-strip dl { width: 100%; justify-content: space-between; gap: 14px; }
  .filters { flex-direction: column; }
  .field-pair { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions .button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .note-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* ═══════════════════════════════════════════════════════════════
   GoviqHub v1 — Additional Styles (Phase 2: Clients)
   Appended AFTER the Phase 1 CSS. Does not override existing rules.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Main Navigation ─────────────────────────────────────────── */
.main-nav {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 28px;
  width: fit-content;
}

.nav-tab {
  padding: 10px 22px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  border-radius: 8px;
  transition: background .15s, color .15s;
}

.nav-tab:hover {
  background: var(--surface-raised);
  color: var(--text);
}

.nav-tab.active {
  background: var(--signal-dark);
  color: var(--signal);
}

/* ─── Client Status Pills ─────────────────────────────────────── */
.status-client-active {
  background: rgba(200, 255, 61, .12);
  color: var(--signal);
}

.status-client-paused {
  background: rgba(111, 136, 255, .12);
  color: var(--blue);
}

.status-client-cancelled {
  background: rgba(255, 107, 107, .12);
  color: var(--danger);
}

/* ─── Payment Status Pills ────────────────────────────────────── */
.status-payment-paid {
  background: rgba(200, 255, 61, .12);
  color: var(--signal);
}

.status-payment-pending {
  background: rgba(255, 193, 61, .12);
  color: #ffc13d;
}

.status-payment-overdue {
  background: rgba(255, 107, 107, .15);
  color: var(--danger);
  font-weight: 700;
}

.status-payment-cancelled {
  background: rgba(150, 156, 165, .12);
  color: var(--muted);
}

/* ─── Financial Metrics Strip ─────────────────────────────────── */
.financial-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.financial-metric {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.financial-metric dt {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.financial-metric dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
}

.financial-metric.highlight dd {
  color: var(--signal);
}

.financial-metric.danger dd {
  color: var(--danger);
}

/* ─── Client Table ────────────────────────────────────────────── */
.table-frame-compact {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-frame-compact table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table-frame-compact th {
  text-align: left;
  padding: 14px 16px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-frame-compact td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.table-frame-compact tr:last-child td {
  border-bottom: none;
}

/* ─── Convert Dialog ──────────────────────────────────────────── */
.convert-btn {
  padding: 8px 16px;
  background: var(--signal);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .82rem;
}

.convert-btn:hover {
  filter: brightness(1.1);
}

/* ─── Detail Sections ─────────────────────────────────────────── */
.detail-section-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 800;
  color: var(--muted);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.detail-section-title:first-of-type {
  margin-top: 0;
}

/* ─── Payment Table ───────────────────────────────────────────── */
.payments-section {
  margin-top: 24px;
}

.payments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.add-payment-btn {
  padding: 6px 14px;
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 650;
}

.add-payment-btn:hover {
  background: var(--signal-dark);
  color: var(--signal);
  border-color: var(--signal);
}

/* ─── Responsive Adjustments ──────────────────────────────────── */
@media (max-width: 980px) {
  .main-nav {
    width: 100%;
    justify-content: center;
  }
  .financial-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .main-nav {
    flex-wrap: wrap;
  }
  .nav-tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
  }
  .financial-metrics {
    grid-template-columns: 1fr;
  }
}

/* ─── KANBAN / BIDS MODULE ────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0;
  min-height: 400px;
}

.kanban-column {
  min-width: 200px;
  max-width: 240px;
  flex-shrink: 0;
  background: var(--surface-2, #1a1a2e);
  border-radius: 8px;
  padding: 12px;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  margin-bottom: 12px;
}

.kanban-column-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #a0a0b0);
}

.kanban-column-count {
  background: var(--surface-3, #252540);
  color: var(--text-secondary, #a0a0b0);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--surface-3, #252540);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card-number {
  font-size: 0.7rem;
  color: var(--accent, #c8ff00);
  font-weight: 600;
  margin-bottom: 4px;
}

.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
  line-height: 1.3;
}

.kanban-card-org {
  font-size: 0.72rem;
  color: var(--text-secondary, #a0a0b0);
  margin-bottom: 4px;
}

.kanban-card-value {
  font-size: 0.75rem;
  color: #10b981;
  font-weight: 600;
}

.kanban-card-date {
  font-size: 0.68rem;
  color: var(--text-secondary, #a0a0b0);
  margin-top: 4px;
}

/* Bid Detail View */
.bid-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.bid-stage-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
}

.bid-section {
  margin-bottom: 24px;
}

.bid-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #a0a0b0);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border, #2a2a40);
  padding-bottom: 8px;
}

.bid-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.bid-stage-select {
  background: var(--surface-3, #252540);
  color: var(--text-primary, #fff);
  border: 1px solid var(--border, #2a2a40);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Timeline for bid events */
.bid-timeline {
  position: relative;
  padding-left: 24px;
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
  border-left: 2px solid var(--border, #2a2a40);
  padding-left: 16px;
  margin-left: 6px;
}

.timeline-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface-1, #0f0f1a);
}

.timeline-content {
  font-size: 0.82rem;
}

.timeline-date {
  font-size: 0.7rem;
  color: var(--text-secondary, #a0a0b0);
  display: block;
  margin-bottom: 2px;
}

.timeline-content p {
  color: var(--text-secondary, #a0a0b0);
  margin-top: 4px;
  font-size: 0.78rem;
}

/* Bid event form */
.bid-event-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #2a2a40);
}

.bid-event-form select,
.bid-event-form input,
.bid-event-form textarea {
  flex: 1;
  min-width: 150px;
}

.bid-event-form button {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
  }
  .kanban-column {
    max-width: 100%;
    min-width: 100%;
  }
  .bid-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── CLIENT BIDS SECTION ─────────────────────────────────────── */
.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.detail-section-header .detail-section-title {
  margin-bottom: 0;
}
.button-sm {
  padding: 4px 12px;
  font-size: 0.82rem;
}
.client-bids-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border, #2a2a40);
  border-radius: 6px;
  overflow: hidden;
}
.toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted, #a0a0b0);
  cursor: pointer;
  padding: 5px 14px;
  font-size: 0.82rem;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn.active {
  background: var(--blue, #6f88ff);
  color: #fff;
}
.kanban-board-inline {
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-card-loc {
  font-size: 0.72rem;
  color: var(--muted, #969ca5);
  margin: 2px 0;
}
.kanban-card-value.muted {
  color: var(--muted, #969ca5);
  font-style: italic;
}

/* ─── BID DETAIL DIALOG ───────────────────────────────────────── */
.bid-detail-dialog {
  background: var(--surface, #111317);
  border: 1px solid var(--line, #2a2e35);
  border-radius: 12px;
  color: var(--text, #f4f5f2);
  max-width: 860px;
  width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  padding: 0;
}
.bid-detail-dialog::backdrop {
  background: rgba(0,0,0,0.7);
}
.bid-detail-dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}
.bid-detail-dialog .dialog-head {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line, #2a2e35);
  flex-shrink: 0;
}
.bid-detail-content {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
}
.bid-detail-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.bid-detail-obj {
  font-size: 0.95rem;
  color: var(--muted, #969ca5);
  max-width: 520px;
}
.bid-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stage-select {
  background: var(--surface-raised, #171a1f);
  border: 1px solid var(--line, #2a2e35);
  border-radius: 6px;
  color: var(--text, #f4f5f2);
  padding: 4px 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.bid-detail-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line, #2a2e35);
}
.bid-detail-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.bid-detail-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--signal, #c8ff3d);
  margin-bottom: 0.75rem;
}
.bid-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.grid-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.grid-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #969ca5);
}
.grid-value {
  font-size: 0.88rem;
  color: var(--text, #f4f5f2);
}
.grid-item-full {
  grid-column: 1 / -1;
}
.resumo-ia {
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted, #969ca5);
}
.link-action {
  color: var(--blue, #6f88ff);
  text-decoration: none;
  font-size: 0.85rem;
}
.link-action:hover {
  text-decoration: underline;
}
@media (max-width: 600px) {
  .bid-detail-dialog {
    max-width: 100vw;
    width: 100vw;
    border-radius: 0;
    max-height: 100vh;
  }
  .bid-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── TASKS MODULE ─────────────────────────────────────────────── */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-raised);
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  transition: border-color 0.15s;
}
.task-item:hover {
  border-color: var(--line);
}
.task-item.task-overdue {
  border-color: var(--danger);
  background: rgba(255, 107, 107, 0.05);
}
.task-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--signal);
  cursor: pointer;
}
.task-content {
  flex: 1;
  min-width: 0;
}
.task-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.task-priority {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
}
.task-due {
  color: var(--muted);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}
.task-due.overdue {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.1);
  font-weight: 600;
}
.task-auto {
  font-size: 0.85rem;
  opacity: 0.6;
}
.task-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.task-item:hover .task-actions {
  opacity: 1;
}
.select-mini {
  background: var(--surface-raised);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  cursor: pointer;
}
.select-mini:focus {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
}


/* ─── TIMELINE UNIFICADA ─────────────────────────────────────── */
.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 2rem;
}
.timeline-feed::before {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line-soft);
}
.timeline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.timeline-content {
  flex: 1;
  min-width: 0;
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.timeline-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  font-weight: 600;
}
.timeline-date {
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
}
.timeline-title {
  font-size: .85rem;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}
.timeline-desc {
  font-size: .75rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
  line-height: 1.3;
}
.empty-state-text {
  color: var(--muted);
  font-size: .85rem;
  text-align: center;
  padding: 1.5rem 0;
}
.button-ghost {
  display: block;
  margin: 1rem auto 0;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: .8rem;
  font-weight: 650;
}
.button-ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* ─── EDIT BID DIALOG / FORM GRID ─────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 1rem 0;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.form-group input,
.form-group select,
.form-group textarea {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0e11;
  color: var(--text);
  font-size: 0.82rem;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--signal);
  outline: none;
  box-shadow: 0 0 0 2px rgba(200,255,61,.15);
}
#editBidDialog {
  width: min(700px, calc(100% - 32px));
}
#editBidDialog form {
  padding: 16px;
}

/* ─── KANBAN CARD IMPROVEMENTS ─────────────────────────────────── */
.kanban-card {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  border-color: var(--signal);
}
.kanban-card.urgent {
  border-left: 3px solid #ef4444;
}
.kanban-card.warning {
  border-left: 3px solid #f59e0b;
}
.kanban-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.kanban-card-client {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--signal);
  background: var(--signal-dark);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
}
.kanban-card-value.muted {
  color: var(--muted);
  font-style: italic;
}
.kanban-card-date.urgent {
  color: #ef4444;
  font-weight: 700;
}
.kanban-card-date.warning {
  color: #f59e0b;
  font-weight: 700;
}
.kanban-card-loc {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 2px 0;
}

/* ─── BID DETAIL DIALOG IMPROVEMENTS ──────────────────────────── */
.bid-detail-dialog {
  width: min(750px, calc(100% - 32px));
  max-height: 85vh;
  overflow-y: auto;
}
.bid-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.grid-item-full {
  grid-column: 1 / -1;
}
.resumo-ia {
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 120px;
  overflow-y: auto;
}
.link-action {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}
.link-action:hover {
  text-decoration: underline;
}

/* ─── RESPONSIVE FORM GRID ─────────────────────────────────────── */
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Kanban card open button */
.kanban-card-open {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  background: var(--accent, #c8ff00);
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: opacity 0.15s;
}
.kanban-card-open:hover {
  opacity: 0.85;
}
