/*
 * Da Rita CRM — Corporate UI RC2
 * Referência visual: CRM corporativo denso, limpo e orientado a operação.
 * Esta camada não altera regras de negócio; estrutura PHP/POST existente permanece.
 */
:root {
  --dr-accent: var(--primary-color, #2563eb);
  --dr-accent-700: #1d4ed8;
  --dr-ink: #101828;
  --dr-text: #344054;
  --dr-muted: #667085;
  --dr-subtle: #98a2b3;
  --dr-canvas: #f7f9fc;
  --dr-surface: #ffffff;
  --dr-soft: #f8fafc;
  --dr-border: #e4e7ec;
  --dr-border-strong: #d0d5dd;
  --dr-danger: #d92d20;
  --dr-warning: #f79009;
  --dr-success: #039855;
  --dr-radius: 9px;
  --dr-sidebar: 238px;
  --dr-topbar: 64px;
}

* { box-sizing: border-box; }
html, body { background: var(--dr-canvas); }
body {
  color: var(--dr-text);
  letter-spacing: -0.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { background: var(--dr-canvas) !important; min-width: 0; }

/* ---------- Shell / Topbar ---------- */
.dr-topbar {
  height: var(--dr-topbar);
  min-height: var(--dr-topbar);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255,255,255,.98);
  border-bottom: 1px solid var(--dr-border);
  box-shadow: 0 1px 2px rgba(16,24,40,.02);
}
.dr-topbar-left { display:flex; align-items:center; min-width:0; flex:1; gap:12px; }
.dr-topbar-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.dr-global-search { width:min(430px, 100%); position:relative; }
.dr-global-search input {
  width:100%; height:38px; padding:0 38px 0 38px;
  border:1px solid var(--dr-border-strong) !important;
  border-radius:7px !important; background:#fff !important;
  color:var(--dr-ink); font-size:12px; font-weight:500;
}
.dr-global-search input::placeholder { color:#98a2b3; }
.dr-global-search-icon {
  position:absolute; left:13px; top:50%; transform:translateY(-50%);
  color:#667085; pointer-events:none;
}
.dr-search-results {
  position:absolute; left:0; right:0; top:calc(100% + 8px); z-index:80; overflow:hidden;
  background:#fff; border:1px solid var(--dr-border-strong); border-radius:9px;
  box-shadow:0 12px 28px rgba(16,24,40,.14);
}
.dr-search-results-title {
  padding:9px 12px; border-bottom:1px solid var(--dr-border); background:#fbfcfd;
  color:#667085; font-size:9px; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
}
.dr-search-result-item {
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px;
  border-bottom:1px solid #f0f2f5; background:#fff; text-decoration:none; transition:.12s ease;
}
.dr-search-result-item:hover { background:#f8faff; }
.dr-search-result-main { min-width:0; }
.dr-search-result-name { color:var(--dr-ink); font-size:11px; font-weight:760; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dr-search-result-meta { margin-top:3px; color:#667085; font-size:9px; font-weight:520; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dr-search-result-arrow { flex:0 0 auto; color:#98a2b3; font-size:13px; font-weight:800; }
.dr-search-results-footer {
  width:100%; padding:9px 12px; border:0; background:#fbfcfd; color:#155eef;
  font-size:9.5px; font-weight:750; text-align:left; cursor:pointer;
}
.dr-search-results-footer:hover { background:#eff4ff; }
.dr-icon-button {
  width:38px; height:38px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid transparent; border-radius:7px !important; color:#344054;
  background:transparent; transition:.14s ease; cursor:pointer;
}
.dr-icon-button:hover { background:#f2f4f7; border-color:#eaecf0; color:var(--dr-ink); }
.dr-topbar-user {
  display:flex; align-items:center; gap:10px; border-left:1px solid var(--dr-border);
  padding-left:14px; margin-left:2px;
}
.dr-avatar {
  width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:#eff4ff; color:#1d4ed8; border:1px solid #dbe5ff; font-size:11px; font-weight:800;
}
.dr-topbar-user-name { font-size:11px; color:var(--dr-ink); font-weight:750; line-height:1.2; white-space:nowrap; }
.dr-topbar-user-role { font-size:10px; color:var(--dr-muted); font-weight:500; margin-top:2px; white-space:nowrap; }

/* ---------- Page heading ---------- */
.dr-page-heading {
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  padding: 4px 2px 2px;
}
.dr-page-heading-main { display:flex; align-items:flex-start; gap:12px; min-width:0; }
.dr-page-heading-icon {
  width:36px; height:36px; flex:0 0 36px; border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  background:#eff4ff; border:1px solid #dbe5ff; color:#2563eb;
}
.dr-page-heading h1 { margin:0; color:var(--dr-ink); font-size:21px; line-height:1.25; font-weight:780; letter-spacing:-.025em; }
.dr-page-heading p { margin:4px 0 0; color:var(--dr-muted); font-size:11.5px; font-weight:450; }
.dr-page-heading-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }

/* ---------- Buttons ---------- */
.dr-button {
  min-height:38px; padding:0 14px; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border-radius:7px !important; font-size:11px; font-weight:700; white-space:nowrap;
  transition:.14s ease; text-decoration:none;
}
.dr-button-primary { background:#155eef; color:#fff !important; border:1px solid #155eef; box-shadow:0 1px 2px rgba(16,24,40,.05); }
.dr-button-primary:hover { background:#004eeb; border-color:#004eeb; }
.dr-button-secondary { background:#fff; color:#344054 !important; border:1px solid var(--dr-border-strong); }
.dr-button-secondary:hover { background:#f9fafb; border-color:#98a2b3; }

/* ---------- Shared cards ---------- */
.dr-panel, .dr-filter-panel, .dr-table-card, .dr-kpi {
  background:var(--dr-surface); border:1px solid var(--dr-border); border-radius:var(--dr-radius);
  box-shadow:0 1px 2px rgba(16,24,40,.025);
}
.rounded-2xl { border-radius: var(--dr-radius) !important; }
.rounded-xl { border-radius: 8px !important; }
.shadow-xl, .shadow-lg, .shadow-md, .shadow-sm, .shadow-xs { box-shadow: 0 1px 2px rgba(16,24,40,.03) !important; }
.bg-white.border, .bg-white\/80, .bg-white\/90 { border-color: var(--dr-border) !important; }

/* ---------- KPI ---------- */
.dr-kpi-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.dr-kpi {
  min-height:120px; padding:17px 18px 14px; display:flex; flex-direction:column; justify-content:space-between;
  position:relative; overflow:hidden; transition:border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.dr-kpi:hover { border-color:#cbd5e1; box-shadow:0 3px 8px rgba(16,24,40,.05); transform:translateY(-1px); }
.dr-kpi-label { font-size:10px; line-height:1; font-weight:800; letter-spacing:.035em; text-transform:uppercase; color:#667085; }
.dr-kpi-value { margin-top:13px; font-size:22px; line-height:1; font-weight:780; letter-spacing:-.03em; color:var(--dr-ink); }
.dr-kpi-link { display:inline-flex; align-items:center; gap:5px; margin-top:14px; font-size:10px; font-weight:700; color:#155eef; }
.dr-kpi-icon {
  position:absolute; right:15px; top:16px; width:31px; height:31px; border-radius:7px;
  display:flex; align-items:center; justify-content:center; background:#f5f7ff; color:#155eef;
}
.dr-kpi-danger .dr-kpi-label, .dr-kpi-danger .dr-kpi-value, .dr-kpi-danger .dr-kpi-link { color:#d92d20; }
.dr-kpi-danger .dr-kpi-icon { background:#fef3f2; color:#d92d20; }
.dr-kpi-warning .dr-kpi-label, .dr-kpi-warning .dr-kpi-link { color:#e04f16; }
.dr-kpi-warning .dr-kpi-value { color:#b93815; }
.dr-kpi-warning .dr-kpi-icon { background:#fff4ed; color:#e04f16; }
.dr-kpi-success .dr-kpi-label, .dr-kpi-success .dr-kpi-link { color:#039855; }
.dr-kpi-success .dr-kpi-value { color:#027a48; }
.dr-kpi-success .dr-kpi-icon { background:#ecfdf3; color:#039855; }
.dr-kpi-muted .dr-kpi-icon { background:#f2f4f7; color:#667085; }
.dr-kpi-muted .dr-kpi-link { color:#475467; }

/* ---------- Filters ---------- */
.dr-filter-panel { padding:15px 16px; }
.dr-filter-grid { display:grid; grid-template-columns:1.05fr 1.1fr 1.1fr 1fr 1.55fr auto; gap:12px; align-items:end; }
.dr-field label { display:block; margin:0 0 6px; color:#475467; font-size:9.5px; line-height:1; font-weight:750; letter-spacing:.015em; }
.dr-field input, .dr-field select, .dr-field textarea {
  width:100%; min-height:38px; padding:8px 11px; border:1px solid var(--dr-border-strong) !important;
  border-radius:7px !important; background:#fff !important; color:#344054 !important;
  font-size:11px !important; font-weight:550 !important; box-shadow:none !important;
}
.dr-field input:focus, .dr-field select:focus, .dr-field textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color:#84adff !important; box-shadow:0 0 0 3px rgba(21,94,239,.09) !important; outline:none !important;
}
.dr-search-field { position:relative; }
.dr-search-field input { padding-right:36px; }
.dr-search-field .dr-search-submit { position:absolute; right:4px; bottom:4px; width:30px; height:30px; border-radius:6px; display:flex; align-items:center; justify-content:center; color:#475467; }
.dr-filter-clear { min-height:38px; padding:0 12px; }

/* ---------- Tables ---------- */
.dr-table-card { overflow:hidden; }
.dr-table-scroll { overflow-x:auto; }
.dr-table { width:100%; min-width:1080px; border-collapse:separate; border-spacing:0; }
.dr-table thead { background:#fbfcfd !important; }
.dr-table thead th {
  height:42px; padding:0 14px; border-bottom:1px solid var(--dr-border) !important;
  color:#667085 !important; font-size:9.5px !important; line-height:1; font-weight:800 !important;
  letter-spacing:.045em !important; text-transform:uppercase; white-space:nowrap;
}
.dr-table tbody td { padding:12px 14px; border-bottom:1px solid #eef1f5 !important; vertical-align:middle; }
.dr-table tbody tr:last-child td { border-bottom:0 !important; }
.dr-table tbody tr { background:#fff; transition:background-color .1s ease; }
.dr-table tbody tr:hover { background:#fbfcfe !important; }
.dr-table tbody tr.dr-overdue-row td:first-child { box-shadow:inset 3px 0 0 #f04438; }
.dr-company-name { color:var(--dr-ink); font-size:11.5px; line-height:1.25; font-weight:770; }
.dr-company-meta { display:flex; flex-wrap:wrap; gap:6px 10px; margin-top:5px; color:#667085; font-size:9.5px; font-weight:520; }
.dr-company-meta span { display:inline-flex; align-items:center; gap:4px; }
.dr-badge {
  display:inline-flex; align-items:center; min-height:20px; padding:2px 7px; border-radius:999px;
  border:1px solid #e4e7ec; background:#f9fafb; color:#475467; font-size:8.5px; line-height:1; font-weight:750;
  letter-spacing:.02em; text-transform:uppercase; white-space:nowrap;
}
.dr-badge-danger { color:#b42318; background:#fef3f2; border-color:#fecdca; }
.dr-badge-warning { color:#b54708; background:#fffaeb; border-color:#fedf89; }
.dr-badge-success { color:#027a48; background:#ecfdf3; border-color:#abefc6; }
.dr-origin-badge { text-transform:none; font-size:9px; letter-spacing:0; }
.dr-status-select { min-width:130px; min-height:35px !important; padding:6px 9px !important; font-size:10.5px !important; font-weight:650 !important; background:#fff !important; }
.dr-operator { color:#344054; font-size:10.5px; font-weight:620; }
.dr-date { color:#475467; font-size:10.5px; font-weight:600; white-space:nowrap; }
.dr-date-danger { color:#d92d20; font-weight:760; }
.dr-note-preview { color:#475467; font-size:9.5px; line-height:1.35; max-height:38px; overflow:hidden; }
.dr-note-form { display:flex; gap:5px; margin-top:6px; }
.dr-note-form input { min-width:95px; height:30px !important; min-height:30px !important; padding:5px 8px !important; font-size:9.5px !important; }
.dr-note-form button { width:30px; height:30px; flex:0 0 30px; display:flex; align-items:center; justify-content:center; background:#155eef; color:#fff; border-radius:6px !important; }
.dr-date-input { min-width:120px; height:34px !important; min-height:34px !important; padding:5px 8px !important; font-size:10px !important; }
.dr-row-actions { display:flex; align-items:center; gap:6px; }
.dr-row-action {
  width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--dr-border); background:#fff; color:#475467; border-radius:7px !important;
  transition:.12s ease;
}
.dr-row-action:hover { border-color:#b2ccff; background:#eff4ff; color:#155eef; }
.dr-empty-state { padding:46px 20px; text-align:center; color:#667085; font-size:11px; }
.dr-table-footer {
  min-height:54px; padding:9px 14px; border-top:1px solid var(--dr-border); background:#fff;
  display:flex; align-items:center; justify-content:space-between; gap:12px; color:#667085; font-size:10px; font-weight:550;
}
.dr-pagination { display:flex; align-items:center; gap:5px; }
.dr-page-btn {
  min-width:34px; height:34px; padding:0 9px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--dr-border); border-radius:7px !important; background:#fff; color:#344054; font-size:10px; font-weight:650;
}
.dr-page-btn:hover { background:#f9fafb; border-color:#b2b9c3; }
.dr-page-btn.active { background:#155eef; color:#fff; border-color:#155eef; }

/* ---------- Legacy form normalization ---------- */
input, select, textarea { border-color:#d0d5dd !important; border-radius:7px !important; box-shadow:none !important; }
button, a[class*="bg-"] { border-radius:7px !important; }
table { border-collapse:separate; border-spacing:0; }
thead { background:#f8fafc !important; }
thead th { color:#667085 !important; font-weight:800 !important; border-bottom:1px solid var(--dr-border) !important; }
tbody td { border-bottom-color:#eef1f4 !important; }
tbody tr:hover { background:#fafcff !important; }

/* ---------- Sidebar ---------- */
#main-sidebar {
  width:var(--dr-sidebar); background:#fff !important; border-color:var(--dr-border) !important;
  box-shadow:1px 0 0 rgba(16,24,40,.015); transition:width .22s ease, transform .22s ease !important;
}
#main-sidebar .logo-container { min-height:64px; padding:12px 16px !important; }
#main-sidebar .logo-container svg:first-child { width:36px !important; height:36px !important; }
#main-sidebar nav { padding:15px 0 12px !important; }
#main-sidebar .ops-label, #main-sidebar .support-label, #main-sidebar .dr-nav-label {
  color:#98a2b3 !important; letter-spacing:.08em; font-size:9px !important; padding-left:20px !important; padding-right:20px !important;
}
#main-sidebar .sidebar-nav-item {
  position:relative; margin:2px 9px; padding:8px 11px !important; min-height:37px;
  border-radius:7px; border-right:0 !important; color:#475467 !important;
  transition:background-color .12s ease,color .12s ease;
}
#main-sidebar .sidebar-nav-item:hover { background:#f2f4f7 !important; color:var(--dr-ink) !important; }
#main-sidebar .sidebar-nav-item.active-nav-link {
  background:#eff4ff !important; color:#155eef !important; font-weight:750 !important;
}
#main-sidebar .sidebar-nav-item.active-nav-link::before {
  content:""; position:absolute; left:-9px; width:3px; height:21px; border-radius:0 3px 3px 0; background:#155eef;
}
#main-sidebar .nav-icon { width:18px; display:inline-flex; justify-content:center; color:#667085; opacity:.95; }
#main-sidebar .sidebar-nav-item.active-nav-link .nav-icon { color:#155eef !important; }
#main-sidebar .sidebar-nav-item:hover .nav-icon { color:#344054; }
#main-sidebar .dr-nav-separator { border-top:1px solid #f0f2f5; margin:12px 17px; }
#main-sidebar .user-card { margin-bottom:7px !important; }
#main-sidebar > div:last-of-type { background:#fbfcfd !important; border-color:var(--dr-border) !important; padding:12px 14px !important; }
#main-sidebar .logout-btn { background:transparent !important; color:#475467 !important; border-color:transparent !important; text-align:left !important; padding:8px 10px !important; }
#main-sidebar .logout-btn:hover { background:#fef3f2 !important; color:#b42318 !important; }

/* ---------- Dashboard normalization ---------- */
.dr-section-title { color:var(--dr-ink); font-size:12px; font-weight:760; }
.dr-section-subtitle { color:var(--dr-muted); font-size:10px; font-weight:500; }

/* ---------- Dark theme ---------- */
body.dark, .dark body { --dr-canvas:#0f172a; --dr-surface:#182230; --dr-soft:#1d2939; --dr-border:#344054; --dr-border-strong:#475467; --dr-ink:#f2f4f7; --dr-text:#d0d5dd; --dr-muted:#98a2b3; }
.dark main { background:#0f172a !important; }
.dark .dr-topbar, .dark .dr-panel, .dark .dr-filter-panel, .dark .dr-table-card, .dark .dr-kpi, .dark .dr-table tbody tr, .dark .dr-table-footer { background:#182230 !important; border-color:#344054 !important; }
.dark .dr-global-search input, .dark .dr-field input, .dark .dr-field select, .dark .dr-field textarea, .dark .dr-status-select, .dark .dr-date-input, .dark .dr-note-form input { background:#1d2939 !important; color:#f2f4f7 !important; border-color:#475467 !important; }
.dark .dr-search-results, .dark .dr-search-result-item { background:#182230; border-color:#344054; }
.dark .dr-search-results-title, .dark .dr-search-results-footer { background:#101828; border-color:#344054; }
.dark .dr-search-result-item:hover, .dark .dr-search-results-footer:hover { background:#1d2939; }
.dark .dr-search-result-name { color:#f2f4f7; }
.dark .dr-search-result-meta { color:#98a2b3; }
.dark .dr-table thead { background:#101828 !important; }
.dark .dr-table tbody tr:hover { background:#1d2939 !important; }
.dark #main-sidebar { background:#182230 !important; border-color:#344054 !important; }
.dark #main-sidebar .sidebar-nav-item { color:#d0d5dd !important; }
.dark #main-sidebar .sidebar-nav-item:hover { background:#1d2939 !important; color:#fff !important; }
.dark #main-sidebar .sidebar-nav-item.active-nav-link { background:#102a56 !important; color:#b2ccff !important; }
.dark #main-sidebar > div:last-of-type { background:#101828 !important; }
.dark .dr-row-action, .dark .dr-page-btn, .dark .dr-button-secondary { background:#182230; border-color:#475467; color:#d0d5dd !important; }

@media (min-width:768px) {
  .sidebar-collapsed #main-sidebar { width:76px !important; }
}
@media (max-width:1200px) {
  .dr-kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dr-filter-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dr-filter-grid > * { min-width:0; }
}
@media (max-width:767px) {
  #main-sidebar { width:250px; }
  .dr-topbar { height:58px; min-height:58px; padding:0 12px; gap:8px; }
  .dr-global-search { max-width:none; }
  .dr-global-search input { height:36px; font-size:11px; }
  .dr-topbar-quick { display:none; }
  .dr-page-heading { align-items:flex-start; flex-direction:column; padding-top:2px; }
  .dr-page-heading h1 { font-size:18px; }
  .dr-page-heading-actions { width:100%; justify-content:flex-start; }
  .dr-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .dr-kpi { min-height:105px; padding:14px; }
  .dr-kpi-value { font-size:20px; }
  .dr-filter-grid { grid-template-columns:1fr; gap:9px; }
  .dr-table-footer { align-items:flex-start; flex-direction:column; }
}
@media (max-width:430px) {
  .dr-kpi-grid { grid-template-columns:1fr; }
  .dr-kpi { min-height:96px; }
  .dr-topbar-user { display:none; }
}
.dr-table tbody tr.dr-today-row td:first-child { box-shadow:inset 3px 0 0 #f79009; }
.dr-table tbody tr.dr-priority-row td:first-child { box-shadow:inset 3px 0 0 #7f56d9; }
.dr-filter-grid-leads { grid-template-columns:1.45fr 1fr 1fr 1fr auto; }
@media (max-width:1200px) { .dr-filter-grid-leads { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:767px) { .dr-filter-grid-leads { grid-template-columns:1fr; } }
.dr-filter-grid-followups { grid-template-columns:repeat(4,minmax(0,1fr)); }
.dr-filter-actions { display:flex; align-items:center; gap:8px; min-height:38px; }
.dr-filter-actions .dr-button { flex:1; justify-content:center; }
@media (max-width:1200px) { .dr-filter-grid-followups { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:767px) { .dr-filter-grid-followups { grid-template-columns:1fr; } }
.dr-kpi-grid-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:1000px) { .dr-kpi-grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:520px) { .dr-kpi-grid-4 { grid-template-columns:1fr; } }
.dr-view-switch { display:inline-flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--dr-border); border-radius:7px; background:#f2f4f7; }
.dr-view-switch-btn { height:30px; padding:0 12px; border-radius:5px !important; color:#667085; font-size:10px; font-weight:700; background:transparent; }
.dr-view-switch-btn:hover { color:#344054; }
.dr-view-switch-btn.active { background:#fff; color:#101828; box-shadow:0 1px 2px rgba(16,24,40,.06); }

/* ---------- Calendário de próximo retorno ---------- */
.dr-return-calendar-trigger {
  width:100%; min-height:38px; padding:8px 34px 8px 11px; position:relative;
  display:flex; align-items:center; justify-content:flex-start; text-align:left;
  border:1px solid var(--dr-border-strong); border-radius:7px; background:#fff; color:#667085;
  font-size:11px; font-weight:650; line-height:1.2; cursor:pointer;
}
.dr-return-calendar-trigger::after {
  content:'▾'; position:absolute; right:11px; top:50%; transform:translateY(-52%);
  color:#667085; font-size:11px;
}
.dr-return-calendar-trigger:hover { border-color:#84adff; background:#f8faff; }
.dr-return-calendar-trigger:focus { border-color:#84adff; box-shadow:0 0 0 3px rgba(21,94,239,.09); outline:none; }
.dr-return-calendar-trigger.has-value { color:#344054; }
.dr-return-calendar-trigger.is-compact { width:100%; min-width:106px; min-height:34px; height:34px; padding:5px 25px 5px 7px; font-size:10px; }
.dr-return-calendar-trigger.is-compact::after { right:7px; }
.dr-return-calendar-popover {
  position:fixed; z-index:1000; width:318px; padding:12px; border:1px solid #d0d5dd;
  border-radius:10px; background:#fff; color:#344054; box-shadow:0 14px 35px rgba(16,24,40,.18);
}
.dr-return-calendar-popover[hidden] { display:none !important; }
.dr-return-calendar-header { display:grid; grid-template-columns:34px 1fr 34px; align-items:center; gap:8px; margin-bottom:10px; }
.dr-return-calendar-header strong { text-align:center; color:#101828; font-size:12px; font-weight:800; text-transform:capitalize; }
.dr-return-calendar-header button {
  width:34px; height:32px; border:1px solid #e4e7ec; border-radius:7px; background:#f9fafb;
  color:#475467; font-size:21px; line-height:1; cursor:pointer;
}
.dr-return-calendar-header button:hover { background:#eef4ff; color:#155eef; border-color:#b2ccff; }
.dr-return-calendar-weekdays, .dr-return-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.dr-return-calendar-weekdays { margin-bottom:4px; }
.dr-return-calendar-weekdays span { padding:3px 0; text-align:center; color:#98a2b3; font-size:9px; font-weight:800; text-transform:uppercase; }
.dr-return-calendar-blank { min-height:36px; }
.dr-return-calendar-day {
  position:relative; min-width:0; height:36px; display:flex; align-items:center; justify-content:center;
  border:1px solid transparent; border-radius:7px; background:#fff; color:#344054;
  font-size:10px; font-weight:700; cursor:pointer;
}
.dr-return-calendar-day:hover, .dr-return-calendar-day:focus { background:#eef4ff; border-color:#b2ccff; color:#155eef; outline:none; }
.dr-return-calendar-day.is-today { border-color:#84adff; }
.dr-return-calendar-day.is-selected { background:var(--primary-color,#155eef); border-color:var(--primary-color,#155eef); color:#fff; }
.dr-return-calendar-day:disabled { opacity:.35; cursor:not-allowed; }
.dr-return-calendar-day i { position:absolute; left:50%; bottom:3px; width:4px; height:4px; margin-left:-2px; border-radius:50%; background:#12b76a; }
.dr-return-calendar-day.is-selected i { background:#fff; }
.dr-return-calendar-day::after {
  content:attr(data-tooltip); position:absolute; left:50%; bottom:calc(100% + 5px); z-index:4;
  transform:translateX(-50%); min-width:max-content; max-width:220px; padding:6px 8px;
  border-radius:6px; background:#101828; color:#fff; box-shadow:0 5px 14px rgba(16,24,40,.22);
  font-size:9px; font-weight:700; line-height:1.25; white-space:nowrap; pointer-events:none;
  opacity:0; visibility:hidden; transition:opacity .12s ease;
}
.dr-return-calendar-day:hover::after, .dr-return-calendar-day:focus::after { opacity:1; visibility:visible; }
.dr-return-calendar-grid > .dr-return-calendar-day:nth-child(7n+1)::after { left:0; transform:none; }
.dr-return-calendar-grid > .dr-return-calendar-day:nth-child(7n)::after { left:auto; right:0; transform:none; }
.dr-return-calendar-status { min-height:28px; padding:8px 2px 5px; color:#667085; font-size:9px; line-height:1.35; }
.dr-return-calendar-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:8px; border-top:1px solid #eaecf0; }
.dr-return-calendar-footer button { padding:5px 7px; border-radius:6px; color:#155eef; font-size:9px; font-weight:750; cursor:pointer; }
.dr-return-calendar-footer button:hover { background:#eef4ff; }
.dark .dr-return-calendar-trigger, .dark .dr-return-calendar-popover { background:#182230; border-color:#475467; color:#d0d5dd; }
.dark .dr-return-calendar-trigger.has-value, .dark .dr-return-calendar-header strong, .dark .dr-return-calendar-day { color:#f2f4f7; }
.dark .dr-return-calendar-trigger:hover, .dark .dr-return-calendar-day:hover, .dark .dr-return-calendar-day:focus { background:#1d2939; }
.dark .dr-return-calendar-header button { background:#1d2939; border-color:#475467; color:#d0d5dd; }
.dark .dr-return-calendar-day.is-selected { background:var(--primary-color,#155eef); color:#fff; }
.dark .dr-return-calendar-footer { border-color:#344054; }
@media (max-width:420px) {
  .dr-return-calendar-popover { width:calc(100vw - 16px); }
  .dr-return-calendar-day { height:39px; }
}
.dr-kanban-column { background:#f2f4f7; border:1px solid #e4e7ec; border-radius:9px; padding:13px; }
.dr-kanban-card { background:#fff; padding:14px; border:1px solid #e4e7ec; border-radius:8px; box-shadow:0 1px 2px rgba(16,24,40,.025); transition:border-color .12s ease, box-shadow .12s ease; }
.dr-kanban-card:hover { border-color:#b2ccff; box-shadow:0 3px 8px rgba(16,24,40,.045); }
.dr-kanban-card-priority { background:#fffaeb; border-color:#fedf89; }
.dark .dr-view-switch { background:#101828; border-color:#344054; }
.dark .dr-view-switch-btn.active { background:#1d2939; color:#fff; }
.dark .dr-kanban-column { background:#101828; border-color:#344054; }
.dark .dr-kanban-card { background:#182230; border-color:#344054; }

.dr-kpi-grid-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
@media (max-width:900px) { .dr-kpi-grid-3 { grid-template-columns:1fr; } }

/* ---------- Follow-up operational workflow (RC2.1) ---------- */
.dr-table { min-width: 1420px; }
.dr-last-interaction { min-width:150px; max-width:190px; }
.dr-last-interaction-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:5px; }
.dr-interaction-type {
  display:inline-flex; align-items:center; min-height:19px; padding:2px 6px; border-radius:999px;
  border:1px solid #dbe5ff; background:#eff4ff; color:#155eef; font-size:8px; font-weight:800;
  letter-spacing:.025em; text-transform:uppercase; white-space:nowrap;
}
.dr-last-interaction-date { color:#667085; font-size:8.5px; font-weight:650; white-space:nowrap; }
.dr-last-interaction-text {
  color:#344054; font-size:9.5px; line-height:1.35; font-weight:540;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.dr-last-interaction-user { margin-top:4px; color:#98a2b3; font-size:8.5px; font-weight:520; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dr-return-cell { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:126px; }
.dr-quick-reschedule { display:flex; align-items:center; justify-content:center; gap:3px; }
.dr-quick-reschedule button {
  height:22px; min-width:31px; padding:0 5px; border:1px solid #e4e7ec; border-radius:5px !important;
  background:#fff; color:#667085; font-size:8px; line-height:1; font-weight:750; transition:.12s ease;
}
.dr-quick-reschedule button:hover { border-color:#b2ccff; background:#eff4ff; color:#155eef; }
.dr-row-action-primary { background:#155eef; border-color:#155eef; color:#fff; }
.dr-row-action-primary:hover { background:#004eeb; border-color:#004eeb; color:#fff; }

body.dr-modal-open { overflow:hidden; }
.dr-modal-backdrop {
  position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center;
  padding:24px; background:rgba(16,24,40,.56); backdrop-filter:blur(2px);
}
.dr-modal {
  width:min(760px, 100%); max-height:min(90vh, 860px); overflow:auto;
  background:#fff; border:1px solid #d0d5dd; border-radius:11px; box-shadow:0 22px 55px rgba(16,24,40,.22);
}
.dr-modal-header {
  position:sticky; top:0; z-index:2; display:flex; align-items:flex-start; justify-content:space-between; gap:18px;
  padding:20px 22px 16px; background:#fff; border-bottom:1px solid #eaecf0;
}
.dr-modal-eyebrow { color:#155eef; font-size:9px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.dr-modal-header h2 { margin:4px 0 0; color:#101828; font-size:18px; line-height:1.2; font-weight:780; letter-spacing:-.02em; }
.dr-modal-header p { margin:5px 0 0; color:#667085; font-size:10.5px; font-weight:520; }
.dr-modal-close {
  width:34px; height:34px; flex:0 0 34px; display:flex; align-items:center; justify-content:center;
  border:1px solid #e4e7ec; border-radius:7px !important; background:#fff; color:#667085; font-size:22px; line-height:1;
}
.dr-modal-close:hover { background:#f9fafb; color:#101828; }
.dr-modal-body { padding:18px 22px 0; }
.dr-modal-context {
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; margin-bottom:16px;
  background:#f8fafc; border:1px solid #eaecf0; border-radius:7px; color:#667085; font-size:9.5px; font-weight:650;
}
.dr-modal-context strong { color:#344054; font-size:10.5px; font-weight:750; }
.dr-modal-grid { display:grid; gap:12px; }
.dr-modal-grid-2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.dr-modal-body > .dr-field, .dr-modal-body > .dr-modal-grid { margin-bottom:14px; }
.dr-modal-body textarea { resize:vertical; min-height:96px; }
.dr-field-label-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dr-field-label-row span { color:#98a2b3; font-size:8.5px; font-weight:600; }
.dr-field-help { margin-top:5px; color:#98a2b3; font-size:8.5px; line-height:1.35; }
.dr-next-return-box { margin-top:2px; padding:14px; border:1px solid #e4e7ec; border-radius:8px; background:#fbfcfd; }
.dr-next-return-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
.dr-next-return-head strong { display:block; color:#101828; font-size:10.5px; font-weight:760; }
.dr-next-return-head span { display:block; margin-top:3px; color:#667085; font-size:9px; font-weight:520; }
.dr-next-return-shortcuts { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
.dr-next-return-shortcuts button {
  height:28px; padding:0 9px; border:1px solid #d0d5dd; border-radius:6px !important; background:#fff;
  color:#475467; font-size:8.5px; font-weight:700;
}
.dr-next-return-shortcuts button:hover { border-color:#b2ccff; background:#eff4ff; color:#155eef; }
.dr-modal-grid-return { grid-template-columns:minmax(0,1.35fr) minmax(180px,.65fr); align-items:end; }
.dr-checkbox-card {
  min-height:58px; display:flex; align-items:center; gap:9px; padding:9px 11px; border:1px solid #d0d5dd;
  border-radius:7px; background:#fff; cursor:pointer;
}
.dr-checkbox-card:hover { border-color:#98a2b3; }
.dr-checkbox-card input { width:15px !important; height:15px !important; min-height:0 !important; flex:0 0 15px; }
.dr-checkbox-card strong { display:block; color:#344054; font-size:9.5px; font-weight:750; }
.dr-checkbox-card small { display:block; margin-top:2px; color:#98a2b3; font-size:8.5px; font-weight:520; }
.dr-modal-footer {
  position:sticky; bottom:0; display:flex; align-items:center; justify-content:flex-end; gap:8px;
  margin:18px -22px 0; padding:14px 22px; border-top:1px solid #eaecf0; background:#fff;
}

.dark .dr-last-interaction-text { color:#d0d5dd; }
.dark .dr-interaction-type { background:#102a56; border-color:#194185; color:#b2ccff; }
.dark .dr-quick-reschedule button, .dark .dr-modal, .dark .dr-modal-header, .dark .dr-modal-close,
.dark .dr-next-return-shortcuts button, .dark .dr-checkbox-card, .dark .dr-modal-footer { background:#182230; border-color:#475467; color:#d0d5dd; }
.dark .dr-modal-context, .dark .dr-next-return-box { background:#101828; border-color:#344054; }
.dark .dr-modal-header h2, .dark .dr-next-return-head strong, .dark .dr-checkbox-card strong, .dark .dr-modal-context strong { color:#f2f4f7; }
.dark .dr-modal-header { border-bottom-color:#344054; }
.dark .dr-modal-footer { border-top-color:#344054; }

@media (max-width:767px) {
  .dr-modal-backdrop { align-items:flex-end; padding:0; }
  .dr-modal { width:100%; max-height:94vh; border-radius:12px 12px 0 0; border-left:0; border-right:0; border-bottom:0; }
  .dr-modal-header { padding:16px; }
  .dr-modal-body { padding:14px 16px 0; }
  .dr-modal-grid-2, .dr-modal-grid-return { grid-template-columns:1fr; }
  .dr-next-return-head { flex-direction:column; }
  .dr-next-return-shortcuts { justify-content:flex-start; }
  .dr-modal-footer { margin-left:-16px; margin-right:-16px; padding:12px 16px; }
}

/* ---------- Topbar notification badge (RC2.1) ---------- */
.dr-notification-button { position:relative; }
.dr-notification-badge {
  position:absolute; right:-3px; top:-4px; min-width:18px; height:18px; padding:0 4px;
  display:flex; align-items:center; justify-content:center; border:2px solid #fff; border-radius:999px;
  background:#d92d20; color:#fff; font-size:7.5px; line-height:1; font-weight:850; letter-spacing:-.02em;
}
.dark .dr-notification-badge { border-color:#182230; }
