/* CID tools visual refresh - shared presentation layer */
:root{
  --tool-primary:#151b3c;
  --tool-accent:#ff5a3c;
  --tool-bg:#f4f7fb;
  --tool-card:#ffffff;
  --tool-text:#0f172a;
  --tool-muted:#64748b;
  --tool-border:#dbe3ee;
  --tool-soft:#f8fafc;
  --tool-radius:22px;
  --tool-shadow:0 18px 48px rgba(15,23,42,.09);
}

html{background:var(--tool-bg);}
body{
  color:var(--tool-text);
  background:
    radial-gradient(circle at 8% 10%, rgba(255,90,60,.10), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(21,27,60,.10), transparent 30%),
    linear-gradient(135deg, #f8fafc 0%, #edf2f7 48%, #f7f8fb 100%) !important;
}

.wrap,
.wrapper,
.shell,
.toolrunner-container{
  position:relative;
}

.wrap,
.wrapper{
  padding-top:28px;
  padding-bottom:52px;
}

.page{
  min-height:100vh;
}

.page > header{
  background:rgba(255,255,255,.92) !important;
  border-bottom:1px solid rgba(226,232,240,.85) !important;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.topbar,
.top,
.modebar,
.statusbar,
.context-panel,
.wallet-panel,
.upload-panel,
.ops-card,
.panel,
.card,
.box,
.status-item,
.suitePanel,
.casebox,
.inline-card,
.meta-card,
.queue-panel,
.queue-item,
.viewer,
.work-sidebar,
.media-wrap,
.editor-toolbar,
.drawer,
.report-panel,
.form-section,
.summary-card,
.identity-panel,
.warnbox,
.warning,
.preview,
.logoBox,
.brand-fixed-wrap,
.capture,
.tablewrap,
.table-wrap{
  border-color:var(--tool-border) !important;
  background:rgba(255,255,255,.90) !important;
  border-radius:var(--tool-radius) !important;
  box-shadow:var(--tool-shadow) !important;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.topbar,
.top,
.modebar,
.statusbar,
.report-panel{
  padding:18px !important;
}

.topbar,
.top,
.report-panel,
.warnbox,
.warning{
  overflow:hidden;
  position:relative;
}

.topbar::before,
.top::before,
.report-panel::before,
.warnbox::before,
.warning::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:linear-gradient(180deg, var(--tool-accent), #26366f);
}

.brand,
.top > div:first-child{
  position:relative;
  z-index:1;
}

.wrapper{
  max-width:1180px;
  margin-left:auto !important;
  margin-right:auto !important;
}

.eyebrow{
  border-color:rgba(255,90,60,.24) !important;
  background:#fff7ed !important;
  color:#9a3412 !important;
  box-shadow:0 8px 18px rgba(15,23,42,.04) !important;
}

.logo{
  box-shadow:0 12px 28px rgba(15,23,42,.13) !important;
}

h1,
.h1,
.title,
.panel-title,
.wallet-title,
.context-title,
.h2,
.section-title,
.label,
.title{
  color:var(--tool-primary) !important;
  letter-spacing:0 !important;
}

.sub,
.subtitle,
.muted,
.hint,
.wallet-sub,
.context-sub,
.meta,
.note,
.queue-meta,
.small{
  color:var(--tool-muted) !important;
  line-height:1.5;
}

.grid,
.grid2,
.grid3,
.grid4,
.field-grid,
.summary-grid,
.mini-grid,
.suiteSections,
.status-list,
.advanced-grid,
.context-grid,
.meta-grid,
.options,
.ops-strip{
  gap:14px !important;
}

.btn,
.mini-btn,
.modebtn,
.pill-toggle,
button:not(.nav-toggle):not(.buy-modal-close){
  border-color:var(--tool-border) !important;
  border-radius:12px !important;
  box-shadow:0 8px 18px rgba(15,23,42,.04) !important;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease !important;
}

.btn:hover,
.mini-btn:hover,
.modebtn:hover,
.pill-toggle:hover,
button:not(.nav-toggle):not(.buy-modal-close):hover{
  transform:translateY(-1px);
  border-color:#cbd5e1 !important;
  box-shadow:0 12px 24px rgba(15,23,42,.08) !important;
}

.btn.primary,
.btn.accent,
.modebtn.active,
.pill-toggle.active,
button.primary,
button.accent{
  color:#fff !important;
  border-color:transparent !important;
}

.btn.primary,
.modebtn.active,
.pill-toggle.active.standard,
button.primary{
  background:linear-gradient(135deg, var(--tool-primary), #26366f) !important;
}

.btn.accent,
.pill-toggle.active.forensic,
button.accent{
  background:linear-gradient(135deg, var(--tool-accent), #ff7a63) !important;
}

.btn.danger,
button.danger,
.audio-delete-btn{
  border-color:#fecaca !important;
  background:#fff5f5 !important;
  color:#991b1b !important;
}

.input,
.select,
textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
.fake-input,
.speaker-select,
.speaker-input{
  border-color:var(--tool-border) !important;
  border-radius:12px !important;
  background:#fff !important;
  transition:border-color .18s ease, box-shadow .18s ease;
}

.input:focus,
.select:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
.speaker-select:focus,
.speaker-input:focus{
  outline:none !important;
  border-color:rgba(255,90,60,.70) !important;
  box-shadow:0 0 0 4px rgba(255,90,60,.12) !important;
}

.pill,
.chip,
.badge,
.tag,
.meta-badge,
.statuspill,
.wallet-mode-badge,
.queue-status{
  border-color:var(--tool-border) !important;
  background:#fff !important;
  border-radius:999px !important;
  box-shadow:0 6px 16px rgba(15,23,42,.04) !important;
}

.table,
table.table,
.gridWrap,
.tablewrap,
.table-wrap,
.miniTable,
.transcript-file-rail,
.segments,
.media-box,
.forensic-box,
.wallet-balance,
.wallet-jobs,
.wallet-plan-card,
.drop{
  border-color:var(--tool-border) !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:0 10px 24px rgba(15,23,42,.04) !important;
}

.tablewrap,
.table-wrap{
  overflow:auto;
}

.table th,
.miniTable th,
table th{
  color:var(--tool-muted) !important;
  background:#f8fafc !important;
  letter-spacing:.06em;
}

.table td,
.miniTable td,
table td{
  border-color:#e2e8f0 !important;
}

.table tr:hover td,
.miniTable tr:hover td{
  background:#fbfdff !important;
}

pre,
code{
  border-radius:14px !important;
}

pre{
  box-shadow:0 14px 30px rgba(15,23,42,.10) !important;
}

.casebox,
.status-item,
.box,
.statbox,
.suitePanel,
.meta-item,
.sample-item,
.license-detail-item,
.summary-card,
.capture{
  position:relative;
  overflow:hidden;
}

.casebox::before,
.status-item::before,
.box::before,
.statbox::before,
.suitePanel::before,
.meta-item::before,
.sample-item::before,
.summary-card::before,
.capture::before{
  content:"";
  position:absolute;
  left:0;
  top:14px;
  bottom:14px;
  width:4px;
  border-radius:999px;
  background:var(--tool-accent);
}

.menu a{
  border:1px solid transparent !important;
  border-radius:14px !important;
  transition:background .18s ease, border-color .18s ease, transform .18s ease !important;
}

.menu a:hover{
  transform:translateX(2px);
  border-color:#e2e8f0 !important;
  background:#f8fafc !important;
}

.menu a.active{
  border-color:rgba(255,90,60,.22) !important;
  background:linear-gradient(135deg, rgba(255,90,60,.12), rgba(255,255,255,.88)) !important;
  box-shadow:inset 3px 0 0 var(--tool-accent), 0 10px 22px rgba(15,23,42,.05) !important;
}

.warn,
.warning,
.warnbox,
.drop.drag{
  border-color:#fed7aa !important;
  background:#fff7ed !important;
  color:#9a3412 !important;
}

.seg,
.transcript-file-open,
.folder-chip,
.folder-row{
  border-color:#e2e8f0 !important;
  border-radius:14px !important;
}

.seg.active{
  background:#fff7ed !important;
  box-shadow:inset 4px 0 0 var(--tool-accent) !important;
}

.runner-shell > header,
.page > header{
  background:rgba(255,255,255,.92) !important;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(226,232,240,.85) !important;
}

.frame{
  background:#fff !important;
}

@media (max-width:920px){
  .wrap,
  .wrapper{padding:20px 14px 38px !important;}
  .grid,
  .grid2,
  .grid3,
  .grid4,
  .field-grid,
  .summary-grid,
  .mini-grid,
  .status-list,
  .advanced-grid,
  .context-grid,
  .ops-strip,
  .options{grid-template-columns:1fr !important;}
}

@media (max-width:720px){
  .topbar,
  .top,
  .modebar,
  .statusbar,
  .panel,
  .card,
  .report-panel,
  .warnbox,
  .warning{border-radius:18px !important;}
  .row .btn,
  .row2 .btn,
  .actions .btn,
  .modegroup .modebtn{width:100%;}
  .row .input,
  .row .select,
  .row2 .input,
  .row2 select,
  .modegroup{width:100%;min-width:0 !important;}
}

@media print{
  body{background:#fff !important;}
  .card,.panel,.box,.table,table{box-shadow:none !important;backdrop-filter:none !important;}
}

/* Contrast guard for tool dark mode.
   Rule: white surfaces use dark text; dark surfaces use light text. */
html[data-theme="dark"]{
  --tool-bg:#0f1424;
  --tool-card:#171d2d;
  --tool-text:#edf2ff;
  --tool-muted:#b7c0d4;
  --tool-border:#30394d;
  --tool-soft:#111827;
}

html[data-theme="dark"],
html[data-theme="dark"] body{
  background:#0f1424 !important;
  color:#edf2ff !important;
  -webkit-text-fill-color:initial;
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .top,
html[data-theme="dark"] .modebar,
html[data-theme="dark"] .statusbar,
html[data-theme="dark"] .context-panel,
html[data-theme="dark"] .wallet-panel,
html[data-theme="dark"] .upload-panel,
html[data-theme="dark"] .ops-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .box,
html[data-theme="dark"] .status-item,
html[data-theme="dark"] .suitePanel,
html[data-theme="dark"] .casebox,
html[data-theme="dark"] .inline-card,
html[data-theme="dark"] .meta-card,
html[data-theme="dark"] .queue-panel,
html[data-theme="dark"] .queue-item,
html[data-theme="dark"] .viewer,
html[data-theme="dark"] .work-sidebar,
html[data-theme="dark"] .media-wrap,
html[data-theme="dark"] .editor-toolbar,
html[data-theme="dark"] .drawer,
html[data-theme="dark"] .report-panel,
html[data-theme="dark"] .form-section,
html[data-theme="dark"] .summary-card,
html[data-theme="dark"] .identity-panel,
html[data-theme="dark"] .preview,
html[data-theme="dark"] .tablewrap,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .table,
html[data-theme="dark"] table.table,
html[data-theme="dark"] .miniTable,
html[data-theme="dark"] .segments,
html[data-theme="dark"] .media-box,
html[data-theme="dark"] .forensic-box,
html[data-theme="dark"] .wallet-balance,
html[data-theme="dark"] .wallet-jobs,
html[data-theme="dark"] .wallet-plan-card,
html[data-theme="dark"] .drop,
html[data-theme="dark"] .runner-shell > header,
html[data-theme="dark"] .page > header{
  background:#171d2d !important;
  background-image:none !important;
  border-color:#30394d !important;
  color:#edf2ff !important;
  -webkit-text-fill-color:initial !important;
}

html[data-theme="dark"] .topbar *,
html[data-theme="dark"] .top *,
html[data-theme="dark"] .modebar *,
html[data-theme="dark"] .statusbar *,
html[data-theme="dark"] .panel *,
html[data-theme="dark"] .card *,
html[data-theme="dark"] .box *,
html[data-theme="dark"] .table *,
html[data-theme="dark"] table.table *,
html[data-theme="dark"] .miniTable *,
html[data-theme="dark"] .preview *,
html[data-theme="dark"] .report-panel *,
html[data-theme="dark"] .summary-card *,
html[data-theme="dark"] .form-section *,
html[data-theme="dark"] .runner-shell > header *{
  color:inherit;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .h1,
html[data-theme="dark"] .h2,
html[data-theme="dark"] .title,
html[data-theme="dark"] .panel-title,
html[data-theme="dark"] .wallet-title,
html[data-theme="dark"] .context-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .label,
html[data-theme="dark"] strong,
html[data-theme="dark"] b{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] .sub,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .wallet-sub,
html[data-theme="dark"] .context-sub,
html[data-theme="dark"] .meta,
html[data-theme="dark"] .note,
html[data-theme="dark"] .queue-meta,
html[data-theme="dark"] .small,
html[data-theme="dark"] .mini{
  color:#b7c0d4 !important;
  -webkit-text-fill-color:#b7c0d4 !important;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] .select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select,
html[data-theme="dark"] .fake-input,
html[data-theme="dark"] .speaker-select,
html[data-theme="dark"] .speaker-input,
html[data-theme="dark"] .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] .mini-btn,
html[data-theme="dark"] .modebtn:not(.active),
html[data-theme="dark"] .pill,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .meta-badge,
html[data-theme="dark"] .statuspill,
html[data-theme="dark"] .queue-status,
html[data-theme="dark"] .brand-fixed-wrap,
html[data-theme="dark"] .logoBox,
html[data-theme="dark"] .frame,
html[data-theme="dark"] .thumb,
html[data-theme="dark"] .summary-card img,
html[data-theme="dark"] .video-still{
  background:#ffffff !important;
  background-image:none !important;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
  border-color:#dbe3ee !important;
}

html[data-theme="dark"] .input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] input::placeholder{
  color:#6b7280 !important;
  -webkit-text-fill-color:#6b7280 !important;
}

html[data-theme="dark"] .table th,
html[data-theme="dark"] .miniTable th,
html[data-theme="dark"] table th{
  background:#111827 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border-color:#30394d !important;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .miniTable td,
html[data-theme="dark"] table td{
  background:#171d2d !important;
  color:#edf2ff !important;
  -webkit-text-fill-color:#edf2ff !important;
  border-color:#30394d !important;
}

html[data-theme="dark"] .warn,
html[data-theme="dark"] .warning,
html[data-theme="dark"] .warnbox,
html[data-theme="dark"] .drop.drag,
html[data-theme="dark"] .case-evidence,
html[data-theme="dark"] .evidence-required{
  background:#fff7ed !important;
  background-image:none !important;
  color:#7c2d12 !important;
  -webkit-text-fill-color:#7c2d12 !important;
  border-color:#fdba74 !important;
}

html[data-theme="dark"] .ok{background:#f0fdf4 !important;color:#14532d !important;-webkit-text-fill-color:#14532d !important;border-color:#bbf7d0 !important;}
html[data-theme="dark"] .bad{background:#fef2f2 !important;color:#7f1d1d !important;-webkit-text-fill-color:#7f1d1d !important;border-color:#fecaca !important;}
html[data-theme="dark"] .info{background:#eff6ff !important;color:#1d4ed8 !important;-webkit-text-fill-color:#1d4ed8 !important;border-color:#bfdbfe !important;}

html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .btn.accent,
html[data-theme="dark"] button.primary,
html[data-theme="dark"] button.accent,
html[data-theme="dark"] .modebtn.active,
html[data-theme="dark"] .pill-toggle.active{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] button[id*="Reload"],
html[data-theme="dark"] .btn[id*="Reload"]{
  background:#111827 !important;
  background-image:none !important;
  border-color:#334155 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

/* Hide user-facing JSON/debug panels in tools. Internal JSON for APIs/audit remains untouched. */
#btnJson,
#jsonBtn,
#btnExportJson,
#btnCopy,
#json,
.act-json,
article.suitePanel:has(#jsonText),
a#btnJson,
button#btnJson,
button#jsonBtn{
  display:none !important;
}


/* Global dark-mode pagination contrast: dark controls must use white text. */
html[data-theme="dark"] .pager .btn,
html[data-theme="dark"] .pagerbar .btn,
html[data-theme="dark"] .pagination .btn,
html[data-theme="dark"] .traffic-pagination .btn,
html[data-theme="dark"] .wallet-pagination .btn,
html[data-theme="dark"] button[id*="Prev"],
html[data-theme="dark"] button[id*="Next"],
html[data-theme="dark"] .btn[id*="Prev"],
html[data-theme="dark"] .btn[id*="Next"]{
  background:#141b2b !important;
  background-image:none !important;
  border-color:#5b657a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:none !important;
}

html[data-theme="dark"] .pager .btn *,
html[data-theme="dark"] .pagerbar .btn *,
html[data-theme="dark"] .pagination .btn *,
html[data-theme="dark"] .traffic-pagination .btn *,
html[data-theme="dark"] .wallet-pagination .btn *,
html[data-theme="dark"] button[id*="Prev"] *,
html[data-theme="dark"] button[id*="Next"] *,
html[data-theme="dark"] .btn[id*="Prev"] *,
html[data-theme="dark"] .btn[id*="Next"] *{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] .pagerinfo,
html[data-theme="dark"] .pager-info,
html[data-theme="dark"] .page-info,
html[data-theme="dark"] .wallet-pagination-info,
html[data-theme="dark"] [id*="PageInfo"]{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}


/* Final specificity bump for dark pagination controls over generic dark button rules. */
html[data-theme="dark"] body .pager .btn:not(.primary),
html[data-theme="dark"] body .pagerbar .btn:not(.primary),
html[data-theme="dark"] body .pagination .btn:not(.primary),
html[data-theme="dark"] body .traffic-pagination .btn:not(.primary),
html[data-theme="dark"] body .wallet-pagination .btn:not(.primary),
html[data-theme="dark"] body button.btn[id*="Prev"],
html[data-theme="dark"] body button.btn[id*="Next"],
html[data-theme="dark"] body .btn[id*="Prev"]:not(.primary),
html[data-theme="dark"] body .btn[id*="Next"]:not(.primary){
  background:#141b2b !important;
  background-image:none !important;
  border-color:#5b657a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:none !important;
}

html[data-theme="dark"] body .pager .btn:not(.primary) *,
html[data-theme="dark"] body .pagerbar .btn:not(.primary) *,
html[data-theme="dark"] body .pagination .btn:not(.primary) *,
html[data-theme="dark"] body .traffic-pagination .btn:not(.primary) *,
html[data-theme="dark"] body .wallet-pagination .btn:not(.primary) *,
html[data-theme="dark"] body button.btn[id*="Prev"] *,
html[data-theme="dark"] body button.btn[id*="Next"] *,
html[data-theme="dark"] body .btn[id*="Prev"]:not(.primary) *,
html[data-theme="dark"] body .btn[id*="Next"]:not(.primary) *{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}


/* Strongest dark pagination override for generic non-primary/non-accent tool buttons. */
html[data-theme="dark"] body .pager .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .pagerbar .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .pagination .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .traffic-pagination .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .wallet-pagination .btn:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body button.btn[id*="Prev"]:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body button.btn[id*="Next"]:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .btn[id*="Prev"]:not(.primary):not(.accent):not(.danger),
html[data-theme="dark"] body .btn[id*="Next"]:not(.primary):not(.accent):not(.danger){
  background:#141b2b !important;
  background-image:none !important;
  border-color:#5b657a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:none !important;
}


/* Dark-mode pagination text must stay white in every module. */
html[data-theme="dark"] .pager,
html[data-theme="dark"] .pager *,
html[data-theme="dark"] .pagerbar,
html[data-theme="dark"] .pagerbar *,
html[data-theme="dark"] .pagination,
html[data-theme="dark"] .pagination *,
html[data-theme="dark"] .traffic-pagination,
html[data-theme="dark"] .traffic-pagination *,
html[data-theme="dark"] .wallet-pagination,
html[data-theme="dark"] .wallet-pagination *{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] .pager .btn,
html[data-theme="dark"] .pagerbar .btn,
html[data-theme="dark"] .pagination .btn,
html[data-theme="dark"] .traffic-pagination .btn,
html[data-theme="dark"] .wallet-pagination .btn,
html[data-theme="dark"] .pager button,
html[data-theme="dark"] .pagerbar button,
html[data-theme="dark"] .pagination button,
html[data-theme="dark"] .traffic-pagination button,
html[data-theme="dark"] .wallet-pagination button{
  background:#141b2b !important;
  background-image:none !important;
  border-color:#5b657a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:none !important;
}


/* Universal dark-mode button contrast: every module button text must be white. */
html[data-theme="dark"] button,
html[data-theme="dark"] .btn,
html[data-theme="dark"] a.btn,
html[data-theme="dark"] input[type="button"],
html[data-theme="dark"] input[type="submit"],
html[data-theme="dark"] input[type="reset"]{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] button:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] .btn:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] a.btn:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] input[type="button"]:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] input[type="submit"]:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger),
html[data-theme="dark"] input[type="reset"]:not(.primary):not(.accent):not(.danger):not(.btn-primary):not(.btn-danger){
  background:#141b2b !important;
  background-image:none !important;
  border-color:#5b657a !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:none !important;
}

html[data-theme="dark"] button *,
html[data-theme="dark"] .btn *,
html[data-theme="dark"] a.btn *{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}


/* Final contrast policy: dark background = white text, white background = dark text, orange = dark text. */
html[data-theme="dark"] body:has(.dashboard-layout) :is(#view-inicio,#view-herramientas,#view-tool-installer,#view-licencias,#view-trafico,#view-comercial,#view-ventas,#view-casos,#view-instituciones,#view-usuarios,#view-perfiles) :not(input):not(textarea):not(select):not(option){
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}

html[data-theme="dark"] body:has(.dashboard-layout) :is(.jg-keep-light,.license-user-row,.lic-users-filter-card,.license-detail-panel,.license-detail-item,#noteRole),
html[data-theme="dark"] body:has(.dashboard-layout) :is(.jg-keep-light,.license-user-row,.lic-users-filter-card,.license-detail-panel,.license-detail-item,#noteRole) *{
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
}

html[data-theme="dark"] :is(.btn.accent,.btn.orange,.btn-panel-orange,button.accent,a.btn.accent,a.btn.orange),
html[data-theme="dark"] :is(.btn.accent,.btn.orange,.btn-panel-orange,button.accent,a.btn.accent,a.btn.orange) *,
html[data-theme="dark"] body:has(.dashboard-layout) :is(.view-subnav .btn.is-active,.sales-subnav .btn.is-active){
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
}


/* Final orange surfaces: orange background must use dark text. */
html[data-theme="dark"] :is(.btn.orange,a.btn.orange,.btn.accent,a.btn.accent,.nav-cta,.btn-panel-orange){
  background:#ff755f !important;
  background-image:linear-gradient(135deg,#ff755f,#ff9a6f) !important;
  border-color:#ff755f !important;
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
}
html[data-theme="dark"] :is(.btn.orange,a.btn.orange,.btn.accent,a.btn.accent,.nav-cta,.btn-panel-orange) *{
  color:#111827 !important;
  -webkit-text-fill-color:#111827 !important;
}
