/* SHAKO panels 2026-11-09: Trash management, issue-on-behalf, live viewing, login polish.
 * Uses the existing design tokens (design-a.css): --brand, --line, --muted, --radius… Egypt = blue, International =
 * purple, same as the subscriber list and points badges. RTL-first; logical properties only. */
:root { --tm-egypt: #1764d8; --tm-egypt-bg: #eaf2ff; --tm-intl: #8a45d1; --tm-intl-bg: #f4ecfd;
  --tm-test: #0f7b5f; --tm-test-bg: #e6f6f0; --tm-review: #a15c00; --tm-review-bg: #fff4e0;
  --tm-danger: #c62f4b; --tm-danger-bg: #fdecef; }

/* ------------------------------------------------------------------------------------------- Trash */
.tm { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.tm > *, .tm-body, .tm-body > *, .tm-list > * { min-width: 0; }
.tm .table-wrap { overflow-x: auto; max-width: 100%; }
.tm-head h2 { margin: 0 0 4px; font-size: 1.35rem; }
.tm-muted { color: var(--muted, #6c6a86); }
.tm-muted.small, .tm .small { font-size: .82rem; }
.tm-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; background: var(--soft, #f9f8fd);
  border: 1px solid var(--line, #ebe9f4); border-radius: 14px; }
.tm-tab { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600;
  color: var(--muted, #6c6a86); cursor: pointer; }
.tm-tab:hover { color: var(--ink, #1c1a3a); background: #fff; }
.tm-tab.active { background: #fff; color: var(--brand, #5354df); box-shadow: 0 1px 3px rgba(28,26,58,.08); }
.tm-tab:focus-visible, .tm-panel-option:focus-visible, .issue-option:focus-visible { outline: 2px solid var(--brand, #5354df); outline-offset: 2px; }
.tm-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; align-items: end;
  padding: 14px; background: var(--panel, #fff); border: 1px solid var(--line, #ebe9f4); border-radius: var(--radius, 18px); }
.tm-filters label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted, #6c6a86); }
.tm-filters .tm-search { grid-column: span 2; }
.tm-filters .check { display: flex; gap: 6px; align-items: center; }
.tm-panel-pick { grid-column: span 2; display: grid; gap: 6px; }
.tm-panel-results { display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.tm-panel-option, .issue-option { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-align: start;
  padding: 8px 10px; border: 1px solid var(--line, #ebe9f4); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; }
.tm-panel-option:hover, .issue-option:hover, .issue-option[aria-selected="true"] { border-color: var(--brand, #5354df); background: var(--brand-50, #f1f1fe); }
.tm-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.tm-count { margin: 0; }
.tm-scope { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 12px; border-radius: 999px;
  background: var(--soft, #f9f8fd); border: 1px dashed var(--line-strong, #dddaf0); font-size: .88rem; }
.tm-scope.on { background: var(--brand-50, #f1f1fe); border: 1px solid var(--brand, #5354df); }
.tm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.link-button { border: 0; background: none; color: var(--brand, #5354df); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.button.danger { background: var(--tm-danger); border-color: var(--tm-danger); color: #fff; }
.button.danger:disabled { opacity: .45; }
.button.small { padding: 5px 10px; font-size: .82rem; }
.tm-danger { border: 1px solid #f3c7cf; border-radius: 14px; background: #fffafb; }
.tm-danger summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--tm-danger); }
.tm-danger-body { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.tm-danger-body p { flex-basis: 100%; margin: 4px 0 0; }
.tm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.tm-table th { position: sticky; top: 0; background: var(--soft, #f9f8fd); text-align: start; font-weight: 600;
  color: var(--muted, #6c6a86); padding: 10px 8px; border-bottom: 1px solid var(--line, #ebe9f4); white-space: nowrap; }
.tm-table td { padding: 10px 8px; border-bottom: 1px solid var(--line, #ebe9f4); vertical-align: top; }
.tm-table td small { display: block; margin-top: 2px; }
.tm-table tr.selected td { background: var(--brand-50, #f1f1fe); }
.tm-user { font-weight: 600; }
.tm-note { color: var(--muted, #6c6a86); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-row-actions { white-space: nowrap; }
.tm-row-actions .button + .button { margin-inline-start: 6px; }
.tm-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: var(--soft, #f3f2fa); color: var(--ink, #1c1a3a); border: 1px solid var(--line, #ebe9f4); white-space: nowrap; }
.tm-market-egypt { background: var(--tm-egypt-bg); color: var(--tm-egypt); border-color: #cfe0ff; }
.tm-market-worldwide { background: var(--tm-intl-bg); color: var(--tm-intl); border-color: #e4d2fa; }
.tm-test { background: var(--tm-test-bg); color: var(--tm-test); border-color: #bfe8d9; }
.tm-review { background: var(--tm-review-bg); color: var(--tm-review); border-color: #f5ddb0; }
.tm-real { background: #fff; color: var(--muted, #6c6a86); }
.tm-kind-admin { color: #3b3fbf; } .tm-kind-agent { color: #0e7490; } .tm-kind-reseller { color: #6b4fa1; }
.tm-blocked { color: var(--tm-review); font-size: .78rem; }
.tm-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.tm-empty { padding: 40px 16px; text-align: center; border: 1px dashed var(--line-strong, #dddaf0); border-radius: var(--radius, 18px); }
.tm-dialog { width: min(760px, calc(100vw - 32px)); }
.tm-dialog .tm-confirm { display: grid; gap: 12px; }
.tm-dialog h2 { margin: 0; }
.tm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tm-stats div { padding: 10px; border-radius: 12px; background: var(--soft, #f9f8fd); border: 1px solid var(--line, #ebe9f4); display: grid; gap: 2px; }
.tm-stats span { font-size: .78rem; color: var(--muted, #6c6a86); }
.tm-stats strong { font-size: 1.3rem; }
.tm-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tm-breakdown h3, .tm-dialog .notice h3 { font-size: .9rem; margin: 0 0 6px; }
.tm-breakdown ul, .tm-dialog .notice ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.tm-breakdown ul { list-style: none; padding: 0; }
.tm-dialog code { background: #fff3f5; color: var(--tm-danger); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.tm-dialog.tm-purge header h2 { color: var(--tm-danger); }
.notice.danger { background: var(--tm-danger-bg); border: 1px solid #f3c7cf; border-radius: 12px; padding: 10px 12px; }
.tm-runs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tm-run { padding: 14px; border: 1px solid var(--line, #ebe9f4); border-radius: var(--radius, 18px); background: #fff; display: grid; gap: 8px; }
.tm-run.active { border-color: var(--brand, #5354df); box-shadow: 0 0 0 3px var(--brand-50, #f1f1fe); }
.tm-run header { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tm-run p { margin: 0; }
.tm-run dl { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 0; }
.tm-run dt { font-size: .72rem; color: var(--muted, #6c6a86); }
.tm-run dd { margin: 0; font-weight: 700; }
.tm-run-items { margin-top: 12px; }
.tm-back { margin: 0 0 12px; }

/* ------------------------------------------------------------------------------- issuing panel */
.issue-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.issue-target-hint { font-size: .8rem; color: var(--muted, #6c6a86); }
.issue-notice.on-behalf { border-inline-start: 4px solid var(--orange, #e08a1e); }
.issue-notice p { margin: 4px 0 0; }
.issue-picker { width: min(560px, calc(100vw - 32px)); }
.issue-picker-form { display: grid; gap: 12px; }
.issue-picker-form header h2 { margin: 0 0 4px; }
.issue-picker-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.issue-option small { margin-inline-start: auto; color: var(--muted, #6c6a86); }

/* --------------------------------------------------------------------------------- live viewing */
[data-elapsed-since] { font-variant-numeric: tabular-nums; }
.sw-elapsed { display: inline-block; margin-inline-start: 6px; padding: 1px 7px; border-radius: 999px; font-size: .74rem;
  font-weight: 700; color: #0f7b5f; background: #e6f6f0; direction: ltr; }
.live-session-table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.live-session-table th, .live-session-table td { padding: 6px; border-bottom: 1px solid var(--line, #ebe9f4); text-align: start; }

@media (max-width: 720px) {
  .tm-filters .tm-search, .tm-panel-pick { grid-column: 1 / -1; }
  .tm-stats { grid-template-columns: repeat(2, 1fr); }
  .tm-table thead { display: none; }
  .tm-table, .tm-table tbody, .tm-table tr, .tm-table td { display: block; width: 100%; min-width: 0 !important; }
  .tm .table-wrap { overflow-x: visible; }
  .tm-table tr { border: 1px solid var(--line, #ebe9f4); border-radius: 14px; margin-bottom: 10px; padding: 6px; background: #fff; }
  .tm-table td { border: 0; padding: 4px 6px; }
  .tm-run dl { grid-template-columns: repeat(3, 1fr); }
}

/* ------------------------------------------------------------------------------------------- login */
html[data-design="a"] .login-panel { padding: 40px 36px; }
html[data-design="a"] .login-panel h1 { font-size: 1.75rem; margin: 2px 0 6px; letter-spacing: -.01em; }
html[data-design="a"] .login-panel .form-stack { gap: 14px; }
html[data-design="a"] .login-panel label { font-weight: 600; font-size: .9rem; color: var(--ink, #1c1a3a); }
html[data-design="a"] .login-panel input { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-strong, #dddaf0);
  padding-inline: 14px; font-size: 1rem; transition: border-color .15s, box-shadow .15s; background: #fff; }
html[data-design="a"] .login-panel input:focus { outline: none; border-color: var(--brand, #5354df);
  box-shadow: 0 0 0 4px var(--brand-50, #f1f1fe); }
html[data-design="a"] .login-panel .login-submit { min-height: 50px; border-radius: 12px; font-size: 1rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
html[data-design="a"] .login-panel .login-submit:disabled::before { content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: shako-spin .8s linear infinite; }
@keyframes shako-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { html[data-design="a"] .login-panel .login-submit:disabled::before { animation: none; } }
html[data-design="a"] .login-panel .form-error { background: var(--tm-danger-bg); color: var(--tm-danger); border: 1px solid #f3c7cf;
  border-radius: 10px; padding: 10px 12px; margin: 0; }
html[data-design="a"] .login-divider { display: flex; align-items: center; gap: 12px; color: var(--faint, #9a98b2); font-size: .85rem; margin: 4px 0; }
html[data-design="a"] .login-divider::before, html[data-design="a"] .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line, #ebe9f4); }
html[data-design="a"] .google-button-host { display: flex; justify-content: center; min-height: 44px; }
html[data-design="a"] .login-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; color: var(--side-text, #d7d6f5); }
html[data-design="a"] .login-points li { display: flex; gap: 10px; align-items: center; }
html[data-design="a"] .login-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #8f90ff; box-shadow: 0 0 0 4px rgba(143,144,255,.2); flex: none; }
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-inline-end: 48px !important; }
.password-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--muted, #6c6a86); font: inherit; font-size: .8rem; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.password-toggle:hover { color: var(--brand, #5354df); background: var(--brand-50, #f1f1fe); }
.password-toggle:focus-visible { outline: 2px solid var(--brand, #5354df); }
@media (max-width: 780px) { html[data-design="a"] .login-panel { padding: 28px 20px; } }

/* dialogs: solid card on a dimmed backdrop (the shared editor dialog is transparent) */
dialog.tm-dialog, dialog.issue-picker { border: 0; padding: 0; background: transparent; max-width: calc(100vw - 24px); }
dialog.tm-dialog > form, dialog.issue-picker > form { background: #fff; color: var(--ink, #1c1a3a); border-radius: 20px;
  padding: 22px; box-shadow: 0 24px 60px rgba(20,18,45,.28); max-height: calc(100vh - 48px); overflow: auto; }
dialog.tm-dialog::backdrop, dialog.issue-picker::backdrop { background: rgba(20,18,45,.5); }
.tm-confirm label { display: grid; gap: 6px; font-weight: 600; }
.tm-confirm label.check { display: flex; gap: 8px; align-items: center; }
.tm-confirm input[name=phrase] { min-height: 44px; border-radius: 10px; }
.tm-confirm .tm-scope-line { margin: 4px 0 0; }
.tm-pager select { width: auto; min-width: 80px; }
.tm-head p { margin: 0; }
