/**
 * Admin console contrast — surface-aware only.
 * Dark / cosmic canvas → light text & icons.
 * White / light panels → dark text & icons.
 * Does not change backgrounds, glass, or layout.
 */

/* Light panels (shared class list across admin/*.html) */
body.ios-theme.admin-console :is(
    .login-box,
    .token-box,
    .stat-card,
    .section,
    .admin-file-key-section,
    .browser-card,
    .data-table,
    .tab:not(.active),
    .tabs,
    .license-nav a,
    .admin-file-drop-zone,
    .notify-warn,
    .license-key,
    .empty-state,
    .form-group,
    .create-form,
    .modal-content,
    #admin-session-check,
    .admin-session-check
  ),
body.admin-console :is(
    .login-box,
    .token-box,
    .stat-card,
    .section,
    .admin-file-key-section,
    .browser-card,
    .data-table,
    .tab:not(.active),
    .tabs,
    .license-nav a,
    .admin-file-drop-zone,
    .notify-warn,
    .license-key,
    .empty-state,
    .form-group,
    .create-form,
    .modal-content,
    #admin-session-check,
    .admin-session-check
  ) {
  color: #1c1c1e;
}

body.ios-theme.admin-console :is(
    .login-box,
    .token-box,
    .stat-card,
    .section,
    .admin-file-key-section,
    .browser-card,
    .data-table,
    .tab:not(.active),
    .tabs,
    .license-nav a,
    .admin-file-drop-zone,
    .form-group,
    .create-form,
    .modal-content,
    #admin-session-check
  )
  :where(
    p,
    li,
    label,
    span,
    td,
    th,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    code,
    pre,
    small,
    dt,
    dd,
    .title,
    .desc,
    .label,
    .hint,
    .section-title,
    .browser-name,
    .admin-file-hint
  ),
body.admin-console :is(.login-box, .token-box, .stat-card, .section, .tabs)
  :where(p, li, label, span, td, th, h1, h2, h3, h4, h5, h6, code, .label) {
  color: #1c1c1e !important;
}

body.ios-theme.admin-console .stat-card .value:not(.green):not(.purple):not(.red):not(.blue):not(.yellow),
body.admin-console .stat-card .value {
  color: #1c1c1e !important;
}

body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .tabs, .token-box)
  :where(.muted, .hint, .stat-card .label, .col-subtitle),
body.admin-console :is(.login-box, .section, .stat-card) :where(.muted, .hint) {
  color: #636366 !important;
}

body.ios-theme.admin-console .tabs a,
body.admin-console .tabs a {
  color: #8e8e93 !important;
}
body.ios-theme.admin-console .tabs a.active,
body.admin-console .tabs a.active {
  color: #007aff !important;
}

body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .token-box, .form-group, .create-form, .admin-file-key-section, .data-table, .browser-card, .admin-file-drop-zone, .add-domain-row)
  :is(input, textarea, select),
body.admin-console :is(.login-box, .section, .stat-card, .token-box, .form-group)
  :is(input, textarea, select) {
  color: #1c1c1e !important;
  -webkit-text-fill-color: #1c1c1e !important;
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .form-group, .create-form)
  :is(input, textarea)::placeholder {
  color: #8e8e93 !important;
  -webkit-text-fill-color: #8e8e93 !important;
}
body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .tabs)
  select option {
  color: #1c1c1e;
  background: #fff;
}

body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .browser-card, .data-table, .tabs)
  :is(i.fas, i.far, i.fab, svg):not(:is(button, .btn, .tab.active) *),
body.admin-console :is(.login-box, .section, .stat-card)
  :is(i.fas, i.far, i.fab):not(:is(button, .btn) *) {
  color: inherit;
}

body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .tabs) a:not(:is(button, .btn)),
body.admin-console :is(.login-box, .section) a:not(:is(button, .btn)) {
  color: #007aff !important;
}
body.ios-theme.admin-console :is(.login-box, .section) a:not(:is(button, .btn)):hover {
  color: #ff9500 !important;
}

/* Buttons on light panels — keep light label on filled buttons */
body.ios-theme.admin-console :is(.login-box, .section, .stat-card, .create-form)
  :is(
    button,
    .btn,
    .btn-primary,
    .btn-create,
    .btn-on,
    .btn-off,
    .badge-coming-soon
  ),
body.admin-console :is(.login-box, .section) :is(button, .btn, .btn-primary) {
  color: #fff !important;
}
body.ios-theme.admin-console :is(.login-box, .section) :is(.btn-admin-secondary, .btn-download-login-file, .btn-admin-danger),
body.ios-theme.admin-console .logout-wrap :is(button, .btn-download-login-file) {
  color: inherit !important;
}

/* Dark admin bar */
body.ios-theme.admin-console .header,
body.admin-console .header {
  color: #fff !important;
}
body.ios-theme.admin-console .header :where(h1, h2, p, span, a:not(.logout-btn)),
body.admin-console .header :where(h1, h2, p, span, a:not(.logout-btn)) {
  color: rgba(255, 255, 255, 0.92) !important;
}
body.ios-theme.admin-console .header .logout-btn,
body.admin-console .header .logout-btn {
  color: #ff3b30 !important;
}
body.ios-theme.admin-console .header :is(i.fas, i.far, i.fab),
body.admin-console .header :is(i.fas, i.far, i.fab) {
  color: rgba(255, 255, 255, 0.88) !important;
}

/* Active tab (dark fill) */
body.ios-theme.admin-console .tab.active,
body.ios-theme.admin-console .tab.active * {
  color: #fff !important;
}

/* Cosmic / dark canvas between panels */
body.ios-theme.admin-console .dashboard,
body.ios-theme.admin-console .main,
body.ios-theme.admin-console .container {
  color: rgba(255, 255, 255, 0.92);
}
body.ios-theme.admin-console :is(.change-password-section, .reset-section, .admin-file-login-divider) {
  color: rgba(255, 255, 255, 0.88) !important;
}
body.ios-theme.admin-console :is(.change-password-section, .reset-section) h2 {
  color: rgba(255, 255, 255, 0.72) !important;
}
body.ios-theme.admin-console .dashboard > :where(h1, .subtitle, p),
body.ios-theme.admin-console .logout-wrap .btn-download-login-file {
  color: rgba(255, 255, 255, 0.92);
}
body.ios-theme.admin-console .logout-wrap button:not(.btn-download-login-file) {
  color: #fff !important;
}

/* Light panel wins over cosmic parent */
body.ios-theme.admin-console .main :is(.section, .stat-card, .login-box, .data-table, .browser-card, .tabs),
body.ios-theme.admin-console .dashboard :is(.stat-card, .admin-file-key-section, .login-box) {
  color: #1c1c1e;
}

body.ios-theme.admin-console .error,
body.ios-theme.admin-console .error-msg,
body.admin-console .error {
  color: #ff3b30 !important;
}

body.ios-theme.admin-console .notify-warn,
body.admin-console .notify-warn {
  color: #856404 !important;
}

/* Tables on white panels */
body.ios-theme.admin-console :is(.section, .main) table:not(.data-table) th {
  color: #636366 !important;
}
body.ios-theme.admin-console :is(.section, .data-table, .main) table td {
  color: #1c1c1e !important;
}
body.ios-theme.admin-console .data-table th {
  color: #fff !important;
}
body.ios-theme.admin-console :is(.section, .main) .action-btn {
  color: #8e8e93 !important;
}
body.ios-theme.admin-console :is(.section, .main) .action-btn:hover {
  color: #007aff !important;
}

/* Admin hub cards (Statistics, Extensions, licences, …) — glass on cosmic */
body.ios-theme.admin-console .dashboard .cards a.card,
body.ios-theme.admin-console .dashboard .cards a.card .title,
body.ios-theme.admin-console .dashboard .cards a.card .desc,
body.ios-theme.admin-console .dashboard .cards a.card span {
  color: rgba(255, 255, 255, 0.96) !important;
}
body.ios-theme.admin-console .dashboard .cards a.card > i.fas,
body.ios-theme.admin-console .dashboard .cards a.card > i.far,
body.ios-theme.admin-console .dashboard .cards a.card > i.fab {
  color: rgba(255, 255, 255, 0.9) !important;
}
body.ios-theme.admin-console .dashboard .cards a.card:hover .title,
body.ios-theme.admin-console .dashboard .cards a.card:hover .desc {
  color: #fff !important;
}
body.ios-theme.admin-console .dashboard .cards a.card:hover > i {
  color: var(--liquid-accent-1, #ff9500) !important;
}

/* admin-extensions.html — section titles on cosmic (Overview, Activity, …) */
body.ios-theme.admin-console.admin-ext-dashboard .main .section > .section-title,
body.ios-theme.admin-console.admin-ext-dashboard .main .section > .section-title span:first-child {
  color: rgba(255, 255, 255, 0.96) !important;
}
body.ios-theme.admin-console.admin-ext-dashboard .main .section > .section-title span:first-child {
  background: var(--liquid-accent-1, #ff9500) !important;
}

/* admin-licenses.html — “License by access” block (glass / cosmic) */
body.ios-theme.admin-console.admin-licenses-page #sec-by-access,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access h2,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access h2 i,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access .section-desc,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access .product-cb,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access .form-row label,
body.ios-theme.admin-console.admin-licenses-page #sec-by-access .form-row select {
  color: rgba(255, 255, 255, 0.96) !important;
}
body.ios-theme.admin-console.admin-licenses-page #sec-by-access .form-row input:not([type="checkbox"]) {
  color: #1c1c1e !important;
  -webkit-text-fill-color: #1c1c1e !important;
  background: #fff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}
body.ios-theme.admin-console.admin-licenses-page #sec-by-access select option {
  color: #1c1c1e;
  background: #fff;
}
