.sn-theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--fg-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  padding: var(--s-2);
  min-height: 36px;
  min-width: 36px;
}
.sn-theme-toggle:hover {
  background: var(--bg-muted);
  color: var(--fg-strong);
}

/* Icon visibility: default = light mode → show moon (to switch to dark) */
.sn-theme-toggle .sn-ti-sun  { display: none; }
.sn-theme-toggle .sn-ti-moon { display: inline-flex; }

/* Explicit dark mode → show sun (to switch to light) */
:root[data-theme="dark"] .sn-theme-toggle .sn-ti-sun  { display: inline-flex; }
:root[data-theme="dark"] .sn-theme-toggle .sn-ti-moon { display: none; }

/* System preference dark + no explicit theme → show sun */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sn-theme-toggle .sn-ti-sun  { display: inline-flex; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sn-theme-toggle .sn-ti-moon { display: none; }
}

/* ============ WLT.A.01 — LogoBranded dual dark/light <img> toggle ============ */
/* <LogoBranded /> renders both variants (.sn-logo-light + .sn-logo-dark); CSS
   picks the visible one — same convention as the sun/moon icons above. */
.sn-logo-dark { display: none; }
:root[data-theme="dark"] .sn-logo-light { display: none; }
:root[data-theme="dark"] .sn-logo-dark  { display: inline-block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sn-logo-light { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .sn-logo-dark  { display: inline-block; }
}

/* ============ Utility — sn-hide-mobile (≤767px) ============ */
@media (max-width: 767px) {
  .sn-hide-mobile { display: none !important; }
}

/* ============ D1.5/D2.6 — Tablet: username truncation in header ============ */
@media (min-width: 768px) and (max-width: 1023px) {
  .sn-user-pill span.sn-hide-mobile {
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block;
  }
  /* #444/#453: ensure the user-pill itself doesn't overflow the header actions area */
  .sn-user-pill { max-width: 220px; min-width: 0; }
}

/* ============ D2.9 — Tablet sidebar: tooltip flyout for icon-only nav items ============ */
@media (min-width: 768px) and (max-width: 1023px) {
  .sn-nav-item { position: relative; }
  .sn-nav-label {
    display: block !important;
    position: absolute; left: 60px; top: 50%; transform: translateY(-50%);
    background: var(--fg-strong); color: var(--fg-on-dark);
    padding: 4px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap;
    margin-left: 4px; z-index: 200; pointer-events: none;
    opacity: 0; transition: opacity .12s;
  }
  .sn-nav-item:hover .sn-nav-label,
  .sn-nav-item:focus-within .sn-nav-label { opacity: 1; }
  .sn-nav-section { display: none; }
}

/* ============ #905 Onda2 (021B) — OpenConnection.UI.Notifications: NotificationBell (ADR 0017) ============
   Movido de wwwroot/notifications.css (nugets consumidores nao podem ter .css de app —
   so os nugets de tema sao isentos, DiagnosticIds.NoAppCssFile). Conteudo inalterado. */
.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background 0.15s;
}

.notif-bell-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: var(--white);
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--spoc-bg);
}

.notif-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 360px;
    max-width: calc(100vw - 1rem);
    background: var(--spoc-bg-card);
    border: 1px solid var(--spoc-border);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--spoc-border);
}

.notif-dropdown-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--spoc-text);
}

.notif-mark-all-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--spoc-primary);
    padding: 0;
}

.notif-mark-all-btn:hover { text-decoration: underline; }

.notif-dropdown-body {
    max-height: 360px;
    overflow-y: auto;
}

.notif-empty, .notif-loading {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--spoc-text-muted);
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--spoc-border);
    cursor: default;
    transition: background 0.12s;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--spoc-bg-hover); }
.notif-item--unread { background: var(--spoc-bg-unread); }
.notif-item--unread:hover { background: var(--spoc-bg-unread-hover); }

.notif-item-severity {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.notif-severity-info     { background: var(--info); }
.notif-severity-success  { background: var(--success); }
.notif-severity-warning  { background: var(--alert); }
.notif-severity-error    { background: var(--error); }
.notif-severity-critical { background: var(--critical); }

.notif-item-content { flex: 1; min-width: 0; }
.notif-item-title { font-size: 0.8125rem; font-weight: 500; color: var(--spoc-text); line-height: 1.4; }
.notif-item-body { font-size: 0.75rem; color: var(--spoc-text-muted); margin-top: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-item-meta { font-size: 0.6875rem; color: var(--spoc-text-muted); margin-top: 0.25rem; }

.notif-dropdown-footer {
    padding: 0.625rem 1rem;
    border-top: 1px solid var(--spoc-border);
    text-align: center;
}

.notif-prefs-link {
    font-size: 0.75rem;
    color: var(--spoc-primary);
    text-decoration: none;
}

.notif-prefs-link:hover { text-decoration: underline; }

/* ============ #905 Onda2 (021B) — OpenConnection.UI.DynamicForms: DynamicForm/DynamicField ============
   Movido de wwwroot/css/dynamic-forms.css (mesma regra acima). Conteudo inalterado. */
.df-form { display: flex; flex-direction: column; gap: var(--s-3); }
.df-label { font-size: 0.875rem; font-weight: 600; color: var(--fg-strong); margin-bottom: 4px; display: block; }
.df-input, .df-textarea, .df-select {
    width: 100%; border: 1px solid var(--border-soft);
    border-radius: var(--r-2); padding: 8px 12px;
    font-size: 0.875rem; color: var(--fg-strong);
    background: var(--bg-surface);
    transition: border-color 0.15s;
}
.df-input:focus, .df-textarea:focus, .df-select:focus {
    outline: none; border-color: var(--seg-primary);
}
.df-btn-submit {
    align-self: flex-end;
    background: var(--seg-primary); color: var(--fg-on-primary);
    border: none; border-radius: var(--r-2);
    padding: 8px 20px; font-size: 0.875rem; cursor: pointer;
    transition: opacity 0.15s;
}
.df-btn-submit:hover { opacity: 0.85; }
.df-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; cursor: pointer; }
