/*
 UNIRE Dashboard Adaptive Readability Layer v2
 CSS ONLY. No routes, controllers, auth, billing, DB, permissions or business logic changed.
*/

/* Dashboard should not show public form draft/autosave notes */
body.unire-dashboard-body .unire-draft-note,
body.unire-private-admin .unire-draft-note,
.unire-dashboard-shell .unire-draft-note,
.unire-private-admin .unire-draft-note,
.unire-recovery-shell .unire-draft-note{
  display:none !important;
}

/* Base adaptive dashboard variables */
:root{
  --unire-dash-bg:#F6FAFF;
  --unire-dash-card:#FFFFFF;
  --unire-dash-card-2:#F8FBFF;
  --unire-dash-text:#102A43;
  --unire-dash-muted:#5B6B7A;
  --unire-dash-border:rgba(16,42,67,.12);
  --unire-dash-link:#0B72D9;
}

html[data-theme="dark"]{
  --unire-dash-bg:#061827;
  --unire-dash-card:#0B253D;
  --unire-dash-card-2:#0F2F4A;
  --unire-dash-text:#F8FAFC;
  --unire-dash-muted:#D6E2F0;
  --unire-dash-border:rgba(214,226,240,.18);
  --unire-dash-link:#93C5FD;
}

/* Whole dashboard surface */
body.unire-dashboard-body,
body.unire-private-admin,
.unire-dashboard-shell,
.unire-recovery-shell{
  background:var(--unire-dash-bg) !important;
  color:var(--unire-dash-text) !important;
}

/* Cards, stats, Tailwind white cards, recovery cards */
.unire-dashboard-shell .unire-card,
.unire-dashboard-shell .unire-stat,
.unire-dashboard-shell .bg-white,
.unire-dashboard-shell .glass,
.unire-recovery-shell .unire-card,
.unire-recovery-shell .unire-stat,
.unire-recovery-shell .bg-white,
.unire-recovery-shell .glass,
.unire-private-admin .unire-card,
.unire-private-admin .unire-stat,
.unire-private-admin .bg-white,
.unire-private-admin .glass{
  background:var(--unire-dash-card) !important;
  color:var(--unire-dash-text) !important;
  border-color:var(--unire-dash-border) !important;
}

/* Text contrast everywhere inside dashboards */
.unire-dashboard-shell h1,
.unire-dashboard-shell h2,
.unire-dashboard-shell h3,
.unire-dashboard-shell h4,
.unire-dashboard-shell strong,
.unire-dashboard-shell label,
.unire-recovery-shell h1,
.unire-recovery-shell h2,
.unire-recovery-shell h3,
.unire-recovery-shell h4,
.unire-recovery-shell strong,
.unire-recovery-shell label,
.unire-private-admin h1,
.unire-private-admin h2,
.unire-private-admin h3,
.unire-private-admin h4,
.unire-private-admin strong,
.unire-private-admin label{
  color:var(--unire-dash-text) !important;
}

.unire-dashboard-shell p,
.unire-dashboard-shell small,
.unire-dashboard-shell span,
.unire-dashboard-shell td,
.unire-dashboard-shell .unire-text,
.unire-dashboard-shell .text-gray-500,
.unire-dashboard-shell .text-gray-600,
.unire-dashboard-shell .text-gray-700,
.unire-recovery-shell p,
.unire-recovery-shell small,
.unire-recovery-shell span,
.unire-recovery-shell td,
.unire-recovery-shell .unire-text,
.unire-recovery-shell .text-gray-500,
.unire-recovery-shell .text-gray-600,
.unire-recovery-shell .text-gray-700,
.unire-private-admin p,
.unire-private-admin small,
.unire-private-admin span,
.unire-private-admin td,
.unire-private-admin .unire-text,
.unire-private-admin .text-gray-500,
.unire-private-admin .text-gray-600,
.unire-private-admin .text-gray-700{
  color:var(--unire-dash-muted) !important;
}

/* Tables: remove white row problem in dark mode and improve all dashboards */
.unire-dashboard-shell table,
.unire-dashboard-shell thead,
.unire-dashboard-shell tbody,
.unire-dashboard-shell tr,
.unire-dashboard-shell th,
.unire-dashboard-shell td,
.unire-recovery-shell table,
.unire-recovery-shell thead,
.unire-recovery-shell tbody,
.unire-recovery-shell tr,
.unire-recovery-shell th,
.unire-recovery-shell td,
.unire-private-admin table,
.unire-private-admin thead,
.unire-private-admin tbody,
.unire-private-admin tr,
.unire-private-admin th,
.unire-private-admin td{
  border-color:var(--unire-dash-border) !important;
}

.unire-dashboard-shell table,
.unire-recovery-shell table,
.unire-private-admin table{
  background:transparent !important;
}

.unire-dashboard-shell thead,
.unire-dashboard-shell th,
.unire-recovery-shell thead,
.unire-recovery-shell th,
.unire-private-admin thead,
.unire-private-admin th{
  background:var(--unire-dash-card-2) !important;
  color:var(--unire-dash-text) !important;
}

.unire-dashboard-shell tbody tr,
.unire-recovery-shell tbody tr,
.unire-private-admin tbody tr{
  background:var(--unire-dash-card) !important;
}

.unire-dashboard-shell tbody tr:nth-child(even),
.unire-recovery-shell tbody tr:nth-child(even),
.unire-private-admin tbody tr:nth-child(even){
  background:var(--unire-dash-card-2) !important;
}

.unire-dashboard-shell td,
.unire-recovery-shell td,
.unire-private-admin td{
  background:transparent !important;
  color:var(--unire-dash-text) !important;
}

/* Table links and UUID text */
.unire-dashboard-shell table a,
.unire-recovery-shell table a,
.unire-private-admin table a{
  color:var(--unire-dash-link) !important;
}

.unire-dashboard-shell table small,
.unire-dashboard-shell table span:not(.unire-status-pill),
.unire-recovery-shell table small,
.unire-recovery-shell table span:not(.unire-status-pill),
.unire-private-admin table small,
.unire-private-admin table span:not(.unire-status-pill){
  color:var(--unire-dash-muted) !important;
}

/* Buttons */
.unire-dashboard-shell .unire-btn,
.unire-recovery-shell .unire-btn,
.unire-private-admin .unire-btn{
  background:#FFFFFF !important;
  color:#102A43 !important;
  border:1px solid rgba(11,114,217,.18) !important;
  text-decoration:none !important;
}

.unire-dashboard-shell .unire-btn-primary,
.unire-recovery-shell .unire-btn-primary,
.unire-private-admin .unire-btn-primary{
  background:#0B72D9 !important;
  color:#FFFFFF !important;
  border-color:#0B72D9 !important;
}

/* Inputs/search/forms */
.unire-dashboard-shell input,
.unire-dashboard-shell select,
.unire-dashboard-shell textarea,
.unire-dashboard-shell .unire-input,
.unire-dashboard-shell .unire-select,
.unire-dashboard-shell .unire-textarea,
.unire-dashboard-shell .unire-admin-search,
.unire-recovery-shell input,
.unire-recovery-shell select,
.unire-recovery-shell textarea,
.unire-private-admin input,
.unire-private-admin select,
.unire-private-admin textarea,
.unire-private-admin .unire-input,
.unire-private-admin .unire-select,
.unire-private-admin .unire-textarea,
.unire-private-admin .unire-admin-search{
  background:var(--unire-dash-card-2) !important;
  color:var(--unire-dash-text) !important;
  border-color:var(--unire-dash-border) !important;
}

.unire-dashboard-shell input::placeholder,
.unire-dashboard-shell textarea::placeholder,
.unire-dashboard-shell .unire-admin-search::placeholder,
.unire-private-admin input::placeholder,
.unire-private-admin textarea::placeholder,
.unire-private-admin .unire-admin-search::placeholder{
  color:var(--unire-dash-muted) !important;
}

/* Status pills */
.unire-dashboard-shell .unire-status-pill,
.unire-recovery-shell .unire-status-pill,
.unire-private-admin .unire-status-pill{
  background:rgba(11,114,217,.10) !important;
  color:var(--unire-dash-text) !important;
  border:1px solid var(--unire-dash-border) !important;
  font-weight:900 !important;
}

.unire-dashboard-shell .unire-status-pill.protected,
.unire-recovery-shell .unire-status-pill.protected,
.unire-private-admin .unire-status-pill.protected{
  background:rgba(22,185,120,.16) !important;
  color:#0B8F61 !important;
}

html[data-theme="dark"] .unire-dashboard-shell .unire-status-pill.protected,
html[data-theme="dark"] .unire-recovery-shell .unire-status-pill.protected,
html[data-theme="dark"] .unire-private-admin .unire-status-pill.protected{
  color:#D1FAE5 !important;
}

/* Alerts */
.unire-dashboard-shell .unire-alert,
.unire-recovery-shell .unire-alert,
.unire-private-admin .unire-alert{
  background:var(--unire-dash-card-2) !important;
  color:var(--unire-dash-text) !important;
  border-color:var(--unire-dash-border) !important;
}

.unire-dashboard-shell .unire-alert *,
.unire-recovery-shell .unire-alert *,
.unire-private-admin .unire-alert *{
  color:var(--unire-dash-text) !important;
}

/* Mobile/table overflow */
.unire-dashboard-shell .unire-card,
.unire-recovery-shell .unire-card,
.unire-private-admin .unire-card{
  overflow-wrap:anywhere;
}

@media(max-width:760px){
  .unire-dashboard-shell table,
  .unire-recovery-shell table,
  .unire-private-admin table{
    min-width:720px;
  }

  .unire-dashboard-shell .unire-card,
  .unire-recovery-shell .unire-card,
  .unire-private-admin .unire-card{
    overflow-x:auto;
  }
}

/* UNIRE consent checkbox click fix — CSS only */
.unire-register-page input[type="checkbox"],
.unire-report-page input[type="checkbox"],
input[name="consent_confirmed"],
input[name="terms"],
input[name="accept_terms"]{
  position:relative !important;
  z-index:5 !important;
  pointer-events:auto !important;
  opacity:1 !important;
  width:18px !important;
  height:18px !important;
  min-width:18px !important;
  accent-color:#16B978;
}

.unire-register-page label,
.unire-register-page .unire-consent-alert,
.unire-register-page .unire-consent-check{
  pointer-events:auto !important;
}

.unire-register-page label *{
  pointer-events:auto !important;
}
