/* Gestor All In Tech v5.16 — tema escuro global e aparência adaptável */
:root{
  --surface:#ffffff;
  --surface-2:#f9fbfa;
  --surface-3:#eef4f0;
  --field:#ffffff;
  --shadow:rgba(18,62,41,.08);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --nav:#081b12;
  --bg:#0c1310;
  --ink:#eef7f1;
  --muted:#a8bbb0;
  --line:#26382e;
  --surface:#121d17;
  --surface-2:#16241c;
  --surface-3:#1b2d23;
  --field:#101a15;
  --shadow:rgba(0,0,0,.34);
}
html[data-theme="dark"] body{background:var(--bg)!important;color:var(--ink)!important}
html[data-theme="dark"] .main{background:var(--bg)!important}
html[data-theme="dark"] .top,html[data-theme="dark"] .top h1,html[data-theme="dark"] .top h2{color:var(--ink)!important}
html[data-theme="dark"] .filters,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .assistant,
html[data-theme="dark"] .payment-card,
html[data-theme="dark"] .film-group,
html[data-theme="dark"] .catalog-card,
html[data-theme="dark"] .backup-download-card,
html[data-theme="dark"] .restore-center,
html[data-theme="dark"] .version-history-dropdown,
html[data-theme="dark"] .version-history-item,
html[data-theme="dark"] .launcher-card:not(.dark),
html[data-theme="dark"] .inventory-card,
html[data-theme="dark"] .stock-card,
html[data-theme="dark"] .customer-card,
html[data-theme="dark"] .report-card,
html[data-theme="dark"] .kpi-card{
  background:var(--surface)!important;
  color:var(--ink)!important;
  border-color:var(--line)!important;
  box-shadow:0 8px 28px var(--shadow)!important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:var(--field)!important;
  color:var(--ink)!important;
  border-color:var(--line)!important;
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#7f9488!important}
html[data-theme="dark"] option{background:#101a15;color:#eef7f1}
html[data-theme="dark"] table{color:var(--ink)!important}
html[data-theme="dark"] th{color:#a8bbb0!important;border-color:var(--line)!important;background:#101a15!important}
html[data-theme="dark"] td{border-color:#223229!important}
html[data-theme="dark"] tbody tr:hover{background:#17271e!important}
html[data-theme="dark"] .tabs button,
html[data-theme="dark"] .list-filters button,
html[data-theme="dark"] .filter-modes button,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] button.secondary{
  background:var(--surface-3)!important;
  color:var(--ink)!important;
  border-color:var(--line)!important;
}
html[data-theme="dark"] .tabs button.on,html[data-theme="dark"] .list-filters button.on{background:var(--p)!important;color:#fff!important}
html[data-theme="dark"] .tag{background:#173425!important;color:#77e5aa!important}
html[data-theme="dark"] .low{background:#3a2d12!important;color:#ffd875!important}
html[data-theme="dark"] .danger{background:#3c1d1b!important;color:#ff9f98!important}
html[data-theme="dark"] .source-links a{background:#173226!important;color:#80e7ae!important}
html[data-theme="dark"] .ahead{background:#15291e!important;color:var(--ink)!important}
html[data-theme="dark"] .bubble{background:var(--surface-2)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .chatbox{border-color:var(--line)!important}
html[data-theme="dark"] .payment-card.total-general{background:linear-gradient(145deg,#11271a,#173322)!important;border-color:#28513a!important}
html[data-theme="dark"] #transactions .payment-detail-line strong{color:#eef7f1!important}
html[data-theme="dark"] #transactions .payment-detail-line.balance{border-color:var(--line)!important}
html[data-theme="dark"] .film-stock-shell,
html[data-theme="dark"] .film-table-wrap,
html[data-theme="dark"] .film-editor,
html[data-theme="dark"] .inventory-shell,
html[data-theme="dark"] .stock-shell{background:var(--surface)!important;border-color:var(--line)!important;color:var(--ink)!important}
html[data-theme="dark"] .film-table tbody tr,html[data-theme="dark"] .inventory-table tbody tr{background:transparent!important}
html[data-theme="dark"] .film-duplicate-row{background:#2e2514!important}
html[data-theme="dark"] .backup-message-success{background:#122f20!important;color:#8ce9b4!important;border-color:#285a3e!important}
html[data-theme="dark"] .backup-message-error{background:#351a19!important;color:#ffaaa3!important;border-color:#6f3430!important}
html[data-theme="dark"] .settings-grid label,html[data-theme="dark"] .form label{color:var(--ink)!important}
html[data-theme="dark"] .logo-editor img{border-color:#31463a!important}
html[data-theme="dark"] .modalback{background:#020805c9!important}
html[data-theme="dark"] .close{background:#26362d!important;color:#fff!important}
html[data-theme="dark"] .empty,html[data-theme="dark"] small,html[data-theme="dark"] .backup-help{color:var(--muted)!important}
html[data-theme="dark"] a:not(.primary){color:#67dda0}
html[data-theme="dark"] .side{background:#071b11!important}
html[data-theme="dark"] .nav button.on,html[data-theme="dark"] .nav button:hover{background:#17452f!important}
html[data-theme="dark"] .v58-menu-button{background:#071b11!important}
html[data-theme="dark"] .login{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important;box-shadow:0 20px 60px rgba(0,0,0,.35)!important}
html[data-theme="dark"] body:has(.login){background:#09120d!important}
html[data-theme="dark"] .login input{background:#0e1913!important;color:#eef7f1!important}
html[data-theme="dark"] .divider{color:var(--muted)!important}
html[data-theme="dark"] .google{background:var(--surface-3)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] canvas{filter:none}

/* v5.18.7 — contraste integral da Central de Backup */
html[data-theme="dark"] .backup-download-panel,html[data-theme="dark"] .backup-install-panel,html[data-theme="dark"] .version-history-panel{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] .backup-section-title h2,html[data-theme="dark"] .backup-download-card b,html[data-theme="dark"] .backup-file-zone b,html[data-theme="dark"] .backup-check{color:#eef7f1!important}
html[data-theme="dark"] .backup-section-title>span,html[data-theme="dark"] .backup-card-icon{background:#173b29!important;color:#76e6a8!important}
html[data-theme="dark"] .backup-download-card{background:#15231b!important;color:#eef7f1!important;border-color:#2a4435!important}
html[data-theme="dark"] .backup-download-card small,html[data-theme="dark"] .backup-section-title p{color:#a8bbb0!important}
html[data-theme="dark"] .backup-auto-detect{background:#143222!important;border-color:#2d6848!important;color:#eef7f1!important}
html[data-theme="dark"] .backup-auto-detect b{color:#82edb2!important}html[data-theme="dark"] .backup-auto-detect small{color:#b2c7bb!important}
html[data-theme="dark"] .backup-file-zone{background:#101b15!important;border-color:#3eb277!important;color:#eef7f1!important}
html[data-theme="dark"] .backup-file-zone input[type=file]{background:#0d1712!important;color:#eef7f1!important;border-color:#30473a!important}
html[data-theme="dark"] .backup-file-zone input::file-selector-button{background:#1b422e!important;color:#9af1be!important}
html[data-theme="dark"] .backup-check{background:#14221a!important;border:1px solid #2b4034!important}
html[data-theme="dark"] .version-history-filter,html[data-theme="dark"] .version-history-item summary{background:#14221a!important;color:#eef7f1!important}
html[data-theme="dark"] .version-history-dropdown[open]>.version-history-filter,html[data-theme="dark"] .version-history-item[open] summary{background:#182a20!important}
html[data-theme="dark"] .version-history-filter b,html[data-theme="dark"] .version-history-copy>b{color:#79e6a9!important}
html[data-theme="dark"] .version-history-copy>span,html[data-theme="dark"] .version-history-details,html[data-theme="dark"] .version-history-details p{color:#e5f1e9!important}
html[data-theme="dark"] .version-history-details{background:#173024!important;border-color:#42bd7c!important}
html[data-theme="dark"] .version-history-action{background:#1a3b2a!important;color:#8cebb5!important;border-color:#32664a!important}
html[data-theme="dark"] .settings-visual-hero{background:linear-gradient(135deg,#063c24,#075f36 58%,#0d7b44)!important;color:#fff!important}
html[data-theme="dark"] .settings-visual-status>div{background:#14251b!important;border-color:#31523f!important;box-shadow:0 9px 24px rgba(0,0,0,.28)!important}
html[data-theme="dark"] .settings-visual-status span,html[data-theme="dark"] .settings-visual-status small{color:#a8bbb0!important}
html[data-theme="dark"] .settings-visual-status b{color:#80e7ad!important}
html[data-theme="dark"] .appearance-preview-panel{background:var(--surface)!important;color:var(--ink)!important;border-color:#18a460!important}
html[data-theme="dark"] .appearance-preview-copy h3{color:#eef7f1!important}
html[data-theme="dark"] .appearance-preview-copy p{color:#a8bbb0!important}
html[data-theme="dark"] .appearance-preview-copy>div b{background:#173b29!important;color:#86eab1!important}
html[data-theme="dark"] .settings-visual-status>div.status-ok{background:#142a1d!important;border-color:#2e7049!important}
html[data-theme="dark"] .settings-visual-status>div.status-warning{background:#2b2415!important;border-color:#785f2c!important}
html[data-theme="dark"] .settings-visual-status>div.status-danger{background:#2b1b1a!important;border-color:#75403c!important}
html[data-theme="dark"] .settings-visual-status>div.status-neutral{background:#1a261f!important;border-color:#3a4b41!important}
html[data-theme="dark"] .settings-visual-status>div.status-ok b{color:#80e7ad!important}
html[data-theme="dark"] .settings-visual-status>div.status-warning b{color:#ffd47a!important}
html[data-theme="dark"] .settings-visual-status>div.status-danger b{color:#ff9b94!important}
html[data-theme="dark"] .settings-visual-status>div.status-neutral b{color:#b1c1b8!important}

/* Controle de tema dentro de Configurações > Aparência */
#appearanceTheme{min-width:0}
.theme-setting-note{display:block;margin-top:5px;font-size:10px;font-weight:400;color:var(--muted)}

@media (prefers-color-scheme: dark){
  html[data-theme="auto"]{color-scheme:dark}
}
