/* ── ALLG Acquisitions Desk — Main Stylesheet ── */
:root {
  --bg: #080b12;
  --card: #0d111c;
  --border: #1a1f2e;
  --accent: #fb2056;
  --text: #e2e8f0;
  --muted: #64748b;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
}

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

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Layout ── */
.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 210px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(135deg, var(--accent), #ff2a5e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo .sub {
  font-size: 9px;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}

.nav-item:hover {
  color: var(--text);
  background: #141a2a;
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: #141a2a;
  font-weight: 600;
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
  padding: 14px 20px;
  border-top: 1px solid #fb205630;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff2a5e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user .name { font-size: 12px; font-weight: 600; }
.sidebar-user .role { font-size: 9px; color: var(--muted); }

/* ── Content ── */
.content {
  flex: 1;
  padding: 20px 24px;
  max-width: 1440px;
  margin-left: 210px;
}

/* ── Top Bar ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: -0.3px;
}

.topbar .ts { font-size: 12px; color: var(--muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0a1628;
  border: 1px solid #1a2a4a;
  border-radius: 20px;
  padding: 4px 14px 4px 8px;
  font-size: 11px;
  color: #60a5fa;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px #22c55e66;
  animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.date-display {
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── KPI Row ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.kc {
  background: var(--card);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all 0.12s;
}

.kc.clickable {
  cursor: pointer;
}

.kc.clickable:hover {
  border-color: #2a2f3e;
}

.kc.active {
  background: #2a0a1a;
  border-color: var(--accent);
}

.kc.pulse {
  animation: fcPulse 0.28s ease;
}

.kc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kc .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.kc .val { font-size: 24px; font-weight: 700; margin: 3px 0 2px; }
.kc .sub { font-size: 10px; color: #4b5563; }

.kc-r::before { background: var(--red); } .kc-r .val { color: var(--red); }
.kc-a::before { background: var(--amber); } .kc-a .val { color: var(--amber); }
.kc-g::before { background: var(--green); } .kc-g .val { color: var(--green); }
.kc-b::before { background: var(--blue); } .kc-b .val { color: var(--blue); }

/* ── Pipeline Flow ── */
.flow-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  padding: 4px 0 8px;
}

.fc {
  min-width: 120px;
  padding: 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: all 0.12s;
}

.fc:hover {
  border-color: #2a2f3e;
}

.fc.active {
  background: #2a0a1a;
  border-color: var(--accent);
}

@keyframes fcPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.fc.pulse {
  animation: fcPulse 0.28s ease;
}

.fc .num { font-size: 9px; color: #4b5563; text-transform: uppercase; }
.fc .name { font-size: 11px; font-weight: 600; margin: 2px 0; }
.fc .count { font-size: 20px; font-weight: 700; }
.fc .bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.fc .bf { height: 100%; border-radius: 2px; }
.fc .gp-line { font-size: 10px; color: var(--muted); margin-top: 1px; }
.fc .gp-line .up { color: var(--green); font-weight: 700; }

.fc .gp-main {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.fc .gp-main .gp-val {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--green);
  line-height: 1.2;
}
.fc .gp-main .gp-caption {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fc-red .count { color: var(--red); } .fc-red .bf { background: var(--red); } .fc-red .up { color: var(--red); }
.fc-amber .count { color: var(--amber); } .fc-amber .bf { background: var(--amber); }
.fc-green .count { color: var(--green); } .fc-green .bf { background: var(--green); }

/* ── Filter Tabs ── */
.ptabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pt {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
}

.pt:hover {
  border-color: #2a2f3e;
  color: var(--text);
}

.pt.on {
  background: #2a0a1a;
  border-color: var(--accent);
  color: #ff8aae;
  font-weight: 600;
}

.pt .dot { width: 6px; height: 6px; border-radius: 50%; }
.pt .dred { background: var(--red); }
.pt .damber { background: var(--amber); }
.pt .dgreen { background: var(--green); }

/* ── Deal Cards ── */
.deal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.deal-card:hover { border-color: #2a2f3e; }
.deal-card.breached { border-left: 3px solid var(--red); }
.deal-card.overdue { border-left: 3px solid var(--amber); }

.dc-main {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr 0.8fr 0.9fr 0.8fr 1.2fr;
  gap: 8px;
  padding: 14px 16px;
  align-items: center;
}

.dc-main .deal-title { font-size: 14px; font-weight: 600; }
.dc-main .deal-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dc-main .dc-stage { font-size: 12px; }
.dc-main .dc-owner { font-size: 12px; }
.dc-main .dc-time { font-size: 13px; }

.dc-gp { text-align: left; }
.dc-gp .gp-amount { font-size: 17px; font-weight: 800; color: var(--green); line-height: 1.15; }
.dc-gp .gp-caption { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.dc-main .dc-status { font-size: 12px; font-weight: 600; }
.dc-main .dc-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.dc-main { cursor: pointer; }
.dc-main .dc-actions { cursor: default; }

.dc-sla-row {
  padding: 0 16px 12px;
  margin-top: -4px;
  font-size: 11px;
  color: var(--muted);
}
.dc-sla-row .dc-sla-sep { color: var(--border); margin: 0 2px; }
.dc-sla-row .on-track { color: var(--green); font-weight: 600; }
.dc-sla-row .overdue-warning { color: var(--amber); font-weight: 600; }
.dc-sla-row .overdue-critical { color: var(--red); font-weight: 600; }

/* ── Action Buttons ── */
.abtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}

.abtn:hover { transform: translateY(-1px); }
.abtn-pebble { background: #1a0a14; color: #ff8aae; border: 1px solid #fb205640; }
.abtn-pebble:hover { background: #1a2744; }
.abtn-call { background: #0a1a0f; color: #86efac; border: 1px solid #14532d; }
.abtn-call:hover { background: #0f2a1a; }
.abtn-lookup { background: #1a0f2a; color: #d8b4fe; border: 1px solid #3b0764; }
.abtn-lookup:hover { background: #2a1a3a; }
.abtn-touch { background: #1a0a14; color: #ff8aae; border: 1px solid #fb205640; }
.abtn-touch:hover { background: #1a2a4a; }
.abtn-recall { background: #1a0f0a; color: #fca5a5; border: 1px solid #3b0a0a; }
.abtn-recall:hover { background: #2a1a0a; }
.abtn-research { background: #0a1a1a; color: #a7f3d0; border: 1px solid #0a3a2a; }
.abtn-research:hover { background: #0a2a1a; }
.abtn-expand { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.abtn-expand:hover { color: var(--text); }

/* ── Expandable Panel ── */
.dc-expand {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  background: #0a0d14;
}

.dc-expand.open { display: block; }

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.panel-section h4 {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* ── Touch Workflow ── */
.tf-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tf-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  min-width: 70px;
  transition: all 0.12s;
}

.tf-step:hover { border-color: #2a2f3e; }
.tf-step .icon { font-size: 18px; }
.tf-step .label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.tf-step.done {
  border-color: var(--green);
  background: #0a1a0f;
}

.tf-step.done .label { color: #86efac; }
.tf-step.active { border-color: var(--amber); }

.tf-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
}

.tf-progress .pbar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.tf-progress .pfill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s;
}

.tf-log-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--border);
  color: #4b5563;
  width: 100%;
  transition: all 0.15s;
}

.tf-log-btn.ready {
  background: var(--green);
  color: #052e16;
}

.tf-log-btn.ready:hover { background: #16a34a; }

/* ── Call Analysis ── */
.recall-content {
  font-size: 12px;
  line-height: 1.6;
  color: #94a3b8;
}

.recall-content .highlight { color: #fcd34d; font-weight: 600; }
.recall-content .pos { color: #86efac; }
.recall-content .neg { color: #fca5a5; }

/* ── Property Research Grid ── */
.prop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.prop-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 8px;
  background: #0a0d14;
  border-radius: 4px;
}

.prop-item .lbl { color: var(--muted); }
.prop-item .val { font-weight: 500; }
.prop-item .good { color: var(--green); }
.prop-item .bad { color: var(--red); }
.prop-item .warn { color: var(--amber); }

/* ── Two-Column Layout ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

/* ── Card ── */
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border);
}

.card h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

/* ── Mini Table ── */
.mini-table { width: 100%; }

.mini-table td {
  padding: 6px 8px;
  font-size: 12px;
  border-bottom: 1px solid #111827;
}

.mini-table tr:last-child td { border: none; }
.mini-table .r { text-align: right; font-weight: 600; }
.mini-table .sg { color: var(--green); }
.mini-table .sa { color: var(--amber); }
.mini-table .sr { color: var(--red); }

/* ── Footer ── */
.ftr {
  margin-top: 24px;
  padding: 14px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: #4b5563;
  text-align: center;
}

/* ── Flash Messages ── */
.flash-message {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}

.flash-error {
  background: #1a0a0a;
  color: #fca5a5;
  border: 1px solid #3b0a0a;
}

.flash-info {
  background: #0a1a2a;
  color: #93c5fd;
  border: 1px solid #0a2a3a;
}

.flash-warning {
  background: #1a1a0a;
  color: #fcd34d;
  border: 1px solid #3a3a0a;
}

.flash-success {
  background: #0a1a0f;
  color: #86efac;
  border: 1px solid #0a3a1a;
}

/* ── Toast ── */
.toast {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #052e16;
  border: 1px solid #166534;
  border-radius: 8px;
  padding: 12px 18px;
  color: #86efac;
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
}

.toast.show { display: block; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .dc-main { grid-template-columns: 1fr 1fr; }
  .panel-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo h1, .sidebar-logo .sub, .sidebar-user .name, .sidebar-user .role,
  .nav-item span:not(:first-child) { display: none; }
  .content { margin-left: 60px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dc-main { grid-template-columns: 1fr; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2a2f3e; }