/* Central de Notificacoes (Fase 8): sino do topo + tela. Reaproveita .cu-cards/.cp-tabs/.tk-*, .badge e o modal .cm-modal. */

/* --- sino ------------------------------------------------------------------ */
.app-notif { position: relative; display: flex; align-items: center; margin-right: 10px; }
.app-notif-button { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--color-border); border-radius: 50%; background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.app-notif-button:hover { background: var(--color-surface-soft, #f3f6f8); }
.app-notif-button:focus-visible { outline: 3px solid var(--color-accent-ring, #7cc3c9); outline-offset: 2px; }
.app-notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.app-notif-badge.is-hidden { display: none; }
.app-notif-dropdown { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: min(380px, 94vw); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); overflow: hidden; }
.app-notif-dropdown.is-hidden { display: none; }
.app-notif-head, .app-notif-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; }
.app-notif-head { border-bottom: 1px solid var(--color-border); }
.app-notif-foot { border-top: 1px solid var(--color-border); justify-content: center; }
.app-notif-link { border: 0; background: none; color: var(--color-accent, #0e7c86); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.app-notif-link:hover { text-decoration: underline; }
.app-notif-list { max-height: min(60vh, 420px); overflow-y: auto; }
.app-notif-list .nt-item { border: 0; border-bottom: 1px solid var(--color-border); border-radius: 0; margin: 0; cursor: pointer; }
.app-notif-list .nt-empty { padding: 18px 14px; margin: 0; }

/* --- itens ------------------------------------------------------------------ */
.nt-list { display: grid; gap: 10px; margin: 8px 0 14px; }
.nt-item { position: relative; padding: 12px 14px 12px 20px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.nt-item.is-unread { background: #f1f9fa; border-color: #b6dde0; }
.nt-item.is-unread::before { content: ''; position: absolute; left: 8px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent, #0e7c86); }
.nt-item header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.nt-item header strong { font-size: 15px; }
.nt-time { color: var(--color-muted); font-size: 12px; white-space: nowrap; }
.nt-item p { margin: 6px 0 8px; font-size: 14px; overflow-wrap: anywhere; }
.nt-item footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nt-item footer small { color: var(--color-muted); }
.nt-actions { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.nt-empty { color: var(--color-muted); text-align: center; padding: 22px 8px; }
.nt-reason { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fff8e6; border: 1px solid #f5d9a0; color: #7a4a00; font-size: 13px; }
.nt-reason.is-hidden { display: none; }
.nt-body { font-size: 15px; margin: 0 0 10px; overflow-wrap: anywhere; }
.nt-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.nt-detail-card { width: min(720px, 96vw); max-height: 92vh; overflow-y: auto; }

/* --- preferencias e templates ------------------------------------------------------------------ */
.nt-pref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 8px 0; }
.nt-card { padding: 14px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); margin-bottom: 14px; }
.nt-card h4 { margin: 0 0 8px; }
.nt-checks { display: grid; gap: 6px; margin: 8px 0; }
.nt-check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.nt-pref-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.nt-pref-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--color-muted); }
.nt-table td { vertical-align: top; overflow-wrap: anywhere; }
.nt-actions-cell { white-space: nowrap; }

@media (max-width: 900px) {
  .app-notif { margin-right: 6px; }
  .app-notif-dropdown { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; }
  .nt-table thead { display: none; }
  .nt-table, .nt-table tbody, .nt-table tr, .nt-table td { display: block; width: 100%; }
  .nt-table tr { border: 1px solid var(--color-border); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; background: var(--color-surface); }
  .nt-table td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
  .nt-table td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-muted); text-align: left; flex: none; padding-top: 2px; }
  .nt-table td.nt-actions { justify-content: flex-end; flex-wrap: wrap; }
  .nt-table td.tk-empty { display: block; text-align: center; }
  .nt-table td.tk-empty::before { content: none; }
  .nt-detail-card { width: 100vw; max-height: 100vh; border-radius: 0; }
  .nt-actions { margin-left: 0; }
}
