/* OMS brand on the left; search, notifications and account on the right. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#101723;
  --surface:#192333;
  --surface-soft:#202c3e;
  --surface-blue:#20324b;
  --text:#eef3fb;
  --text-soft:#b7c3d5;
  --text-muted:#97a8c0;
  --line:#344258;
  --line-strong:#485a73;
  --primary:#8db6ff;
  --primary-dark:#b0cbff;
  --primary-soft:#223959;
  --success:#75dfb0;
  --success-bg:#183e32;
  --warning:#ffce80;
  --warning-bg:#43331e;
  --danger:#ffaaa3;
  --danger-bg:#472b30;
  --shadow-sm:0 2px 8px rgba(0,0,0,.12);
  --shadow-md:0 16px 38px rgba(0,0,0,.3);
}
.ui-icon { width:20px; height:20px; flex:none; }
.topbar { background:var(--surface); }
.topbar-inner { gap:18px; padding:0 24px; }
.topbar .brand-logo { width:118px; }
.topbar .brand-lockup { margin-left:0; }
.topbar .nav { justify-content:flex-start; }
.topbar .nav-item>summary { color:var(--text); }
.topbar .nav-item>summary:hover,.topbar .nav-item[open]>summary { color:var(--primary); }
.dropdown { background:var(--surface); }
.dropdown a { color:var(--text-soft); }
.account-tools { display:flex; align-items:center; gap:7px; flex:none; margin-left:auto; }
.account-menu { position:relative; flex:none; z-index:60; }
.account-trigger { display:flex; align-items:center; gap:8px; padding:6px 8px; border:1px solid transparent; border-radius:999px; cursor:pointer; list-style:none; background:var(--surface-blue); color:var(--text); }
.account-trigger::-webkit-details-marker { display:none; }
.account-trigger:hover,.account-menu[open]>.account-trigger { background:var(--primary-soft); border-color:var(--line-strong); }
.account-avatar { width:32px; height:32px; border-radius:50%; display:inline-grid; place-items:center; flex:none; overflow:hidden; background:var(--primary-soft); color:var(--primary-dark); font-size:13px; font-weight:750; }
.account-avatar img { display:block; width:100%; height:100%; object-fit:cover; }
.account-first-name { max-width:105px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:600; }
.account-chevron { display:flex; color:var(--text-soft); }
.account-chevron .ui-icon { width:12px; height:12px; transform:rotate(90deg); }
.header-icon-button { display:grid; place-items:center; width:34px; height:34px; padding:6px; border:1px solid var(--line); background:var(--surface); color:var(--text-soft); border-radius:50%; }
.header-icon-button:disabled { cursor:default; opacity:.75; }
.account-dropdown { position:absolute; top:calc(100% + 10px); right:0; width:310px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 105px); overflow:auto; padding:10px; background:var(--surface); color:var(--text); border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow-md); }
.account-identity { display:grid; gap:5px; padding:13px 12px 17px; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.account-identity strong { font-size:14px; line-height:1.45; }
.account-identity>span { font-size:12px; line-height:1.5; color:var(--text-soft); }
.account-options { padding:7px 0; }
.account-option { display:flex; align-items:center; gap:12px; width:100%; min-height:46px; padding:11px 12px; margin:0; border:0; border-radius:8px; background:transparent; color:var(--text); text-align:left; text-decoration:none; font-size:13px; font-weight:500; cursor:pointer; }
.account-option>.ui-icon { width:19px; height:19px; color:var(--text-soft); }
.account-option>span:not(.theme-switch) { flex:1; }
.account-option:hover:not(:disabled) { background:var(--primary-soft); }
.account-option:disabled { color:var(--text-muted); cursor:default; }
.account-option>small { font-size:10px; color:var(--text-muted); white-space:nowrap; }
.account-theme-form,.account-logout { border-top:1px solid var(--line); padding-top:7px; margin:0; }
.account-theme-form { padding-bottom:7px; }
.account-theme-option>span>small { display:block; font-size:11px; font-weight:400; color:var(--text-soft); margin-top:3px; }
.theme-switch { width:34px; height:20px; border-radius:999px; background:var(--line-strong); position:relative; flex:none; transition:background .15s ease; }
.theme-switch:before { content:""; position:absolute; top:3px; left:3px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.15); transition:transform .15s ease; }
.account-theme-option[aria-checked="true"] .theme-switch { background:#2563eb; }
.account-theme-option[aria-checked="true"] .theme-switch:before { transform:translateX(14px); }
.account-theme-status { margin:4px 12px 8px; color:var(--danger); font-size:11px; line-height:1.5; }
.account-theme-status[hidden] { display:none; }

/* Settings index follows the reference's category list and option rows. */
.settings-page .page { padding:24px 32px 44px; max-width:1640px; }
.settings-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:10px; color:var(--text-soft); font-size:12px; line-height:1.5; margin-bottom:18px; }
.settings-breadcrumb a { color:var(--primary); text-decoration:none; }
.settings-breadcrumb a:hover { text-decoration:underline; }
.settings-breadcrumb h1 { color:var(--text); font-size:22px; margin:0; font-weight:650; letter-spacing:-.02em; }
.settings-banner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:18px; background:var(--surface-blue); border:1px solid var(--line); border-radius:8px; padding:17px 20px; margin-bottom:22px; }
.settings-banner h2 { font-size:14px; margin:0; }
.settings-search { display:flex; align-items:center; gap:8px; width:330px; max-width:100%; background:var(--surface); border:1px solid var(--line-strong); border-radius:6px; padding:8px 10px; color:var(--text-soft); }
.settings-search .ui-icon { width:16px; height:16px; }
.settings-search input { border:0; outline:none; background:transparent; color:var(--text); font-size:12px; width:100%; min-width:0; padding:0; }
.settings-search:focus-within { outline:2px solid var(--primary); outline-offset:2px; }
.settings-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:24px; align-items:start; }
.settings-sidebar { display:grid; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); overflow:hidden; }
.settings-sidebar>a { display:flex; align-items:center; gap:11px; min-height:41px; padding:8px 12px; color:var(--text-soft); text-decoration:none; font-size:12px; border-bottom:1px solid var(--line); }
.settings-sidebar>a:last-of-type { border-bottom:0; }
.settings-sidebar>a>span:nth-child(2) { flex:1; }
.settings-sidebar>a>.ui-icon { width:13px; height:13px; color:var(--text-muted); }
.settings-sidebar>a:hover { background:var(--surface-blue); color:var(--text); }
.settings-sidebar>a[aria-current="page"] { background:var(--primary-soft); color:var(--primary-dark); font-weight:700; box-shadow:inset 3px 0 var(--primary); }
.settings-icon { display:grid; place-items:center; width:25px; height:25px; border:1px solid var(--line-strong); border-radius:50%; flex:none; }
.settings-icon .ui-icon { width:15px; height:15px; }
.settings-sidebar>a[aria-current="page"] .settings-icon { border-color:var(--primary); color:var(--primary); }
.settings-content { min-width:0; padding:9px 0; }
.settings-content>h2 { margin:8px 0 14px; font-size:20px; letter-spacing:-.02em; }
.settings-description { font-size:13px; color:var(--text-soft); line-height:1.6; margin:0 0 18px; }
.settings-option-list { border-top:1px solid var(--line-strong); }
.settings-option { display:flex; align-items:center; gap:18px; padding:17px 12px; border-bottom:1px solid var(--line); text-decoration:none; }
.settings-option>div { flex:1; min-width:0; display:grid; gap:6px; }
.settings-option strong { font-size:13px; color:var(--primary); font-weight:600; }
.settings-option>div>span { font-size:12px; color:var(--text-soft); line-height:1.5; }
.settings-option>small { font-size:10px; color:var(--text-muted); }
.settings-option>.ui-icon { width:16px; height:16px; color:var(--text-soft); }
.settings-option:hover { background:var(--surface-blue); }
.settings-pending { padding:22px 12px; border-bottom:1px solid var(--line); }
.settings-pending>strong { font-size:13px; color:var(--text-soft); }
.settings-pending p { font-size:12px; line-height:1.6; color:var(--text-muted); margin:8px 0 0; }
.settings-no-results { padding:12px; margin:0; font-size:12px; color:var(--text-soft); }
.settings-sidebar [hidden] { display:none!important; }

/* User data and photographs are part of the existing management screen. */
.user-cell { display:flex; align-items:center; gap:11px; }
.user-account-panel { margin-bottom:18px; }
.user-account-panel>h2 { margin:0 0 20px; font-size:18px; }
.user-account-data { display:block; }
.user-photo-field { display:flex; align-items:center; gap:18px; min-width:0; padding:18px 20px; margin-bottom:24px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.account-avatar-large { width:72px; height:72px; font-size:25px; margin:0; }
.account-avatar-large .ui-icon { width:28px; height:28px; }
.user-photo-controls { display:grid; align-content:start; gap:7px; min-width:0; flex:1; }
.user-photo-controls>label { font-size:12px; line-height:18px; font-weight:650; }
.user-photo-field input[type="file"] { width:100%; max-width:460px; height:44px; padding:4px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); font:inherit; font-size:12px; color:var(--text-soft); }
.user-photo-field input::file-selector-button { height:34px; padding:0 12px; border:0; border-radius:5px; background:var(--surface-blue); color:var(--text); font:inherit; margin-right:10px; cursor:pointer; }
.user-photo-controls>small { font-size:11px; line-height:17px; color:var(--text-soft); }
.user-photo-field .user-photo-remove { display:flex; align-items:center; gap:7px; font-weight:400; font-size:11px; }
.user-data-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:22px 24px; }
.user-data-field { display:flex; flex-direction:column; align-items:stretch; gap:8px; min-width:0; }
.user-data-field>label,.user-data-field>span { font-size:12px; line-height:18px; font-weight:650; }
.user-data-field>input,.user-data-field>select,.user-login-value { box-sizing:border-box; display:block; flex:none; width:100%; min-width:0; height:44px; margin:0; padding:0 12px; border:1px solid var(--line-strong); border-radius:8px; background:var(--surface); color:var(--text); font:inherit; font-size:13px; line-height:20px; transition:border-color .15s ease,box-shadow .15s ease; }
.user-data-field>select { padding-right:32px; }
.user-login-value { line-height:42px; background:var(--surface-soft); color:var(--text-soft); overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.user-data-field>input:focus-visible,.user-data-field>select:focus-visible,.user-photo-field input:focus-visible { outline:0; border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-soft); }
.user-data-field>input:disabled,.user-data-field>select:disabled { background:var(--surface-soft); color:var(--text-soft); opacity:1; cursor:default; }
.user-data-field>input[aria-invalid="true"],.user-data-field>select[aria-invalid="true"] { border-color:var(--danger); }
.user-account-panel .errorlist { margin:0; padding:8px 0; list-style:none; font-size:12px; line-height:1.5; color:var(--danger); }
.user-data-field>small { font-size:11px; color:var(--text-soft); line-height:1.5; }
.user-management-actions,.profile-permission-actions,.manager-panel { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; }
.user-management-actions { justify-content:flex-end; }
.profile-unit-filter { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:24px; margin-bottom:18px; }
.profile-unit-filter .secondary-button { justify-self:start; }
.profile-permission-actions { margin:22px 0 12px; }
.profile-permission-actions h2,.manager-panel h2 { font-size:18px; margin:0; }
.permission-help,.profile-access-note,.profile-manager-hint { font-size:12px; color:var(--text-soft); line-height:1.7; }
.profile-access-note { padding:14px 18px; border:1px solid var(--line); border-radius:8px; background:var(--surface-blue); }
.profile-create-link { font-size:12px; margin:0; white-space:nowrap; }
.user-panel-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:22px; }
.user-panel-heading h2 { margin:0; font-size:18px; }
.user-access-footer { display:flex; align-items:center; flex-wrap:wrap; gap:14px 24px; padding-top:20px; margin-top:22px; border-top:1px solid var(--line); }
.user-access-footer .toggle-line { flex:none; margin:0; padding:0; font-size:13px; line-height:20px; white-space:nowrap; }
.user-access-footer p { flex:1; min-width:220px; margin:0; font-size:12px; line-height:1.7; }
.user-management-page .primary,.user-management-page .secondary-button { display:inline-flex; align-items:center; justify-content:center; min-height:44px; margin-top:0; padding:10px 16px; font-size:13px; line-height:20px; }
.user-management-page .hero h1 { font-size:28px; }
.user-management-page .hero>div { min-width:0; }
.user-management-page .hero h1 { overflow-wrap:anywhere; }
.user-management-page .hero>.primary,.user-management-page .hero>.secondary-button { flex:none; }
.user-management-page input[type="checkbox"] { width:17px; height:17px; flex:none; margin:0; accent-color:var(--primary); cursor:pointer; }
.user-management-page input[type="checkbox"]:disabled { cursor:default; }
.manager-panel { margin-top:22px; }
.manager-panel p { font-size:12px; color:var(--text-soft); line-height:1.6; margin:10px 0 0; }
.user-access-panel .errorlist,.user-data-field .errorlist { margin:0; padding:0; list-style:none; color:var(--danger); font-size:12px; line-height:1.6; }
.user-access-panel>.errorlist { margin-bottom:20px; }
.profile-permission-actions [hidden],.profile-manager-hint[hidden] { display:none; }

/* Legacy screens use the same theme palette, including tables and fields. */
[data-theme="dark"] .brand-logo { mix-blend-mode:screen; }
[data-theme="dark"] .brand-logo img { filter:grayscale(1) invert(1) brightness(2); }
[data-theme="dark"] .hero-home { background:linear-gradient(120deg,var(--surface) 0%,var(--surface) 58%,var(--surface-blue) 100%); }
[data-theme="dark"] .hero-side { background:var(--surface-blue); border-color:var(--line-strong); }
[data-theme="dark"] .primary { background:#2563eb; color:#fff; }
[data-theme="dark"] .primary:hover { background:#1d4ed8; }
[data-theme="dark"] .secondary-button,
[data-theme="dark"] .catalog-actions-panel,
[data-theme="dark"] .catalog-columns-dialog,
[data-theme="dark"] .columns-order button,
[data-theme="dark"] .sheet-value,
[data-theme="dark"] .system-map-summary>div { background:var(--surface); color:var(--text); }
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
[data-theme="dark"] select,[data-theme="dark"] textarea { background:var(--surface-soft); color:var(--text); border-color:var(--line-strong); }
[data-theme="dark"] .settings-search input { background:transparent; }
[data-theme="dark"] input::placeholder { color:var(--text-muted); opacity:1; }
[data-theme="dark"] .table-wrap th { background:var(--surface-soft); color:var(--text-soft); }
[data-theme="dark"] .table-wrap th,[data-theme="dark"] .table-wrap td { border-color:var(--line); }
[data-theme="dark"] .table-wrap tbody tr:hover,
[data-theme="dark"] .catalog-dense-table tr:hover td { background:var(--surface-blue); }
[data-theme="dark"] .status-hero h1,[data-theme="dark"] .status-leading strong { color:var(--text); }
[data-theme="dark"] .status.neutral,[data-theme="dark"] .status:not(.ok):not(.wait):not(.bad),
[data-theme="dark"] .resource-status.pendente { background:var(--surface-soft); color:var(--text-soft); }
[data-theme="dark"] .legend,[data-theme="dark"] .form-stack label,
[data-theme="dark"] .catalog-sidebar summary,[data-theme="dark"] .filter-field label,
[data-theme="dark"] .catalog-actions-panel h2,[data-theme="dark"] .sheet-source h2,
[data-theme="dark"] .columns-dialog-heading h2,[data-theme="dark"] .columns-order button,
[data-theme="dark"] .sheet-field>span,[data-theme="dark"] .sheet-tabs a,
[data-theme="dark"] .sheet-section>summary,[data-theme="dark"] .nav-submenu>summary { color:var(--text-soft); }
[data-theme="dark"] .product-link,[data-theme="dark"] .env-badge,
[data-theme="dark"] .source.bling,[data-theme="dark"] .alert.info,
[data-theme="dark"] .catalog-active-filters span,[data-theme="dark"] .columns-user-note { color:var(--primary); }
[data-theme="dark"] .columns-user-note { background:var(--primary-soft); }
[data-theme="dark"] .source.shared { background:#332856; color:#d0b7ff; }
[data-theme="dark"] .flow-step,[data-theme="dark"] .columns-options li,
[data-theme="dark"] .alert,[data-theme="dark"] .card:hover { border-color:var(--line); }
[data-theme="dark"] .integration-badge { background:var(--surface-soft); border-color:var(--line-strong); color:var(--text-soft); }
[data-theme="dark"] .integration-notice { background:var(--surface-soft); border-color:var(--line-strong); }
[data-theme="dark"] .integration-notice p { color:var(--text-soft); }
[data-theme="dark"] .usage-progress { background:var(--line); }

@media (max-width:1200px) {
  .topbar-inner { gap:10px; padding:0 16px; }
  .topbar .nav-item>summary { font-size:12px; padding:0 7px; }
  .topbar .brand-logo { width:100px; }
  .account-first-name { max-width:90px; font-size:12px; }
  .account-trigger { gap:6px; padding:5px 6px; }
  .account-tools { gap:5px; }
}
@media (max-width:1100px) {
  .topbar { height:auto; }
  .topbar-inner { min-height:72px; padding:10px 20px 0; flex-wrap:wrap; gap:4px 14px; }
  .topbar .nav { order:3; flex-basis:100%; width:100%; justify-content:flex-start; height:auto; min-height:44px; gap:0; flex-wrap:wrap; padding-bottom:5px; }
  .topbar .nav-item { height:40px; }
  .topbar .nav-item>summary { padding:0 10px; }
  .topbar .brand-logo { width:115px; }
  .catalog-sidebar { top:130px; max-height:calc(100dvh - 150px); }
  .sheet-heading { position:static; }
  .settings-layout { grid-template-columns:250px minmax(0,1fr); gap:20px; }
}
@media (max-width:720px) {
  .topbar-inner { padding:10px 16px 0; }
  .topbar .nav-item>summary { padding:0 8px; }
  .topbar .brand-logo { width:95px; }
  .header-icon-button { width:30px; height:30px; }
  .header-icon-button .ui-icon { width:17px; height:17px; }
  .account-trigger { padding:4px 6px; }
  .account-dropdown { width:300px; }
  .topbar .dropdown { top:158px; max-height:calc(100dvh - 180px); }
  .settings-page .page { padding:22px 18px 36px; }
  .settings-banner { padding:16px; gap:14px; }
  .settings-search { width:100%; }
  .settings-layout { grid-template-columns:1fr; gap:20px; }
  .settings-sidebar { max-height:245px; overflow-y:auto; }
  .settings-content { padding:0; }
  .user-data-grid { grid-template-columns:1fr; gap:16px; }
  .user-photo-field { padding:16px; gap:14px; align-items:flex-start; flex-wrap:wrap; }
  .user-photo-controls { flex-basis:100%; }
  .account-avatar-large { width:56px; height:56px; font-size:22px; }
  .user-photo-field input[type="file"] { font-size:11px; }
  .profile-unit-filter { grid-template-columns:1fr; gap:16px; }
  .profile-unit-filter .secondary-button { justify-self:stretch; }
  .user-access-footer { align-items:flex-start; }
  .settings-option { gap:10px; }
  .settings-option>small { max-width:100px; }
}
@media (max-width:370px) {
  .topbar-inner { padding:8px 12px 0; gap:4px 8px; }
  .topbar .brand-logo { width:80px; }
  .account-first-name { max-width:72px; }
  .account-trigger { gap:5px; }
  .account-tools { gap:4px; }
}
@media (prefers-reduced-motion:reduce) {
  .theme-switch,.theme-switch:before { transition:none; }
}
