/* Користувачі організації, форми паролів. Токени і палітра з app.css; без градієнтів і свічення. */

.a-head { max-width: 72ch; }
.a-head .lead { max-width: none; }
.a-wrap { overflow: visible; } /* меню «Дії» випадає поза рамку таблиці: без прокрутки-обрізання */
.a-table { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--card); border: 1px solid var(--hair); }
.a-table th, .a-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--hair); }
.a-table thead th { border-top: 0; background: var(--raised); color: var(--ink2); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.a-table .mail { font-weight: 600; min-width: 13rem; overflow-wrap: anywhere; }
.a-table .num { white-space: nowrap; }
.a-table .you { color: var(--muted); font-weight: 400; font-size: .85rem; margin-left: 6px; }
.stack > .a-hint { max-width: 76ch; margin-top: 12px; }
/* «Стан»: бейдж не переноситься на другий рядок */
.a-table .badge { white-space: nowrap; }
.a-sub { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }

/* Меню «Дії»: details/summary, без JS працює як розкривний блок; Esc, клік поза меню і Tab назовні закривають (admin.js) */
.a-actcell { position: relative; white-space: nowrap; }
.a-menu { position: relative; display: inline-block; }
.a-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.a-menu > summary::-webkit-details-marker { display: none; }
.a-menu > summary .ic { margin: 0 0 0 6px; transition: transform .15s; }
.a-menu[open] > summary { background: var(--raised); border-color: var(--hair2); }
.a-menu[open] > summary .ic { transform: rotate(180deg); }
.a-menu-list { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; width: 19rem; max-width: calc(100vw - 32px); padding: 4px 0; white-space: normal; text-align: left;
  background: var(--card); color: var(--ink); border: 1px solid var(--hair2); border-radius: var(--radius); box-shadow: var(--paper-shadow); }
.a-menu-list form { margin: 0; }
.a-item { display: block; width: 100%; min-height: 44px; padding: 8px 14px; text-align: left; font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 0; cursor: pointer; }
.a-item b { display: block; font-weight: 600; }
.a-item small { display: block; margin-top: 1px; color: var(--muted); font-size: .82rem; line-height: 1.3; }
.a-item:hover, .a-item:focus-visible { background: var(--raised); }
.a-item:focus-visible { outline-offset: -3px; }
.a-danger b, .a-danger small { color: var(--hi-tx); }
.a-danger:hover, .a-danger:focus-visible { background: var(--hi-bg); }
.a-menu-list form + form.a-sep, .a-menu-list form:last-child:not(:first-child) { border-top: 1px solid var(--hair); }
.a-table select { font: inherit; font-size: .9rem; padding: 4px 6px; border: 1px solid var(--ctl); border-radius: var(--radius); background: var(--field); color: var(--ink); }
.btn-danger { color: var(--hi-tx); border-color: var(--hi-tx); }
.btn-danger:hover { background: var(--hi-bg); }

/* Додавання користувача */
.a-create { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; max-width: 760px; }
.a-create .btn-primary { justify-self: start; }
.field select { width: 100%; padding: 9px 11px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--ctl); border-radius: var(--radius); }

/* Попередження про пошту і одноразове посилання: колір + слово, не лише колір */
.warn { padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--md-tx); background: var(--md-bg); color: var(--md-tx); max-width: 760px; }
.warn strong { font-weight: 700; }
.a-link { border: 1px solid var(--accent); }
.a-link-row { display: flex; gap: 8px; align-items: stretch; margin: 10px 0 6px; }
.a-link-row input { flex: 1; min-width: 0; padding: 9px 11px; font-family: var(--mono); font-size: .86rem; color: var(--ink); background: var(--field); border: 1px solid var(--ctl); border-radius: var(--radius); }
.a-audit { margin: 0; padding: 0; list-style: none; font-size: .92rem; }
.a-audit li { padding: 6px 0; border-top: 1px solid var(--hair); display: flex; gap: 12px; flex-wrap: wrap; }
.a-audit li:first-child { border-top: 0; }
.a-audit .when { color: var(--muted); min-width: 10.5em; }

/* Форми паролів */
.pw-note { max-width: 46ch; }
.pw-links { margin-top: 16px; font-size: .95rem; }
.alert, .notice, .warn { max-width: 760px; }

@media (max-width: 720px) {
  .a-create { grid-template-columns: 1fr; }
  /* Таблиця користувачів стає списком карток: кожен рядок окремий блок із підписами полів */
  .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; }
  .a-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .a-table tr { border-top: 1px solid var(--hair2); padding: 8px 0; }
  .a-table tr:first-child { border-top: 0; }
  .a-table td { border: 0; padding: 4px 14px; }
  .a-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
  .a-table .mail { min-width: 0; }
  .a-link-row { flex-direction: column; }
  .a-actcell { padding-bottom: 8px; }
  .a-menu > summary { min-height: 44px; }
  .a-menu-list { right: auto; left: 0; }
}
