/* Appearance follows the OS until the user explicitly selects light or dark. */
.theme-caption { font-size:12px; font-weight:600; color:var(--text); padding:0 7px; }
.theme-control { display:flex; align-items:center; gap:3px; padding:4px; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.theme-control button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:32px; height:30px; border:0; border-radius:6px; background:transparent; color:var(--muted); cursor:pointer; font-size:11px; padding:0 8px; }
.theme-control button .icon { width:16px; height:16px; }
.theme-control button:hover { color:var(--text); background:var(--purple-soft); }
.theme-control button[aria-pressed="true"] { color:#d9c6ff; background:#30253f; }
.login-theme { position:absolute; right:30px; top:24px; z-index:2; }
.login-premium { padding:88px 28px 40px; }
.login-premium .login-shell { min-height:700px; width:min(1100px,96vw); }
.login-premium .login-visual { padding:44px 48px; background:radial-gradient(ellipse at 0 10%,#76519144,transparent 65%),#17121e; }
.login-premium .login-logo { width:218px; height:auto; }
.login-premium .login-message { margin:48px 0 40px; }
.login-badge { display:inline-flex; align-items:center; gap:8px; font-size:9px; letter-spacing:1.5px; color:#d6b9f4; padding:8px 10px; border:1px solid #70598080; border-radius:7px; background:#b68cdd0a; }
.login-badge .icon { width:14px; height:14px; }
.login-premium .login-message h1 { font-size:46px; margin:25px 0 18px; }
.login-features { display:grid; gap:20px; margin-top:34px; }
.login-features>div { display:flex; gap:14px; align-items:center; }
.login-features>div>.icon { box-sizing:content-box; padding:10px; border:1px solid #584260; background:#2a2034; border-radius:10px; color:#d4b2f5; width:19px; height:19px; }
.login-features strong,.login-features small { display:block; }
.login-features strong { font-size:12px; color:#eadff5; font-weight:500; }
.login-features small { font-size:11px; color:#b6a8c3; margin-top:5px; }
.login-premium .login-proof { margin-top:auto; }.login-proof .icon { width:16px; height:16px; }
.login-premium .login-panel { padding:44px; }.login-premium .login-form-wrap { width:100%; max-width:348px; }
.login-welcome-icon { display:grid; place-items:center; width:48px; height:48px; margin-bottom:25px; border:1px solid var(--border-2); background:var(--purple-soft); color:var(--purple); border-radius:14px; }
.login-premium .login-form-wrap h2 { font-size:27px; margin:10px 0; }
.login-field label { display:block; margin-bottom:8px; }
.login-field .input-wrap { position:relative; }
.login-field .input-wrap>.icon { position:absolute; top:15px; left:13px; color:var(--muted); width:17px; height:17px; pointer-events:none; }
.login-field input { margin:0; height:48px; padding:0 42px; }
.password-toggle { position:absolute; right:5px; top:5px; width:38px; height:38px; border:0; border-radius:7px; background:transparent; color:var(--muted); cursor:pointer; display:grid; place-items:center; }
.password-toggle:hover { background:var(--purple-soft); color:var(--text); }
.login-premium .login-submit { height:48px; margin-top:5px; }
.login-assistance { font-size:11px; text-align:center; line-height:1.7; color:var(--muted); margin:24px 5px; }
.login-premium .login-foot { padding-top:24px; border-top:1px solid var(--border); font-size:10px; margin-top:25px; }.login-foot span { padding:0 5px; }
html[data-theme="light"] {
  color-scheme:light; --bg:#f5f5fa; --sidebar:#ffffff; --surface:#ffffff; --surface-2:#f0edf6;
  --surface-3:#e9e4f3; --border:#e1ddea; --border-2:#cfc6dd; --text:#292235;
  --muted:#6a6278; --muted-2:#776e84; --purple:#7251ae; --purple-2:#6842a8;
  --purple-soft:#7956b510; --green:#268261; --danger:#bb3359; --warning:#91601c;
}
html[data-theme="light"] body { background:var(--bg); color:var(--text); }
html[data-theme="light"] .sidebar { background:#fff; border-color:var(--border); }
html[data-theme="light"] .brand img,html[data-theme="light"] .mobile-login-logo img { background:#15101e; border-radius:12px; padding:8px; }
html[data-theme="light"] .sidebar-workspace { background:#f8f6fc; border-color:var(--border); }
html[data-theme="light"] .sidebar-workspace span,html[data-theme="light"] .nav-label { color:#79658d; }
html[data-theme="light"] .sidebar nav a { color:#655a73; }
html[data-theme="light"] .sidebar nav a:hover { background:#f5f1fa; color:#402457; }
html[data-theme="light"] .sidebar nav a.active { background:#eee6f8; color:#67359c; border-color:#dfd0ee; }
html[data-theme="light"] .nav-icon,html[data-theme="light"] .sidebar nav a.active .nav-icon { color:#8a65ad; }
html[data-theme="light"] .sidebar-footer { border-color:var(--border); }
html[data-theme="light"] .topbar { background:#ffffffed; border-color:var(--border); }
html[data-theme="light"] .breadcrumb span,html[data-theme="light"] .company-chip span { color:var(--muted); }
html[data-theme="light"] .breadcrumb strong,html[data-theme="light"] .user-copy strong { color:var(--text); }
html[data-theme="light"] .avatar,html[data-theme="light"] .company-avatar { background:#eee4f7; color:#724a96; border-color:#decaec; }
html[data-theme="light"] .mobile-menu,html[data-theme="light"] .icon-btn { color:#79608f; }
html[data-theme="light"] .icon-btn:hover { background:#eee6f8; border-color:var(--border); }
html[data-theme="light"] .eyebrow,html[data-theme="light"] .overline { color:#8153a6; }
html[data-theme="light"] .btn { background:#fff; border-color:#d8cde4; color:#50405f; box-shadow:0 2px 4px #30203c05; }
html[data-theme="light"] .btn:hover { background:#f3edf9; border-color:#af96c4; }
html[data-theme="light"] .btn.primary { background:#7951a8; border-color:#7951a8; color:#fff; }
html[data-theme="light"] .btn.primary:hover { background:#67418f; }
html[data-theme="light"] .context-banner { background:#f0eaf8; border-color:#dfd0eb; }
html[data-theme="light"] .context-icon,html[data-theme="light"] .metric-icon,html[data-theme="light"] .action-icon { background:#f0e7fa; border-color:#e0d0ee; color:#8757ae; }
html[data-theme="light"] .metric-card,html[data-theme="light"] .card,html[data-theme="light"] .panel { background:#fff; border-color:var(--border); box-shadow:0 4px 16px #49325804; }
html[data-theme="light"] .accent-card { background:linear-gradient(135deg,#eee7f6,#fff); }
html[data-theme="light"] .metric-label,html[data-theme="light"] .metric-card>small,html[data-theme="light"] .panel-note { color:#776881; }
html[data-theme="light"] .metric-card>strong.system-ok { color:var(--text); }
html[data-theme="light"] .metric-trend { background:#f9f7fb; border-color:#e1d8e8; color:#786487; }
html[data-theme="light"] .metric-trend.good { color:#287954; border-color:#b9dfcc; background:#eef8f2; }
html[data-theme="light"] .metric-trend.warning { color:#926017; border-color:#ebd6b3; background:#fff9ec; }
html[data-theme="light"] .metric-card:nth-child(2) .metric-icon { background:#fff5e4; border-color:#efd9b5; color:#9d712c; }
html[data-theme="light"] .metric-card:nth-child(3) .metric-icon { background:#eaf7f0; border-color:#c6e4d5; color:#358a67; }
html[data-theme="light"] .metric-card:nth-child(4) .metric-icon { background:#edf2fc; border-color:#cfdbf0; color:#627eaf; }
html[data-theme="light"] .action-grid>a { background:#fcfaff; border-color:#e7deed; }
html[data-theme="light"] .action-grid>a:hover { background:#f4edfb; border-color:#c4abdb; }
html[data-theme="light"] .action-grid small,html[data-theme="light"] .action-arrow .icon { color:#82708f; }
html[data-theme="light"] .panel-head>a,html[data-theme="light"] .text-link { color:#7a4f9f; }
html[data-theme="light"] .list-row,html[data-theme="light"] td { border-color:var(--border); }
html[data-theme="light"] .pill { color:#756181; border-color:#ddd1e5; background:#f9f5fc; }
html[data-theme="light"] .pill[data-status="SUJEITA"] { color:#724093; border-color:#dbc5ec; background:#f1e7fa; }
html[data-theme="light"] .pill[data-status="NAO_SUJEITA"] { color:#2b7554; border-color:#bfe0cd; background:#edf8f1; }
html[data-theme="light"] .pill[data-status="A_VERIFICAR"],html[data-theme="light"] .pill.warning { color:#91651d; border-color:#ead5ac; background:#fff8e9; }
html[data-theme="light"] .empty-state .empty-icon { background:#f3ebf9; border-color:#e1d3ec; color:#926db0; }
html[data-theme="light"] .search-field { background:#fff; border-color:#d8cde4; color:#9071a6; }
html[data-theme="light"] th { background:#f9f6fc; color:#826b92; }
html[data-theme="light"] tbody tr:hover { background:#faf6fe; }
html[data-theme="light"] .selected-row { background:#f3ecfb; }
html[data-theme="light"] .form-section { border-color:var(--border); }
html[data-theme="light"] .client-form label { color:#695575; }
html[data-theme="light"] .toolbar input,html[data-theme="light"] .toolbar select,html[data-theme="light"] .client-form input,html[data-theme="light"] .client-form select,html[data-theme="light"] .client-form textarea,html[data-theme="light"] .form-stack input { background:#fff; border-color:#d9cee4; color:#382b43; }
html[data-theme="light"] input::placeholder,html[data-theme="light"] textarea::placeholder { color:#8e8098; }
html[data-theme="light"] .field-help { color:#897391; }html[data-theme="light"] .field-error { color:#ba355c; }
html[data-theme="light"] .cnae-result { background:#faf6fe; border-color:#e0d2ec; }
html[data-theme="light"] .cnae-result p:not(.eyebrow),html[data-theme="light"] .cnae-result li,html[data-theme="light"] .cnae-result small { color:#776281; }
html[data-theme="light"] .form-actions { background:#ffffffed; }
html[data-theme="light"] .alert { background:#f5effa; color:#694480; }
html[data-theme="light"] .alert.danger { background:#fff0f2; border-color:#efc1ce; color:#a42c51; }
html[data-theme="light"] .alert.success { background:#edf8f1; border-color:#b9ddc8; color:#286844; }
html[data-theme="light"] .theme-control button[aria-pressed="true"] { background:#ece1f6; color:#714a96; }
html[data-theme="light"] .login-page { background:#f3eff8; }
html[data-theme="light"] .login-shell { border-color:#ded1e8; box-shadow:0 30px 90px #4b26631a; }
html[data-theme="light"] .login-panel { background:#fff; }
html[data-theme="light"] .form-stack label { color:#695575; }
html[data-theme="light"] .login-foot { color:#87738f; }
/* The branded left panel intentionally retains its own dark surface in both themes. */
@media(max-width:1050px) { .login-premium .login-visual { padding:36px; }.login-premium .login-message h1 { font-size:38px; } }
@media(max-width:820px) { .login-premium { padding:88px 16px 28px; }.login-premium .login-shell { width:100%; max-width:470px; min-height:0; }.login-premium .login-panel { padding:36px 30px; }.login-theme { right:20px; top:20px; }.mobile-login-logo img { height:auto; }.login-welcome-icon { display:none; }.top-actions { gap:8px; }.theme-control button { padding:0 6px; }.theme-control button span { display:none; }.theme-control button { min-width:29px; } }
@media(max-width:400px) { .login-premium .login-panel { padding:30px 23px; }.login-premium .login-form-wrap h2 { font-size:25px; }.topbar { padding:0 12px; }.user-menu { gap:4px; }.top-actions { gap:4px; }.breadcrumb strong { font-size:11px; max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } }

/* Keep the appearance controls discoverable, including narrow screens. */
.theme-control { flex-shrink:0; border-color:var(--border-2); }
.theme-control button span { display:inline; }
.theme-control button { min-height:34px; padding:0 9px; }
@media(max-width:1100px) and (min-width:821px) {
  .topbar .company-chip,.topbar .user-copy { display:none; }
}
@media(max-width:820px) {
  .topbar { height:auto; min-height:110px; padding-top:12px; padding-bottom:12px; flex-wrap:wrap; gap:12px; }
  .top-left { width:100%; }
  .top-actions { width:100%; justify-content:space-between; }
  .theme-control button { padding:0 7px; min-width:30px; gap:4px; }
  .theme-control button .icon { width:14px; height:14px; }
  .theme-caption { font-size:11px; padding:0 3px; }
  .theme-control { gap:1px; padding:3px; }
  .top-actions .avatar { display:none; }
}

/* Original INDRA logo: preserve artwork on a dark plate in either theme. */
.brand img,.mobile-login-logo img,.login-premium .login-logo { height:auto; object-fit:contain; }
html[data-theme="light"] .brand img,html[data-theme="light"] .mobile-login-logo img { content:normal; background:#17121e; border-radius:10px; padding:8px; }

.inline-form { display:inline-block; margin:3px; }
.toolbar label { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.toolbar input,.toolbar select { min-width:140px; }
.module-actions { display:flex; gap:8px; flex-wrap:wrap; margin:18px 0; }
.module-section { margin-top:24px; }
.print-only { display:none; }
@media print { .sidebar,.topbar,.btn,.theme-control,.toolbar,.inline-form,.skip-link { display:none!important; } .app-shell { display:block; } .content { padding:0; } body,.panel,.card,th,td { background:white!important;color:black!important; } .print-only { display:block; } }
