/* Estoura UI overrides on top of the Vali template (css/main.css).
 * Everything visual lives here so main.css stays the untouched vendor file.
 * Colours are tokens; [data-theme="dark"] on <html> swaps them. */

:root {
  --brand: #FF5A09;
  --brand-strong: #C94300; /* white text on this passes WCAG AA (4.9:1) */
  --brand-deep: #A83800;
  --brand-soft: #FFF1E9;
  --on-brand: #ffffff;

  --bg: #F3F4F6;
  --surface: #ffffff;
  --surface-2: #F8F9FA;
  --border: #E5E7EB;
  --text: #1F2328;
  --muted: #5F6670;

  --sidebar: #1B2227;
  --sidebar-hover: #242D33;
  --sidebar-text: #C9D1D9;

  --success: #16A34A;
  --success-soft: #E8F6EE;
  --info: #2563EB;
  --info-soft: #EAF1FE;
  --warning: #B45309;
  --warning-soft: #FEF5E7;
  --danger: #DC2626;
  --danger-soft: #FDECEC;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --focus: 0 0 0 3px rgba(255, 90, 9, .35);
}

[data-theme="dark"] {
  --brand-soft: #3A2216;
  --bg: #111417;
  --surface: #1A1F24;
  --surface-2: #20262C;
  --border: #2D343B;
  --text: #E6E8EB;
  --muted: #9BA4AE;
  --sidebar: #15191D;
  --sidebar-hover: #1F252A;
  --success-soft: #12301F;
  --info-soft: #14243F;
  --warning-soft: #36270F;
  --danger-soft: #3A1717;
  --success: #34C76F;
  --info: #5B8DEF;
  --warning: #E0A040;
  --danger: #F26464;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--text);
}
a { color: var(--brand-strong); }
a:hover, a:focus { color: var(--brand); }
[data-theme="dark"] a { color: #FF8A4C; }
h1, h2, h3, h4, h5 { color: var(--text); }
.text-muted, .help-block { color: var(--muted); }
hr { border-top-color: var(--border); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.content-wrapper {
  background-color: var(--bg);
  min-height: 100vh;
}

/* ---------- Header ---------- */
.main-header .navbar { background-color: var(--brand); }
.main-header .logo {
  background-color: var(--brand-strong);
  letter-spacing: 1px;
}
.main-header .navbar .sidebar-toggle:hover { background-color: rgba(0, 0, 0, .1); }
.main-header .top-nav { margin-right: 15px; }
.main-header .top-nav > li > a { color: var(--on-brand); }
.main-header .top-nav > li.balance > a {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.main-header .top-nav > li.balance > a:before {
  content: "";
  position: absolute;
  inset: 9px 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .12);
  z-index: -1;
}
.main-header .top-nav > li.balance > a { position: relative; z-index: 0; }
.main-header .top-nav .impersonating {
  background: #7C3AED;
  color: #fff;
}
.main-header .top-nav .impersonating:hover { background: #6D28D9 !important; }

.dropdown-menu {
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dropdown-menu > li > a { color: var(--text); padding: 10px 16px; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Sidebar ---------- */
.main-sidebar { background-color: var(--sidebar); }
.user-panel { padding: 18px 15px; }
.user-panel > .info { padding: 4px 5px 4px 14px; }
.user-panel > .info > p:first-child {
  font-weight: 700;
  margin-bottom: 2px;
}
.user-panel .designation {
  color: var(--sidebar-text);
  font-size: 12px;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #FF9A3D);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .5px;
}
.sidebar-menu > li > a {
  color: var(--sidebar-text);
  padding: 12px 18px;
  border-left: 3px solid transparent;
}
.sidebar-menu > li > a > .fa { width: 22px; margin-right: 6px; opacity: .85; }
.sidebar-menu > li:hover > a { background: var(--sidebar-hover); color: #fff; }
.sidebar-menu > li.active > a {
  background: rgba(255, 90, 9, .14);
  color: #fff;
  border-left-color: var(--brand) !important;
  font-weight: 700;
}
.sidebar-menu > li.active > a > .fa { color: var(--brand); opacity: 1; }
.user-panel.version { padding-top: 24px; }
.user-panel.version .designation { text-transform: none; opacity: .5; }

/* Mobile: dim the page behind the open sidebar; tapping it closes the menu */
.sidebar-backdrop { display: none; }
@media (max-width: 767px) {
  .sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1028;
  }
  .main-sidebar { z-index: 1029; }
}

/* ---------- Page title ---------- */
.page-title {
  background: var(--surface);
  box-shadow: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-title h1 { font-weight: 700; font-size: 22px; }
.page-title h1 .fa { color: var(--brand); margin-right: 4px; }
.page-title p { font-style: normal; color: var(--muted); margin-top: 2px; }
.page-title .breadcrumb { background: transparent; }
.page-title .breadcrumb > li, .page-title .breadcrumb > li > a { color: var(--muted); }
.page-title .breadcrumb > li:last-child > a { color: var(--text); }
@media (max-width: 767px) {
  .page-title .breadcrumb { display: none; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 16px;
}
/* Parceiros list: the base theme hard-codes white */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tile .folder-head { font-size: 15px; font-weight: 700; border-bottom-color: var(--border); }
.tile .list-group { margin-bottom: 0; }
.list-group-item { background: var(--surface); color: var(--text); border-color: var(--border); }
.list-group-item[data-click] { cursor: pointer; }
.list-group-item[data-click]:hover { background: var(--brand-soft); }

/* ---------- Stat widgets ---------- */
.widget-small {
  background: var(--surface) !important;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.widget-small .icon {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 0;
  min-width: 72px;
  padding: 16px;
}
.widget-small .icon.fa-3x { font-size: 2em; }
.widget-small.info .icon { background: var(--info-soft); color: var(--info); }
.widget-small.danger .icon { background: var(--danger-soft); color: var(--danger); }
.widget-small.warning .icon { background: var(--warning-soft); color: var(--warning); }
.widget-small.success .icon { background: var(--success-soft); color: var(--success); }
.widget-small .info { padding: 12px 16px; }
.widget-small .info h4 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  margin: 0 0 4px;
}
.widget-small .info p { margin: 0; font-size: 18px; color: var(--text); }
a > .widget-small:hover { border-color: var(--brand); }

/* ---------- Buttons ---------- */
.btn { border-radius: var(--radius-sm); letter-spacing: .5px; }
.btn-primary, .btn-primary:focus {
  background-color: var(--brand-strong);
  color: var(--on-brand);
}
.btn-primary:hover, .btn-primary:active, .btn-primary.active {
  background-color: var(--brand-deep);
  color: var(--on-brand);
}
.btn-default {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-default:hover { background: var(--surface-2); color: var(--text); }
.btn[disabled], .btn.is-loading { opacity: .65; cursor: not-allowed; }
.btn.is-loading .fa { animation: fa-spin 1s infinite linear; }

/* ---------- Forms ---------- */
.form-control {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.form-control:focus {
  border-color: var(--brand);
  box-shadow: var(--focus);
}
.form-control[disabled], .form-control[readonly] {
  background: var(--surface-2);
  color: var(--text);
}
.control-label { font-weight: 700; color: var(--text); }
.select2-container--default .select2-selection--single,
.select2-dropdown {
  background: var(--surface);
  border-color: var(--border);
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text); }

/* ---------- Tables ---------- */
.table { color: var(--text); }
.table > thead > tr > th {
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.table > tbody > tr > td, .table > tbody > tr > th { border-top: 1px solid var(--border); vertical-align: middle; }
.table-striped > tbody > tr:nth-of-type(odd) { background-color: var(--surface-2); }
.table-hover > tbody > tr:hover, .table > tbody > tr:hover { background-color: var(--brand-soft); }
table.dataTable { border-collapse: collapse !important; }
.dataTables_wrapper .dt-buttons .btn { margin-left: 4px; border-radius: var(--radius-sm) !important; }
.dataTables_empty { color: var(--muted); padding: 24px !important; }
.pagination > li > a, .pagination > li > span {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.pagination > li > a:hover { background: var(--surface-2); color: var(--text); }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > span {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}
.pagination > .disabled > a, .pagination > .disabled > a:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--muted);
}

/* ---------- Lottery balls ---------- */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.ball.hit {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 90, 9, .35);
}
.ball-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Key codes and hit counters inside tables */
.table .label {
  display: inline-block;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  letter-spacing: .5px;
}
.table .label-danger {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: Menlo, Consolas, monospace;
}
.table .label-success { background: var(--success); }
.table .label-default { background: var(--border); color: var(--muted); }

/* ---------- Alerts ---------- */
.alert { border: 0; border-left: 4px solid; border-radius: var(--radius-sm); }
.alert h4 { margin-bottom: 4px; font-weight: 700; }
.alert-success { background: var(--success-soft); border-color: var(--success); color: var(--text); }
.alert-info { background: var(--info-soft); border-color: var(--info); color: var(--text); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: var(--text); }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.alert .close { color: var(--text); }

/* ---------- Third-party widgets in dark mode ---------- */
[data-theme="dark"] .sweet-alert { background: var(--surface); }
[data-theme="dark"] .sweet-alert h2, [data-theme="dark"] .sweet-alert p { color: var(--text); }
[data-theme="dark"] .datepicker-dropdown { background: var(--surface); color: var(--text); }
[data-theme="dark"] .modal-content { background: var(--surface); color: var(--text); }
[data-theme="dark"] .close { color: var(--text); text-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Dashboard ---------- */
.stat-strip .widget-small { min-height: 84px; }
.stat-strip .widget-small .info { flex: 1; min-width: 0; }
.stat-strip .widget-small .info p small,
.countdown-date { font-size: 12px; font-weight: 400; color: var(--muted); }
.countdown-date { display: block; }
.countdown-soon { color: var(--danger); }
.countdown-over { color: var(--muted); }
.widget-link, .widget-link:hover { text-decoration: none; color: inherit; }
.widget-link:hover .widget-small { border-color: var(--brand); }

.draw-list { list-style: none; padding: 0; margin: 0; }
.draw-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.draw-list li:first-child { border-top: 0; padding-top: 0; }
.draw-list .draw-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.draw-list .empty { color: var(--muted); justify-content: center; padding: 24px 0; }

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.table-toolbar .dataTables_filter { text-align: left; }
.table-toolbar .dataTables_filter input { margin-left: 0; min-width: 220px; }
.stat-strip .widget-small .info p small { display: block; margin-top: 2px; }
@media (max-width: 767px) {
  .stat-strip > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
  .stat-strip { margin-left: -6px; margin-right: -6px; }
  .stat-strip .widget-small { min-height: 0; margin-bottom: 12px; }
  .stat-strip .widget-small .icon { display: none; }
  .stat-strip .widget-small .info { padding: 12px; }
  .stat-strip .widget-small .info p { font-size: 16px; }
}

/* ---------- Number picker (addBET) ---------- */
.picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.picker-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 36px; }
.picker-slots .ball { min-width: 36px; height: 36px; font-size: 15px; }
.ball.empty { border-style: dashed; background: transparent; }
.picker-count { font-size: 15px; color: var(--muted); white-space: nowrap; }
.picker-count b { font-size: 26px; color: var(--text); }
.picker-count.done b { color: var(--success); }

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.number-grid .num {
  aspect-ratio: 1;
  max-height: 52px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform .1s, background-color .15s;
  justify-self: center;
  width: 100%;
  max-width: 52px;
  padding: 0;
}
.number-grid .num:hover:not(:disabled) { border-color: var(--brand); transform: scale(1.06); }
.number-grid .num.selected {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 90, 9, .4);
}
.number-grid .num:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 480px) {
  .number-grid { grid-template-columns: repeat(7, 1fr); gap: 6px; }
}
.picker-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-actions #submit { margin-left: auto; }
@media (max-width: 480px) {
  .picker-actions #submit { width: 100%; margin-left: 0; }
}
@media (max-width: 480px) {
  .picker-slots { gap: 4px; }
  .picker-slots .ball { min-width: 32px; height: 32px; font-size: 13px; }
}

/* ---------- Login / verify ---------- */
.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, var(--brand) 0, var(--brand) 42vh, var(--bg) 42vh);
}
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.auth-logo {
  font-family: 'Faster One', cursive;
  font-size: 52px;
  font-weight: 400;
  color: #fff;
  margin: 0 0 24px;
  letter-spacing: 2px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
}
.auth-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.auth-title .fa { color: var(--brand); }
.auth-card .btn-lg { margin-top: 8px; padding: 12px; }
.auth-alt {
  display: block;
  margin-top: 20px;
  padding: 12px 16px;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.auth-alt:hover { color: var(--brand-strong); text-decoration: none; background: var(--surface); }
.password-field { position: relative; }
.password-field .form-control { padding-right: 44px; }
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.password-toggle:hover { color: var(--text); }
.code-input {
  text-align: center;
  font-family: Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 4px;
  height: 52px;
  text-transform: uppercase;
}

/* ---------- Mobile tables ---------- */
@media (max-width: 767px) {
  .content-wrapper { padding: 14px; }
  .page-title { margin: -14px -14px 16px; padding: 16px; }
  .card { padding: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table > thead > tr > th, .table > tbody > tr > td { padding: 6px 4px; }
  .keys-table .ball, .card .table .ball { min-width: 26px; height: 26px; font-size: 12px; }
  .table-toolbar .dataTables_filter, .table-toolbar .dataTables_filter label,
  .table-toolbar .dataTables_filter input { width: 100%; min-width: 0; }
  .dataTables_paginate { float: none !important; text-align: center !important; }
}

/* ---------- Accessibility ---------- */
.btn:focus-visible, .form-control:focus-visible, .num:focus-visible,
.sidebar-menu a:focus-visible, .top-nav a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.main-header .top-nav a:focus-visible { outline-color: #fff; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 2000;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { left: 8px; }
fieldset[disabled] .number-grid, fieldset[disabled] .picker-head { opacity: .45; }
fieldset[disabled] .btn { opacity: .5; cursor: not-allowed; }
fieldset { min-width: 0; }

/* Collapsed (icon-only) sidebar on desktop: shrink the avatar to fit the 50px rail */
@media (min-width: 768px) {
  .sidebar-mini.sidebar-collapse .sidebar .user-panel { padding: 12px 0; display: flex; justify-content: center; }
  .sidebar-mini.sidebar-collapse .user-panel > .image { float: none !important; }
  .sidebar-mini.sidebar-collapse .avatar { width: 34px; height: 34px; font-size: 13px; }
  .sidebar-mini.sidebar-collapse .user-panel.version { display: none; }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a { padding-left: 0; padding-right: 0; text-align: center; }
  .sidebar-mini.sidebar-collapse .sidebar-menu > li > a > .fa { margin-right: 0; }
}
.avatar { transition: width .3s ease-in-out, height .3s ease-in-out; }

/* ---------- Phones: tables of keys become stacked rows ----------
 * Row = [code, name, ...] [hits →]  then the 7 balls on their own line.
 * The tr::before is a zero-height, full-width flex item that forces the line break. */
@media (max-width: 767px) {
  .keys-table thead { display: none; }
  .keys-table, .keys-table tbody { display: block; width: 100% !important; }
  .keys-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 4px;
    padding: 10px 2px;
    border-top: 1px solid var(--border);
    background: none !important;
  }
  .keys-table tbody tr:first-child { border-top: 0; }
  .keys-table tbody tr::before { content: ""; order: 2; flex-basis: 100%; height: 0; }
  .keys-table tbody td { display: block; border: 0 !important; padding: 0 !important; }
  .keys-table tbody td:has(> .ball) { order: 3; flex: 1 0 0; display: flex; justify-content: center; }
  .keys-table tbody td:has(> .label-success), .keys-table tbody td:has(> .label-default) { order: 1; margin-left: auto; }
  .keys-table tbody td:has(> .label-success) .label::after,
  .keys-table tbody td:has(> .label-default) .label::after { content: " acertos"; font-weight: 400; }
  .keys-table tbody td:has(> .label-success) .label { font-size: 13px; }
  .keys-table tbody td.dataTables_empty { flex-basis: 100%; text-align: center; }
  .card .keys-table .ball { min-width: 32px; height: 32px; font-size: 13px; }
  .card:has(> .keys-table), .card:has(.dataTables_wrapper > .keys-table) { overflow-x: visible; }

  /* hidden sidebar's shadow was showing as a dark strip on the left edge */
  .main-sidebar { box-shadow: none; }
  .sidebar-open .main-sidebar { box-shadow: var(--shadow-lg); }

  /* comfortable tap targets */
  .alert .close { padding: 10px 14px; margin: -10px -14px 0 0; opacity: .6; }
  .dt-buttons .btn, .dataTables_filter input, .dataTables_paginate .pagination > li > a { min-height: 38px; line-height: 22px; }
  .dataTables_filter input { font-size: 16px; } /* 16px+ stops iOS zooming into the field */
  .form-control { font-size: 16px; }
  .list-group-item .label { display: inline-block; padding: 8px 12px; font-size: 13px; }
}

/* Extraction counters: three digits side by side on any screen */
.odometer { font-size: clamp(56px, 17vw, 150px) !important; }
.table .key-link { cursor: pointer; background: var(--info-soft); color: var(--info); border: 1px solid transparent; }
.table .key-link::before { content: "\f0c1"; font-family: FontAwesome; margin-right: 4px; }
@media (max-width: 767px) {
  .keys-table tbody td:has(> .key-link) { order: 1; }
  .keys-table .key-link { padding: 8px 10px; }
}
.draw-date { max-width: 260px; }
.draw-date input[type="date"] { min-height: 40px; }
[data-theme="dark"] .draw-date input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* ---------- Novidades (changelog) ---------- */
.nav-new {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  vertical-align: 1px;
}
.nav-new[hidden] { display: none; }
.user-panel.version a { color: inherit; }
.user-panel.version a:hover { color: #fff; text-decoration: underline; }
.changelog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.changelog-head .card-title { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.changelog-head .card-title .label { font-size: 11px; }
.changelog-head time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.changelog-summary { color: var(--muted); margin: 0 0 16px; }
.changelog-group { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.changelog-group h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .5px; }
.changelog-novo h3 { color: var(--info); }
.changelog-melhoria h3 { color: var(--success); }
.changelog-correcao h3 { color: var(--warning); }
.changelog-seguranca h3 { color: var(--danger); }
.changelog-group ul { margin: 0; padding-left: 20px; }
.changelog-group li { margin-bottom: 6px; line-height: 1.5; }
.changelog-group li .label { font-size: 10px; vertical-align: 1px; }
.changelog-older { font-size: 13px; }

/* ---------- Histórico de rodas ---------- */
.card-title-link { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-title-link a { font-size: 13px; font-weight: 400; white-space: nowrap; }
.card-title .label { font-size: 11px; vertical-align: 3px; margin-left: 6px; }
.round-summary dl, .random-summary { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.round-summary dt, .random-summary dt { color: var(--muted); font-weight: 400; font-size: 13px; }
.round-summary dd, .random-summary dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.random-summary { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
#resultado .winner-list { margin-top: 12px; }
.winners-card .prize + .prize { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.winners-card .prize h4 { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.winner-list { list-style: none; padding: 0; margin: 0; }
.winner { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: var(--surface-2); }
.winner.mine { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.winner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.winner-head .label-danger { background: var(--surface); color: var(--text); border: 1px solid var(--border); font-family: Menlo, Consolas, monospace; }
.winner-name { color: var(--muted); font-size: 13px; }
.winner-hits { margin-left: auto; font-weight: 700; color: var(--success); font-size: 13px; }
@media (max-width: 480px) { .winner .ball { min-width: 30px; height: 30px; font-size: 12px; } }

/* ---------- Configurações ---------- */
.settings-card { padding: 20px 22px; }
.settings-card .card-title small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.settings-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.settings-head .card-title { margin-bottom: 0; }
.settings-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.settings-chips .label { font-size: 11px; font-weight: 600; padding: 4px 8px; }
/* the legend floats so it stops sitting on (and hiding) the fieldset's top rule */
.settings-form fieldset { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 16px; }
.settings-form legend + * { clear: both; }
.settings-form legend {
  float: left;
  width: 100%;
  border: 0;
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-form legend small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.settings-form .form-group { margin-bottom: 12px; }
.settings-form .control-label .fa-lock { color: var(--muted); margin-left: 4px; }
.settings-form .checkbox { margin: 2px 0 8px; }
.settings-form .checkbox .help-inline { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.settings-help-top { margin-top: 28px; }
.settings-lock {
  margin: 4px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.settings-actions:only-child, .settings-card form .settings-actions:last-child { margin-bottom: 0; }
.settings-danger { color: var(--danger) !important; border-color: var(--danger) !important; background: transparent !important; }
.settings-danger:hover { background: var(--danger-soft) !important; }
.settings-balance { font-size: 15px; margin-bottom: 12px; }
.settings-balance b { font-size: 22px; margin: 0 4px; }
.settings-balance small { color: var(--muted); }
.settings-form input[type="datetime-local"].form-control { line-height: normal; }
[data-theme="dark"] .settings-form input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(1); }
.settings-inline { display: flex; gap: 8px; }
.settings-inline .form-control { flex: 1; min-width: 0; }
.settings-inline .btn { flex: none; margin: 0; }
@media (max-width: 767px) {
  .settings-help-top { margin-top: 0; }
}

/* ---------- Estatísticas (gráficos de inc/partes/graficos.php) ----------
 * Cores validadas (paleta de referência): série azul #2a78d6 / escuro #3987e5;
 * mapa sequencial num só tom, do claro (pouco) ao escuro (muito), com passos próprios no tema escuro. */
.viz {
  --viz-1: #2a78d6;
  --viz-s0: var(--surface-2);
  --viz-s1: #cde2fb; --viz-s2: #9ec5f4; --viz-s3: #5598e7; --viz-s4: #256abf; --viz-s5: #0d366b;
  --viz-ink-s1: #0b0b0b; --viz-ink-s2: #0b0b0b; --viz-ink-s3: #0b0b0b; --viz-ink-s4: #ffffff; --viz-ink-s5: #ffffff;
  margin: 0;
}
[data-theme="dark"] .viz {
  --viz-1: #3987e5;
  --viz-s1: #0d366b; --viz-s2: #184f95; --viz-s3: #256abf; --viz-s4: #5598e7; --viz-s5: #9ec5f4;
  --viz-ink-s1: #ffffff; --viz-ink-s2: #ffffff; --viz-ink-s3: #ffffff; --viz-ink-s4: #0b0b0b; --viz-ink-s5: #0b0b0b;
}
.stats-section { font-size: 18px; font-weight: 700; margin: 8px 0 14px; display: flex; align-items: center; gap: 8px; }
.stats-section .label { font-size: 11px; }
.stats-tiles .widget-small .info h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-tiles .widget-small .info p { font-variant-numeric: normal; }
.stats-picker { display: flex; align-items: center; gap: 8px; }
.stats-picker label { margin: 0; font-weight: 600; color: var(--muted); }
.stats-picker select { width: auto; min-width: 190px; }
.card-title small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.stats-rounds { margin-top: 18px; }
.stats-rounds .table { font-variant-numeric: tabular-nums; }

/* dica comum a todas as marcas: o valor primeiro, por cima da marca */
.viz [data-tip] { position: relative; outline: none; }
.viz [data-tip]:hover::after, .viz [data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 5;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.viz [data-tip]:focus-visible { box-shadow: var(--focus); border-radius: 4px; }

/* colunas */
.viz-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 180px; margin: 22px 0 0 34px; }
.viz-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--border); }
.viz-grid b { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; cursor: default; }
.viz-bar { display: block; width: 100%; max-width: 24px; min-height: 0; background: var(--viz-1); border-radius: 4px 4px 0 0; position: relative; z-index: 1; }
.viz-bar.viz-zero { height: 2px !important; background: var(--border); border-radius: 0; }
.viz-col:hover .viz-bar:not(.viz-zero), .viz-col:focus .viz-bar:not(.viz-zero) { filter: brightness(1.15); }
.viz-val { position: absolute; left: 0; right: 0; margin-bottom: 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text); }
.viz-x { display: flex; gap: 2px; margin-left: 34px; padding-top: 6px; }
.viz-x span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-axis-title { text-align: center; font-size: 12px; color: var(--muted); margin: 2px 0 0; }

/* barras horizontais */
.viz-bars { list-style: none; padding: 0; margin: 0; }
.viz-bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; align-items: center; gap: 10px; padding: 5px 0; }
.viz-bar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viz-bar-track { display: flex; align-items: center; gap: 6px; min-width: 0; }
.viz-hbar { display: block; height: 14px; max-width: calc(100% - 40px); min-width: 2px; background: var(--viz-1); border-radius: 0 4px 4px 0; }
.viz-hval { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.viz-bars li:hover .viz-hbar, .viz-bars li:focus .viz-hbar { filter: brightness(1.15); }
.viz-bars [data-tip]:hover::after, .viz-bars [data-tip]:focus::after { left: auto; right: 0; transform: none; }

/* mapa dos números */
.viz-heat { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; max-width: 560px; }
.viz-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1.25; border-radius: 4px; cursor: default;
  background: var(--viz-s0); color: var(--text);
  border: 1px solid var(--border);
}
.viz-cell[class*="viz-s"]:not(.viz-s0) { border-color: transparent; }
.viz-cell b { font-size: 14px; line-height: 1.1; }
.viz-cell small { font-size: 10px; opacity: .8; font-variant-numeric: tabular-nums; }
.viz-cell.viz-s1 { background: var(--viz-s1); color: var(--viz-ink-s1); }
.viz-cell.viz-s2 { background: var(--viz-s2); color: var(--viz-ink-s2); }
.viz-cell.viz-s3 { background: var(--viz-s3); color: var(--viz-ink-s3); }
.viz-cell.viz-s4 { background: var(--viz-s4); color: var(--viz-ink-s4); }
.viz-cell.viz-s5 { background: var(--viz-s5); color: var(--viz-ink-s5); }
.viz-cell.viz-saiu { box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--text); }
.viz-heat .viz-cell:hover, .viz-heat .viz-cell:focus { filter: brightness(1.1); }
.viz-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.viz-legend .viz-cell { width: 18px; aspect-ratio: auto; height: 14px; display: inline-block; border-radius: 3px; }
.viz-legend .viz-saiu { margin-left: 14px; }
.viz-table { margin-top: 12px; font-size: 13px; }
.viz-table summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.viz-table table { margin-top: 8px; max-width: 420px; }
@media (max-width: 767px) {
  .page-title:has(.stats-picker) { flex-wrap: wrap; }
  .stats-picker { margin-top: 8px; width: 100%; }
  .stats-picker select { flex: 1; min-width: 0; }
  .viz-cell b { font-size: 12px; }
  .viz-cell small { display: none; }
}
