/* Phase 2 area F7 styles — owned by agent F7. Workspace admin + upload (public/app/views/90-admin.js). */
.app[data-view="admin"] .view-admin { display: flex; }
/* app.css gives .view-performance `display:block !important` in every state, so it stacks above any
   view placed after it in the DOM. Hide it while the admin view is active. */
.app[data-view="admin"] .view-performance { display: none !important; }
.view.view-admin { overflow: auto; background: var(--bg); }
.view-admin [hidden] { display: none !important; }

.adm-page { padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 16px; min-height: 100%; box-sizing: border-box; color: var(--text); }
.adm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.adm-head h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.adm-sub { margin: 0; color: var(--text-2); font-size: 13px; }
.adm-head-actions { display: flex; gap: 8px; }

.adm-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.adm-body.adm-up-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .adm-body, .adm-body.adm-up-wide { grid-template-columns: minmax(0, 1fr); } }
.adm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-sizing: border-box; min-width: 0; }
.adm-card h2 { font-size: 15px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.adm-card-head p { margin: 6px 0 0; color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.adm-notice { color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.adm-upload { outline: none; }
.adm-upload.adm-flash { animation: admFlash 1.2s ease-out; }
@keyframes admFlash { 0% { box-shadow: 0 0 0 4px var(--brand-200); } 100% { box-shadow: 0 0 0 0 transparent; } }

.adm-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.adm-count { font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.adm-toggle { font-size: 12px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.adm-table th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.adm-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table .adm-num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-archived td { opacity: .6; }
.adm-actions { text-align: right; width: 1%; }
.adm-actions-in { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 150px; max-width: 290px; margin-left: auto; }
.adm-ws { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.adm-ws-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.adm-ws-sub { color: var(--text-3); font-size: 11.5px; margin-top: 2px; }
.adm-logo { width: 32px; height: 32px; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.adm-logo img { width: 100%; height: 100%; object-fit: contain; }
.adm-logo-initials { background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; border: 0; }
.adm-danger { color: var(--error-700); border-color: var(--error-200); }
.adm-danger:hover { background: var(--error-50); }
.adm-danger-solid { background: var(--error-500); color: #fff; border-color: var(--error-500); }
.adm-danger-solid:hover { background: var(--error-700); }
.adm-empty { padding: 28px 12px; text-align: center; color: var(--text-2); font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.adm-empty .adm-spin { margin: 0; }
.adm-error { color: var(--error-700); }
.adm-inline-err, .adm-form-err { color: var(--error-700); font-size: 12px; }
.adm-inline-err { margin-bottom: 8px; }
.adm-form-err:empty { display: none; }
.adm-hint { color: var(--text-3); font-size: 11.5px; margin: 4px 0 0; line-height: 1.4; }

.adm-spin { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--brand-200); border-top-color: var(--brand); border-radius: 50%; animation: admSpin .8s linear infinite; margin-right: 6px; vertical-align: -1px; }
@keyframes admSpin { to { transform: rotate(360deg); } }

/* upload form */
.adm-up-links { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 14px; }
.adm-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.adm-link:hover { color: var(--brand-700); }
#admUpForm, #admSettingsForm { display: flex; flex-direction: column; gap: 12px; }
.adm-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 12px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); cursor: pointer; text-align: center; }
.adm-drop:hover, .adm-drop.drag { border-color: var(--brand); background: var(--brand-50); }
.adm-drop.has-file { border-style: solid; border-color: var(--brand); }
.adm-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.adm-drop:focus-within { box-shadow: 0 0 0 3px var(--brand-200); }
.adm-drop-main { font-weight: 600; font-size: 13px; word-break: break-all; }
.adm-drop-sub { color: var(--text-3); font-size: 11.5px; }
.adm-target { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.adm-target legend { font-size: 11.5px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; padding: 0; }
.adm-target label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.adm-fields { display: flex; flex-direction: column; gap: 10px; }
.adm-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.adm-field > span { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.adm-field input, .adm-field select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.adm-field input:focus, .adm-field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-200); }
.adm-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; cursor: pointer; }
.adm-adv summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.adm-adv[open] { display: flex; flex-direction: column; gap: 10px; }
.adm-submit { justify-content: center; }

/* progress */
.adm-progress { display: flex; flex-direction: column; gap: 12px; }
.adm-progress-head { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.adm-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-step { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 5px 0; color: var(--text-3); }
.adm-step-label { flex: 1; }
.adm-step-ms { font-variant-numeric: tabular-nums; font-size: 11.5px; }
.adm-step-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); box-sizing: border-box; flex: none; position: relative; }
.adm-step[data-state="done"] { color: var(--text); }
.adm-step[data-state="done"] .adm-step-dot { background: var(--success-500); border-color: var(--success-500); }
.adm-step[data-state="done"] .adm-step-dot::after { content: ''; position: absolute; left: 3px; top: 0; width: 3px; height: 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.adm-step[data-state="running"] { color: var(--text); font-weight: 600; }
.adm-step[data-state="running"] .adm-step-dot { border-color: var(--brand-200); border-top-color: var(--brand); animation: admSpin .8s linear infinite; }
.adm-step[data-state="waiting"] { color: var(--text-2); }
.adm-step[data-state="waiting"] .adm-step-dot { border-color: var(--brand-200); border-style: dashed; }
.adm-step[data-state="failed"] { color: var(--error-700); font-weight: 600; }
.adm-step[data-state="failed"] .adm-step-dot { background: var(--error-500); border-color: var(--error-500); }
.adm-step[data-state="skipped"] { text-decoration: line-through; }
.adm-result { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.adm-result.ok { background: var(--success-50); border: 1px solid var(--success-200); }
.adm-result.bad { background: var(--error-50); border: 1px solid var(--error-200); color: var(--error-800); }
.adm-result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-sheets { display: flex; flex-wrap: wrap; gap: 6px; }
.adm-sheet { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.adm-sheet.has-err { border-color: var(--error-200); background: var(--error-50); }
.adm-err-n { color: var(--error-700); font-weight: 600; }
.adm-issues { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.adm-issue-table { table-layout: fixed; }
.adm-issue-table td, .adm-issue-table th { padding: 6px 8px; font-size: 12px; overflow-wrap: anywhere; }
.adm-issue-table th:nth-child(1) { width: 22%; } .adm-issue-table th:nth-child(2) { width: 13%; } .adm-issue-table th:nth-child(3) { width: 22%; } .adm-issue-table th:nth-child(5) { width: 16%; }
.adm-issue-table thead th { position: sticky; top: 0; background: var(--surface); }
.adm-issue-table code { font-size: 11.5px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; word-break: break-all; }
.adm-warn summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }

/* modal + toast */
.adm-scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 1200; }
.adm-modal { position: fixed; z-index: 1201; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: 0 20px 48px rgba(16, 24, 40, .22); }
.adm-modal[data-modal="guide"] { width: min(860px, calc(100vw - 32px)); }
.adm-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 8px; }
.adm-modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.adm-modal-body { padding: 8px 20px 12px; overflow: auto; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.adm-modal-body p { margin: 0; color: var(--text-2); line-height: 1.5; }
.adm-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.adm-modal-foot a.btn { text-decoration: none; }
.adm-x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.adm-x:hover { background: var(--surface-2); color: var(--text); }
.adm-member-add { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.adm-member-add .adm-field:first-child { flex: 1; min-width: 180px; }
.adm-guide { font-size: 13px; line-height: 1.55; }
.adm-guide h3, .adm-guide h4, .adm-guide h5 { margin: 16px 0 6px; font-weight: 600; }
.adm-guide h3 { font-size: 16px; } .adm-guide h4 { font-size: 14px; } .adm-guide h5 { font-size: 13px; }
.adm-guide p, .adm-guide ul, .adm-guide ol { margin: 0 0 8px; color: var(--text); }
.adm-guide pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; overflow: auto; font-size: 11.5px; }
.adm-guide code { font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.adm-guide blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--brand-200); color: var(--text-2); }
.adm-guide .adm-table { margin-bottom: 10px; }
.adm-toast { position: fixed; z-index: 1300; right: 24px; bottom: 64px; max-width: min(460px, calc(100vw - 48px)); display: flex; align-items: center; gap: 10px; background: var(--neutral-900); color: #fff; font-size: 13px; padding: 10px 12px 10px 16px; border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .25); }
.adm-toast[data-kind="error"] { background: var(--error-700); }
.adm-toast .btn { flex: none; }
.adm-toast .adm-x { color: #fff; opacity: .8; }

@media (max-width: 640px) {
  .adm-page { padding: 16px; }
}
