/* ---------- Gestão do clube: avisos ---------- */
.ann-banner-wrap { display: grid; gap: 8px; justify-items: start; }
.ann-banner { width: 100%; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 16px; border-radius: var(--r-lg); background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent); }
.ann-banner > svg { width: 22px; height: 22px; color: #b45309; margin-top: 2px; }
.ann-banner strong { display: block; }
.ann-banner p { margin: 2px 0 0; color: var(--text-2); white-space: pre-line; }
.ann-all { display: inline-flex; align-items: center; gap: 4px; }
.ann-all svg { width: 14px; height: 14px; }
.ann-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ann-item { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); position: relative; }
.ann-item header { display: flex; align-items: center; gap: 6px; padding-right: 150px; }
.ann-item header svg { width: 15px; height: 15px; color: #b45309; flex: none; }
.ann-item.is-pinned { box-shadow: inset 3px 0 0 #f59e0b; }
.ann-body { margin: 0; white-space: pre-line; }
.ann-tools { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; }
.ann-form .row { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- Atenção ---------- */
.att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.att-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border-left: 3px solid var(--border); }
.att-item svg { width: 18px; height: 18px; color: var(--text-2); }
.att-item.is-high { border-left-color: var(--danger, #dc2626); }
.att-item.is-high svg { color: var(--danger, #dc2626); }
.att-item.is-mid { border-left-color: #f59e0b; }
.att-item.is-mid svg { color: #d97706; }
.att-ok { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--success, #15803d); font-weight: 600; }
.att-ok svg { width: 18px; height: 18px; }

/* ---------- Tipos de membro e mensalidades ---------- */
.ms-types { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ms-types > li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.ms-types > li > span:last-child { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ms-type-form { display: grid; grid-template-columns: minmax(140px, 1.2fr) 110px 150px minmax(160px, 2fr) auto; gap: 8px; align-items: end; width: 100%; }
.ms-type-form .field { margin: 0; }
.ms-type-form .btn { align-self: end; }
.ms-type-form .error, .ms-type-form [role='alert'] { grid-column: 1 / -1; }
.ms-summary { color: var(--text-2); }
.ms-table-wrap { overflow-x: auto; }
.ms-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ms-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ms-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ms-table select { max-width: 160px; }
.ms-actions { text-align: right; white-space: nowrap; }
.ms-actions .link-btn { margin-left: 10px; }
.ms-actions .btn svg { width: 14px; height: 14px; }
.ms-status { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.ms-status.is-ok { background: color-mix(in srgb, #16a34a 15%, transparent); color: #15803d; }
.ms-status.is-due_soon { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.ms-status.is-late { background: color-mix(in srgb, #dc2626 14%, transparent); color: #b91c1c; }
.ms-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ms-history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); }
.ms-mine { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.ms-mine > svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.ms-mine > div { display: grid; gap: 4px; }
:root[data-theme='dark'] .ms-status.is-ok { color: #4ade80; }
:root[data-theme='dark'] .ms-status.is-due_soon { color: #fbbf24; }
:root[data-theme='dark'] .ms-status.is-late { color: #f87171; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ms-status.is-ok { color: #4ade80; }
  :root:not([data-theme='light']) .ms-status.is-due_soon { color: #fbbf24; }
  :root:not([data-theme='light']) .ms-status.is-late { color: #f87171; }
}
.member-dm { margin-left: auto; }
.member-dm + .actions { margin-left: 8px; }

@media (max-width: 760px) {
  .ms-type-form { grid-template-columns: 1fr 1fr; }
  .ms-type-form .ms-desc, .ms-type-form .btn { grid-column: 1 / -1; }
  .ms-table thead { display: none; }
  .ms-table, .ms-table tbody, .ms-table tr, .ms-table td { display: block; }
  .ms-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .ms-table td { padding: 0; border: 0; }
  .ms-table td:nth-child(1) { grid-column: 1 / -1; }
  .ms-actions { grid-column: 1 / -1; text-align: left; }
  .ann-item header { padding-right: 0; }
  .ann-tools { position: static; justify-self: start; }
  .ann-banner { grid-template-columns: auto minmax(0, 1fr); }
  .ann-banner .btn { grid-column: 2; justify-self: start; }
}

/* ---------- Mensagens diretas ---------- */
.rail-nav .badge { margin-left: auto; }
.topbar-dm { position: relative; }
.topbar-dm .badge { position: absolute; top: -2px; right: -4px; min-width: 16px; height: 16px; font-size: .65rem; padding: 0 4px; }
.dm-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: stretch; align-content: stretch; gap: 0; height: calc(100vh - 72px); min-height: 420px; max-height: 860px; padding: 0 !important; margin: 36px 40px 0; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.dm-list { border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.dm-list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 14px 10px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dm-list-head h1 { font-size: 1.25rem; margin: 0; }
.dm-list-head .btn svg { width: 14px; height: 14px; }
.dm-list ul { list-style: none; margin: 0; padding: 0 6px 8px; }
.dm-empty-list { padding: 0 14px; }
.dm-thread { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 8px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.dm-thread:hover { background: var(--surface-2); }
.dm-thread.is-active { background: var(--primary-soft); }
.dm-thread-text { display: grid; min-width: 0; }
.dm-thread-text small { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-thread.is-unread .dm-thread-text small { color: var(--text); font-weight: 600; }
.dm-thread-meta { display: grid; justify-items: end; gap: 4px; }
.dm-conv { height: 100%; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 0; min-width: 0; }
.dm-conv-empty { display: grid; place-items: center; grid-template-rows: none; }
.dm-conv-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dm-back { display: none; }
.dm-who { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.dm-who:hover strong { text-decoration: underline; }
.dm-msgs { overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.dm-hello { text-align: center; margin: auto 0; }
.dm-day { align-self: center; font-size: .75rem; color: var(--text-2); margin: 8px 0 2px; }
.dm-day::first-letter { text-transform: uppercase; }
.dm-msg { position: relative; max-width: min(75%, 520px); align-self: flex-start; padding: 8px 12px 6px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); }
.dm-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm-msg small { display: block; font-size: .7rem; color: var(--text-2); text-align: right; margin-top: 2px; }
.dm-msg.is-mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--primary); color: #fff; }
.dm-msg.is-mine small { color: rgba(255, 255, 255, .8); }
.dm-del { position: absolute; left: -30px; top: 50%; transform: translateY(-50%); opacity: 0; border: 0; background: none; color: var(--text-2); cursor: pointer; padding: 4px; }
.dm-del svg { width: 14px; height: 14px; }
.dm-msg:hover .dm-del, .dm-del:focus-visible { opacity: 1; }
.dm-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--border); }
.dm-compose textarea { flex: 1; resize: none; min-height: 40px; max-height: 140px; field-sizing: content; }
.dm-compose .btn svg { width: 18px; height: 18px; }
.dm-cant { padding: 12px 14px; margin: 0; border-top: 1px solid var(--border); }
.dm-contacts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; max-height: 320px; overflow-y: auto; }
.dm-contacts button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: var(--r-md); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.dm-contacts button:hover { background: var(--surface-2); }

@media (max-width: 860px) {
  .dm-page { grid-template-columns: 1fr; height: calc(100dvh - 150px); margin: 12px 0 0; border-radius: var(--r-md); }
  .dm-page.has-conv .dm-list { display: none; }
  .dm-page:not(.has-conv) .dm-conv { display: none; }
  .dm-back { display: inline-flex; }
  .dm-list { border-right: 0; }
  .dm-msg { max-width: 85%; }
  .dm-del { opacity: .6; left: -26px; }
}
