/* Miss Turkic CRM — operational workspace (TASK-033.35B) */
:root {
  /* Platform admin palette (superadmin-theme.css): night navy + warm gold. */
  --bg: #060d1c;
  --bg-elev: #081127;
  --surface: #0b1630;
  --surface-2: #0e1a33;
  --line: rgba(230, 199, 154, 0.12);
  --line-bright: rgba(230, 199, 154, 0.22);
  --text: #f7f4ee;
  --muted: #abb2c2;
  --subtle: #7f889c;
  --gold: #e6c79a;
  --gold-bright: #f3dfb8;
  --gold-dim: rgba(230, 199, 154, 0.12);
  --ok: #5fcb98;
  --warn: #e8b84c;
  --bad: #e06b6b;
  --info: #4a8fe7;
  --sidebar: #040914;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --sidebar-w: 248px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(230, 199, 154, 0.05), transparent 55%),
    radial-gradient(700px 380px at 100% 10%, rgba(74, 143, 231, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}

a {
  color: var(--gold);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.brand-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

/* —— Login —— */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.login-panel {
  width: min(440px, 100%);
  background: linear-gradient(180deg, var(--bg-elev), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.5rem;
}

.login-brand h1 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: -0.02em;
}

.login-lead,
.note {
  color: var(--muted);
  font-size: 0.92rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.field-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="search"],
textarea {
  font: inherit;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  min-height: 2.45rem;
  width: 100%;
}

/*
 * CRM select controls (TASK-033.35C)
 * Native <select> kept for semantics/keyboard; closed control is restyled.
 * Chevron is a CSS background SVG — not a browser default arrow.
 */
select,
select.crm-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font: inherit;
  color: var(--text);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239aa3b5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 2.35rem 0.55rem 0.75rem;
  min-height: 2.45rem;
  width: 100%;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

select:hover,
select.crm-select:hover {
  border-color: rgba(230, 199, 154, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23d4b45a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select:focus,
select.crm-select:focus,
select:focus-visible,
select.crm-select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: rgba(230, 199, 154, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23d4b45a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select:disabled,
select.crm-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Hide IE/legacy dropdown glyph if present */
select::-ms-expand {
  display: none;
}

input:focus,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.form-error {
  margin: 0;
  color: var(--bad);
  font-size: 0.9rem;
}

/* —— Buttons —— */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  min-height: 2.4rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn:hover {
  border-color: rgba(230, 199, 154, 0.35);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #e0c36e, var(--gold));
  color: #1a1408;
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* —— App shell —— */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.35rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand h1 {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.55rem;
}

.sidebar-sub {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-link {
  color: var(--muted);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: var(--text);
  background: var(--gold-dim);
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-name {
  font-weight: 600;
}

.user-role,
.user-scope {
  color: var(--muted);
  font-size: 0.82rem;
}

.main {
  min-width: 0;
  padding: 1.25rem 1.5rem 2.5rem;
}

.main-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.page-subtitle {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.menu-toggle {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 20;
}

/* —— Content primitives —— */
.content {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.kpi .label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kpi .value {
  margin-top: 0.35rem;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 500;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(2, minmax(9.5rem, 1fr)) auto auto auto;
  gap: 0.65rem;
  align-items: end;
}

.filters .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.filters label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.filters select,
.filters input[type="search"],
.filters .btn {
  min-height: 2.45rem;
}

.filters .btn {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  padding: 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-elev);
  position: sticky;
  top: 0;
}

table.data tbody tr {
  cursor: pointer;
}

table.data tbody tr:hover {
  background: rgba(230, 199, 154, 0.05);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.badge.hot,
.badge.HIGH,
.badge.HOT {
  color: #2a1608;
  background: rgba(212, 160, 106, 0.85);
  border-color: transparent;
}

.badge.prio-HOT {
  background: rgba(212, 122, 122, 0.25);
  color: #f0c0c0;
}

.badge.prio-HIGH {
  background: rgba(212, 160, 106, 0.22);
  color: #f0d2a8;
}

.badge.stage-HUMAN_HANDOFF,
.badge.stage-CALLBACK_REQUESTED,
.badge.stage-PAYMENT_PENDING {
  background: rgba(230, 199, 154, 0.16);
  color: #e8d49a;
}

.badge.stage-NEW {
  background: rgba(122, 160, 200, 0.18);
  color: #b7d0e8;
}

.empty,
.loading,
.error-box {
  padding: 1.25rem;
  color: var(--muted);
  text-align: center;
}

.error-box {
  color: var(--bad);
  border: 1px solid rgba(212, 122, 122, 0.35);
  border-radius: var(--radius);
  background: rgba(212, 122, 122, 0.08);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
}

.detail-header h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.94rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  word-break: break-word;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.action-card select,
.action-card .btn {
  min-height: 2.45rem;
}

.action-card .btn-row {
  margin-top: 0.1rem;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 360px;
  overflow: auto;
}

.msg {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elev);
}

.msg .meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}

.msg.inbound {
  border-left: 3px solid var(--info);
}

.msg.outbound {
  border-left: 3px solid var(--gold);
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toast.ok {
  border-color: rgba(95, 191, 154, 0.45);
}

.toast.err {
  border-color: rgba(212, 122, 122, 0.5);
  color: #f0c0c0;
}

.placeholder-panel {
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.placeholder-panel h3 {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters .field[style*="grid-column"] {
    grid-column: 1 / -1;
  }
  .actions-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .filters {
    grid-template-columns: 1fr;
  }
  select,
  select.crm-select {
    background-position: right 0.75rem center;
    padding-right: 2.2rem;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: inline-flex;
  }
  .kv {
    grid-template-columns: 1fr;
  }
}

/* —— Dialogues workspace (TASK-033.36) —— */
.dlg-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(200px, 260px);
  gap: 0.85rem;
  min-height: calc(100vh - 9rem);
  align-items: stretch;
}

.dlg-list-pane,
.dlg-thread-pane,
.dlg-context-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 0;
}

.dlg-list-pane {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.65rem;
}

.dlg-filters {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dlg-list {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dlg-item {
  text-align: left;
  border: 1px solid transparent;
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.dlg-item:hover,
.dlg-item.is-active {
  border-color: rgba(230, 199, 154, 0.35);
  background: rgba(230, 199, 154, 0.08);
}

.dlg-item-top {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: flex-start;
}

.dlg-item-meta,
.dlg-item-time {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.dlg-item-preview {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dlg-chip,
.dlg-own-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.dlg-chip.controller-aiya,
.dlg-own-badge.controller-aiya {
  color: #b7d0e8;
  background: rgba(122, 160, 200, 0.16);
}

.dlg-chip.controller-human,
.dlg-own-badge.controller-human {
  color: #e8d49a;
  background: rgba(230, 199, 154, 0.16);
}

.dlg-thread-pane {
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  gap: 0.65rem;
}

.dlg-thread-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.dlg-thread-header h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.25rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
}

.dlg-thread-sub {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.2rem;
}

.dlg-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.25rem 0.1rem;
  min-height: 240px;
  max-height: calc(100vh - 22rem);
}

.dlg-bubble {
  max-width: min(78%, 560px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: var(--bg-elev);
  word-break: break-word;
  white-space: pre-wrap;
}

.dlg-bubble.inbound {
  align-self: flex-start;
  border-left: 3px solid var(--info);
}

.dlg-bubble.outbound {
  align-self: flex-end;
}

.dlg-bubble.outbound.aiya {
  border-left: 3px solid var(--gold);
}

.dlg-bubble.outbound.human {
  border-left: 3px solid var(--ok);
  background: rgba(95, 191, 154, 0.08);
}

.dlg-bubble.outbound.system {
  border-left: 3px solid var(--muted);
}

.dlg-bubble-meta {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.dlg-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

.dlg-composer textarea {
  resize: vertical;
  min-height: 2.8rem;
  max-height: 8rem;
}

.dlg-context-pane {
  padding: 0.9rem;
}

.dlg-context-pane h3 {
  margin: 0 0 0.75rem;
}

.dlg-actions {
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .dlg-workspace {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  }
  .dlg-context-pane {
    display: none;
  }
}

@media (max-width: 860px) {
  .dlg-workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .dlg-list-pane {
    max-height: 280px;
  }
  .dlg-messages {
    max-height: 50vh;
  }
}

/* Candidate 360 (TASK-033.37) */
.c360-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.1rem;
  align-items: start;
}

.c360-main,
.c360-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.c360-profile-group h4 {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.c360-list {
  margin: 0.4rem 0 0.75rem;
  padding-left: 1.1rem;
}

.empty-inline {
  margin: 0;
  color: var(--muted);
}

.muted-line {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.prov {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline li {
  border-left: 2px solid var(--line);
  padding: 0 0 0.15rem 0.85rem;
}

.tl-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.tl-kind {
  font-weight: 600;
  font-size: 0.88rem;
  margin: 0.15rem 0;
}

.tl-sum {
  font-size: 0.9rem;
}

@media (max-width: 1100px) {
  .c360-layout {
    grid-template-columns: 1fr;
  }
}

.badge.overdue {
  background: rgba(176, 62, 62, 0.14);
  color: #9b2c2c;
}

.mw-kpi {
  margin-bottom: 1rem;
}

.mw-grid {
  margin-bottom: 1rem;
}

.mw-section h3 {
  margin-bottom: 0.75rem;
}

.mw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mw-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.55rem;
}

.mw-item-main {
  min-width: 0;
  flex: 1;
}

.mw-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .mw-item {
    flex-direction: column;
  }
  .mw-item-actions {
    justify-content: flex-start;
  }
}

.ops-list {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ops-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}

.ops-form {
  display: grid;
  gap: 0.55rem;
}

.ops-form textarea,
.ops-form input {
  width: 100%;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.82rem;
}

.note-body {
  white-space: pre-wrap;
  margin: 0.25rem 0 0.4rem;
}

/* Unified Superadmin iframe embed (PH18-M4) */
body.unified-embed .sidebar,
body.unified-embed .menu-toggle,
body.unified-embed #sidebar-backdrop,
body.unified-embed #login-view {
  display: none !important;
}
body.unified-embed .app-layout {
  grid-template-columns: 1fr;
}
body.unified-embed .main-top h2.page-title {
  font-size: 1.1rem;
}


/* —— 2026-11-12: grouped navigation, contestants board, WhatsApp prospects —— */
.nav-group {
  margin: 1.1rem 0 0.35rem;
  padding: 0 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--subtle);
  font-weight: 600;
}
.page-title,
.sidebar-brand h1,
.login-brand h1 {
  font-weight: 400;
  letter-spacing: -0.01em;
}
.board-search {
  margin-bottom: 0.9rem;
}
.board-search input {
  width: 100%;
  max-width: 520px;
}
.board-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  align-items: baseline;
  margin-bottom: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.board-summary strong {
  color: var(--text);
}
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x proximity;
  align-items: start;
}
.board-col {
  scroll-snap-align: start;
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 0.75rem 0.75rem;
  min-height: 120px;
}
.board-col__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0 0.15rem 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.7rem;
}
.board-col__head h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.3;
}
.board-col__head p {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  color: var(--subtle);
}
.board-col__count {
  flex: none;
  min-width: 2rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--gold-dim);
  color: var(--gold-bright);
  font-weight: 600;
  font-size: 0.85rem;
  text-align: center;
}
.board-col--payment .board-col__count { background: rgba(232, 184, 76, 0.16); color: var(--warn); }
.board-col--official .board-col__count { background: rgba(95, 203, 152, 0.14); color: var(--ok); }
.board-col--revision .board-col__count { background: rgba(224, 107, 107, 0.14); color: var(--bad); }
.board-col--closed { opacity: 0.85; }
.board-col__list {
  display: grid;
  gap: 0.55rem;
  max-height: calc(100vh - 290px);
  overflow-y: auto;
}
.board-col.is-collapsed .board-col__list { display: none; }
.board-col__empty {
  margin: 0.4rem 0.2rem;
  color: var(--subtle);
  font-size: 0.85rem;
}
.board-toggle { margin: 0 0 0.6rem; }
.board-card {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.board-card:hover,
.board-card:focus-visible {
  border-color: var(--line-bright);
  transform: translateY(-1px);
  outline: none;
}
.board-card__name { font-weight: 600; }
.board-card__place,
.board-card__meta { font-size: 0.8rem; color: var(--muted); }
.board-card__op {
  justify-self: start;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  color: var(--gold);
}
.board-card__op.is-empty { color: var(--subtle); border-color: var(--line); }
.prospect-list { display: grid; }
.prospect-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.4rem;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.prospect-row:first-child { border-top: 0; }
.prospect-row:hover { background: rgba(230, 199, 154, 0.04); }
.prospect-row__main { display: grid; gap: 0.15rem; min-width: 0; }
.prospect-row__main span { font-size: 0.82rem; color: var(--muted); }
.prospect-row__side { display: grid; justify-items: end; gap: 0.2rem; font-size: 0.78rem; flex: none; }
.pager { display: flex; justify-content: center; padding-top: 0.75rem; }
.prospect-row__main .prospect-row__preview {
  color: var(--text);
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62ch;
}
.board-col--contract .board-col__count { background: rgba(230, 199, 154, 0.16); color: var(--gold); }
.badge--platform { border-color: rgba(230, 199, 154, 0.45); color: var(--gold); font-weight: 600; }
.badge--platform.is-none { color: var(--muted); border-color: var(--line); font-weight: 500; }
/* 2026-11-13: applications with no phone in the CRM */
.board-unlinked { margin-top: 1.25rem; }
.board-unlinked__head h3 { margin: 0 0 0.3rem; display: flex; align-items: center; gap: 0.6rem; }
.board-unlinked__head p { margin: 0 0 0.8rem; max-width: 80ch; }
.board-unlinked__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.board-unlinked__row {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.board-unlinked__row .badge { justify-self: start; }
@media (max-width: 760px) {
  .board { grid-auto-columns: 86%; }
  .board-col__list { max-height: none; }
}

.muted { color: var(--muted); }
.meta-row--flush { margin: 0; }
.meta-row--spaced { margin-top: 0.55rem; }
.field--wide { grid-column: span 2; }

/* —— 2026-11-12: one look for every form, filter bar and table ——
   Several sections used classes that had no styles (inputs without a type, toolbars,
   inline forms, data tables), which left white browser-default fields and buttons
   glued together. These rules give them the same look as the rest of the CRM. */
.content input:not([type]),
.content input[type="text"],
.content input[type="email"],
.content input[type="url"],
.content input[type="tel"],
.content input[type="number"],
.content input[type="date"],
.content input[type="datetime-local"],
.content input[type="search"],
.content select,
.content textarea {
  font: inherit;
  width: 100%;
  min-height: 2.45rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  color-scheme: dark;
}

.content textarea {
  min-height: 5rem;
  resize: vertical;
}

.content input:focus,
.content select:focus,
.content textarea:focus {
  outline: none;
  border-color: var(--line-bright);
  box-shadow: 0 0 0 3px rgba(230, 199, 154, 0.12);
}

.content input::placeholder,
.content textarea::placeholder {
  color: var(--subtle);
}

.content input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--gold);
}

/* Filter bars: search, selects, checkboxes and buttons on one wrapping row. */
.toolbar,
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filters-panel .filters-row {
  margin-bottom: 0;
}

.toolbar > input,
.filters-row > input {
  flex: 2 1 14rem;
  width: auto;
}

.toolbar > select,
.filters-row > select {
  flex: 1 1 10rem;
  width: auto;
}

.toolbar > .btn,
.filters-row > .btn {
  flex: none;
  min-height: 2.45rem;
}

.check,
.chk {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Edit forms inside cards: labelled fields side by side, button aligned. */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0.25rem 0 1.25rem;
}

.inline-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 14rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.inline-form label > input,
.inline-form label > select,
.inline-form label > textarea {
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
}

.inline-form .btn {
  flex: none;
  min-height: 2.45rem;
}

.kv-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.4rem 0.9rem;
  margin: 0;
  font-size: 0.94rem;
}

.kv-grid dt {
  color: var(--muted);
}

.kv-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data-table th,
table.data-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

table.data-table th {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.click-row,
.clickable {
  cursor: pointer;
}

.click-row:hover,
.clickable:hover {
  background: rgba(230, 199, 154, 0.04);
}

.overdue {
  color: var(--bad);
}

.content h4 {
  margin: 1.25rem 0 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.content ul.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.content ul.plain-list li {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

/* Buttons next to each other never touch. */
.btn + .btn {
  margin-left: 0.5rem;
}

.toolbar .btn + .btn,
.filters-row .btn + .btn,
.btn-row .btn + .btn,
.detail-actions .btn + .btn {
  margin-left: 0;
}

@media (max-width: 760px) {
  .kv-grid {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .kv-grid dd {
    margin-bottom: 0.45rem;
  }

  .toolbar > *,
  .filters-row > * {
    flex: 1 1 100%;
  }
}
