.text-danger { color: var(--danger-text); font-weight: 560; }
.danger-text { color: var(--danger-text); }
.danger-text:hover:not(:disabled) { color: var(--danger-text); }

.auth { background: var(--bg); }
.grid-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-prefs { position: absolute; top: var(--s4); right: var(--s4); display: flex; gap: var(--s1); z-index: 2; }
.auth-col { position: relative; z-index: 1; width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.auth-brand { display: flex; align-items: center; gap: var(--s3); }
.auth-mark { width: 40px; height: 40px; color: var(--accent); }
.auth-name { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.auth-promise { font-size: var(--fs-lg); color: var(--muted); text-align: center; margin-bottom: var(--s2); }
.auth-card { width: 100%; padding: var(--s6); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.auth-form { display: flex; flex-direction: column; gap: var(--s4); }
.auth-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
.auth-head h1 { font-size: var(--fs-xl); }
.auth-step-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent-text); margin-bottom: var(--s2); }
.auth-foot { font-size: var(--fs-xs); color: var(--faint); text-align: center; }
.totp-input { font-family: var(--font-mono); font-size: 20px; letter-spacing: .4em; text-align: center; height: 48px; }

.topbar .search { flex: 0 1 440px; }
.user-name { max-width: 160px; }
.brand-mobile { align-items: center; }
.brand-mobile .brand-mark { width: 26px; height: 26px; color: var(--accent); }
@media (max-width: 719px) {
  .topbar .search { display: none; }
  .topbar.searching .search { display: block; position: absolute; left: var(--s3); right: var(--s3); top: 10px; width: auto; z-index: 5; }
  .topbar.searching .search .kbd { display: none; }
  .user-name { display: none; }
}

.remaining { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-sm); }
.remaining strong { color: var(--text); font-size: var(--fs-lg); }
.queue-tbl .c-idx { width: 40px; text-align: right; padding-right: 0; }
.q-name { display: block; max-width: 260px; }
.q-mobile-phone { display: none; }
.queue-tbl td { white-space: nowrap; }
.queue-tbl td.q-owner { max-width: 160px; }
@media (max-width: 1279px) {
  .queue-tbl .q-last { display: none; }
}
@media (min-width: 1440px) and (min-height: 900px) {
  .page:has(> .today-split) { max-width: 1760px; display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h)); }
  .today-split { flex: 1; align-items: stretch; grid-template-columns: minmax(0, 1fr) minmax(340px, 22%); }
  .today-split > .stack:first-child > .card { flex: 1; }
}
@media (max-width: 1439px) {
  .queue-tbl .q-stage, .queue-tbl .q-phone { display: none; }
  .q-mobile-phone { display: block; }
  .q-name { max-width: 200px; }
}
@media (max-width: 719px) {
  .queue-tbl .q-owner, .queue-tbl .c-idx { display: none; }
  .q-name { max-width: none; }
}

.break-card .card-head h2 { display: inline-flex; align-items: center; gap: var(--s2); }
.break-body { display: flex; flex-direction: column; gap: var(--s4); }
.break-active { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-card); background: var(--warning-weak); flex-wrap: wrap; }
.break-type { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.break-countdown { font-size: 28px; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; }
.break-countdown.late { color: var(--danger-text); }
.break-cd-label { font-size: var(--fs-xs); color: var(--muted); }
.break-types { display: flex; flex-direction: column; gap: var(--s3); }
.break-type-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2) var(--s3); align-items: center; padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.break-type-row:last-child { border-bottom: 0; padding-bottom: 0; }
.break-type-name { font-weight: 600; }
.break-quota { font-size: var(--fs-sm); color: var(--muted); }
.break-reason { grid-column: 1 / -1; display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-xs); color: var(--muted); }
.break-reason .ico { margin-top: 1px; }
.break-now { border-top: 1px solid var(--border); padding-top: var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.break-now-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.break-now-list li { display: flex; justify-content: space-between; gap: var(--s3); min-width: 0; }
.breaks-solo { max-width: 460px; }

.filters-card { margin-bottom: var(--s4); }
.filters { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: var(--s3) var(--s4); }
.filters > .field { flex: 1 1 160px; min-width: 140px; max-width: 240px; }
.filters > .filter-q { flex: 2 1 260px; max-width: 420px; }
.filters > .filter-narrow { flex: 0 1 110px; min-width: 90px; }
.filter-clear { margin-left: auto; display: flex; gap: var(--s2); }
.filter-check { justify-content: flex-end; height: var(--ctl-h); flex-direction: row !important; align-items: center; }
.bulk { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.members-tbl td { white-space: nowrap; }
.members-tbl td:nth-child(2) { max-width: 240px; }
.members-tbl .m-owner { max-width: 160px; }
.pager-size { gap: 6px; font-size: var(--fs-sm); }
.pager-size .select { width: 72px; }
@media (max-width: 1279px) {
  .members-tbl .m-created, .members-tbl .m-next { display: none; }
}
@media (max-width: 719px) {
  .filters > .field, .filters > .filter-q { flex: 1 1 100%; max-width: none; }
  .filter-clear { margin-left: 0; width: 100%; }
  .filter-clear .btn { flex: 1; }
  .members-tbl .m-phone, .members-tbl .m-last, .members-tbl .m-owner, .members-tbl .m-fresh { display: none; }
  .page-actions .btn { flex: 1 1 auto; }
}

.assign-summary .alert-title { font-weight: 600; }
.assign-list summary { cursor: pointer; color: var(--accent-text); font-weight: 560; font-size: var(--fs-sm); }
.assign-list ul { margin: var(--s2) 0 0; padding-left: var(--s5); max-height: 180px; overflow-y: auto; font-size: var(--fs-sm); }
.imp-counts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.imp-table { max-height: 320px; overflow: auto; }
.imp-err { color: var(--danger-text); white-space: normal; min-width: 160px; }
@media (max-width: 719px) {
  .imp-table > .tbl, .imp-table > .tbl tbody { display: block; }
  .imp-table > .tbl thead { display: none; }
  .imp-table > .tbl tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  .imp-table > .tbl tbody tr:last-child { border-bottom: 0; }
  .imp-table > .tbl tr > td { height: auto; padding: 0; border-bottom: 0; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .imp-table > .tbl tr > td.imp-err { flex: 1 1 100%; min-width: 0; }
  .imp-table > .tbl tr > td:empty { display: none; }
  [aria-labelledby="br-title"] .tbl th, [aria-labelledby="br-title"] .tbl td { padding-left: var(--s2); padding-right: var(--s2); }
  [aria-labelledby="br-title"] .tbl td { white-space: normal; overflow-wrap: anywhere; }
  [aria-labelledby="br-title"] .tbl th { white-space: normal; }
  [aria-labelledby="br-title"] .br-planned { display: none; }
}
.file-input { padding: 5px var(--s2); height: auto; }

.member-back { margin: -4px 0 var(--s3) -8px; }
.member-head { padding: var(--s4) var(--s5); margin-bottom: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.mh-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); flex-wrap: wrap; }
.mh-id { display: flex; gap: var(--s3); align-items: center; min-width: 0; flex: 1 1 280px; }
.mh-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mh-title h1 { font-size: 22px; overflow-wrap: anywhere; }
.mh-sub { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; min-width: 0; }
.mh-phone { font-size: var(--fs-lg); font-weight: 560; }
.mh-badges { display: flex; gap: var(--s2); flex-wrap: wrap; }
.head-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3) var(--s5); margin: 0; padding-top: var(--s3); border-top: 1px solid var(--border); }
.hm { min-width: 0; }
.hm dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 560; margin-bottom: 2px; }
.hm dd { margin: 0; font-weight: 560; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 719px) { .head-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } .member-head { padding: var(--s4); } }

.contact-card { position: sticky; top: calc(var(--topbar-h) + var(--s3)); z-index: 5; }
@media (max-width: 1023px), (max-height: 820px) { .contact-card { position: static; } }
.contact-form { display: flex; flex-direction: column; gap: var(--s4); }
.cf-grid { gap: var(--s3) var(--s4); }
.custom-next { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 140px); gap: var(--s3); margin-top: var(--s2); }
.next-preview { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.next-field .chips { margin-top: 2px; }
.cf-keys { color: var(--muted); font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
@media (max-width: 719px) { .cf-keys { display: none; } .contact-form .form-actions .btn { width: 100%; } }

.tl-body { padding-top: var(--s2); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--s3); padding: var(--s3) 0; }
.tl-item::before { content: ""; position: absolute; left: 13.5px; top: 40px; bottom: -12px; width: 1px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); position: relative; z-index: 1; }
.tl-contact .tl-dot { background: var(--accent-weak); color: var(--accent-text); border-color: transparent; }
.tl-internal .tl-dot { background: var(--surface-2); color: var(--muted); }
.tl-deleted .tl-dot { background: var(--danger-weak); color: var(--danger-text); border-color: transparent; }
.tl-content { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tl-line { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; font-size: var(--fs-sm); }
.tl-actor { font-weight: 600; }
.tl-time { margin-left: auto; color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: var(--s2); }
.tl-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tl-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); padding: var(--s2) var(--s3); background: var(--surface-2); border-radius: var(--r-ctl); border: 1px solid var(--border); }
.tl-internal .tl-note { border-style: dashed; }
.tl-old { color: var(--muted); }
.tl-strike { text-decoration: line-through; color: var(--muted); }
.tl-reason { font-size: var(--fs-sm); }
.tl-deleted .tl-line span { color: var(--danger-text); }
.tl-versions summary { cursor: pointer; font-size: var(--fs-xs); color: var(--accent-text); font-weight: 560; }
.tl-versions ol { list-style: none; padding: 0; margin: var(--s2) 0 0; display: flex; flex-direction: column; gap: var(--s2); }
.tl-tools { display: flex; gap: 2px; margin-left: -8px; }

.profile-card .dl { grid-template-columns: minmax(90px, 38%) minmax(0, 1fr); }
.profile-form .field { gap: 4px; }
.server-val { color: var(--warning-text); }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.stat-tile { padding: var(--s4); }
.stat-tile.tone-danger .stat-value { color: var(--danger-text); }
.stat-tile.tone-warning .stat-value { color: var(--warning-text); }
@media (max-width: 719px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.team-tbl td { white-space: nowrap; }
.team-tbl td:first-child { min-width: 200px; }
@media (max-width: 719px) { .team-tbl.tbl td.c-num { text-align: left; } }
.stage-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); font-size: var(--fs-sm); }
.stage-bars .bar { border-radius: 4px; min-width: 2px; }
.bar.stage-new { background: var(--stage-3); }
.bar.stage-registered { background: var(--stage-4); }
.bar.stage-half_ftd, .bar.stage-ftd, .bar.stage-redeposit { background: var(--accent); }
.bar.stage-closed { background: var(--border-strong); }

.audit-filters > .field { max-width: 200px; }
.audit-tbl td { white-space: nowrap; }
.audit-tbl .au-reason { max-width: 240px; }
@media (max-width: 1279px) { .audit-tbl .au-reason { display: none; } }
@media (max-width: 719px) { .au-diff-label { display: none; } .audit-filters > .field { max-width: none; } .audit-tbl .au-at { color: var(--muted); font-size: var(--fs-xs); } }
.diff-tbl th[scope=row] { font-weight: 560; color: var(--muted); width: 28%; white-space: nowrap; }
.diff-cell { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 320px; }
.diff-changed .diff-cell.del { background: var(--danger-weak); color: var(--danger-text); }
.diff-changed .diff-cell.add { background: var(--success-weak); color: var(--success-text); }
.diff-same { color: var(--muted); }
.diff-raw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); }
.diff-pre { margin: 4px 0 0; padding: var(--s3); border-radius: var(--r-ctl); white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--fs-sm); }
.diff-pre.del { background: var(--danger-weak); }
.diff-pre.add { background: var(--success-weak); }

.users-tbl td { white-space: nowrap; }
.users-tbl td:first-child { min-width: 200px; max-width: 280px; }
.row-inactive td { color: var(--muted); }
@media (max-width: 1023px) { .users-tbl .u-perms, .users-tbl .u-online { display: none; } }
@media (max-width: 719px) { .users-tbl .u-perms, .users-tbl .u-online { display: block; } }
.perm-list { border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s3) var(--s4); margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3) var(--s5); }
.perm-list legend { padding: 0 var(--s1); }
.perm-list:disabled { opacity: .65; }
@media (max-width: 719px) { .perm-list { grid-template-columns: minmax(0, 1fr); } }
.perm-item { min-width: 0; }
.perm-text { display: flex; flex-direction: column; min-width: 0; }
.perm-label { font-weight: 560; }
.perm-key { font-size: 11px; }
.perm-desc { font-size: var(--fs-xs); }
.rules-form { max-width: 880px; }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }
.account-grid > :last-child { grid-column: 1 / -1; }
@media (max-width: 1023px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
.steps { margin: 0; padding-left: var(--s5); display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.otp-url { overflow-wrap: anywhere; }

.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-panel { position: relative; overflow: hidden; background: #0F1513; color: #E8EEEA; display: flex; padding: var(--s12) var(--s10); isolation: isolate; }
:root[data-theme="dark"] .auth-panel { background: #0A0F0D; border-right: 1px solid var(--border); }
.auth-panel::before { content: ""; position: absolute; inset: -20%; z-index: -2; background: radial-gradient(40% 50% at 20% 25%, rgba(52, 192, 138, .22), transparent 70%), radial-gradient(45% 45% at 85% 80%, rgba(227, 164, 58, .12), transparent 70%); animation: auth-glow 18s ease-in-out infinite alternate; will-change: transform; }
.auth-field { position: absolute; inset: -40px 0 0 -40px; z-index: -1; background-image: linear-gradient(rgba(232, 238, 234, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(232, 238, 234, .05) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: radial-gradient(80% 70% at 35% 40%, #000, transparent); mask-image: radial-gradient(80% 70% at 35% 40%, #000, transparent); animation: auth-drift 30s linear infinite; will-change: transform; }
.auth-panel-in { position: relative; display: flex; flex-direction: column; gap: var(--s10); width: min(520px, 100%); margin: auto; }
.auth-panel .auth-brand { display: flex; align-items: center; gap: var(--s3); }
.auth-panel .auth-mark { color: #34C08A; }
.auth-panel .auth-name { color: #F4F7F5; }
.auth-tag { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: #9DB5AA; margin-top: 2px; }
.auth-copy { display: flex; flex-direction: column; gap: var(--s4); }
.auth-panel .auth-promise { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; font-weight: 700; letter-spacing: -.025em; color: #F4F7F5; text-align: left; margin: 0; }
.auth-lead { font-size: var(--fs-lg); color: #B4C4BC; max-width: 44ch; margin: 0; }
.auth-values { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.auth-values li { display: flex; align-items: flex-start; gap: var(--s3); color: #DCE5E0; font-size: var(--fs-md); }
.auth-values .ico { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 999px; background: rgba(52, 192, 138, .16); color: #6FDCAE; }
.auth-queue-card { border: 1px solid rgba(232, 238, 234, .1); background: rgba(232, 238, 234, .035); border-radius: 12px; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); max-width: 360px; }
.auth-queue-head { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-xs); color: #9DB5AA; letter-spacing: .04em; text-transform: uppercase; }
.auth-live { width: 8px; height: 8px; border-radius: 999px; background: #34C08A; animation: auth-pulse 2.4s ease-in-out infinite; }
.auth-queue { display: flex; flex-direction: column; gap: 10px; }
.auth-qrow { display: flex; align-items: center; gap: var(--s3); }
.auth-qdot { flex: none; width: 8px; height: 8px; border-radius: 999px; background: #34C08A; opacity: .35; animation: auth-pulse 3s ease-in-out infinite; animation-delay: calc(var(--i) * .45s); }
.auth-qrow:nth-child(2) .auth-qdot, .auth-qrow:nth-child(5) .auth-qdot { background: #E3A43A; }
.auth-qbar { height: 8px; border-radius: 4px; background: rgba(232, 238, 234, .12); width: calc(92% - var(--i) * 11%); }
.auth-main { position: relative; display: grid; place-items: center; padding: var(--s12) var(--s6); }
.auth-split .auth-prefs { position: absolute; top: var(--s4); right: var(--s4); display: flex; align-items: center; gap: var(--s2); z-index: 2; }
.auth-lang-wrap { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.auth-lang-wrap .ico { position: absolute; left: 10px; pointer-events: none; }
.auth-lang { height: var(--ctl-h-sm); padding: 0 var(--s3) 0 30px; font-size: var(--fs-sm); width: auto; min-width: 0; cursor: pointer; background: var(--surface); color: var(--text); }
.auth-split .auth-col { position: relative; width: min(400px, 100%); display: flex; flex-direction: column; align-items: stretch; gap: var(--s4); }
.auth-split .auth-card { border-color: var(--border); box-shadow: 0 1px 2px rgba(21, 23, 26, .04), 0 12px 32px rgba(21, 23, 26, .06); }
.auth-split .auth-head h1 { font-size: var(--fs-2xl); letter-spacing: -.015em; }
@keyframes auth-drift { to { transform: translate3d(40px, 40px, 0); } }
@keyframes auth-glow { to { transform: translate3d(4%, 3%, 0) scale(1.06); } }
@keyframes auth-pulse { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }
@media (max-width: 899px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-panel { padding: var(--s12) var(--s4) var(--s6); }
  .auth-panel-in { gap: var(--s5); margin: 0; }
  .auth-queue-card { display: none; }
  .auth-panel .auth-promise { font-size: 28px; }
  .auth-lead { font-size: var(--fs-md); }
  .auth-main { padding: var(--s6) var(--s4) var(--s8); align-items: start; }
}
@media (max-width: 899px) {
  .auth-split { position: relative; }
  .auth-split .auth-prefs { position: absolute; top: var(--s3); right: var(--s4); }
  .auth-main { position: static; }
  .auth-split .auth-lang { background: rgba(255, 255, 255, .08); color: #E8EEEA; border-color: rgba(232, 238, 234, .2); }
  .auth-split .auth-lang-wrap { color: #B4C4BC; }
  .auth-split .auth-theme { color: #B4C4BC; }
  .auth-split .auth-theme:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #F4F7F5; }
  .auth-split .auth-lang option { color: #15171A; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel::before, .auth-field, .auth-qdot, .auth-live { animation: none; }
  .auth-qdot { opacity: .8; }
}
