/*
 * TAMS Super Admin Debug Reporter
 * RC1.10.18 - 僅在 super_admin 權限確認後顯示。
 */
.tams-debug-fab {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
    z-index: 2147482000;
    display: none;
    align-items: center;
    gap: .45rem;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: #8b1e2d;
    box-shadow: 0 10px 30px rgba(0,0,0,.24);
    font-weight: 700;
    cursor: pointer;
}
.tams-debug-fab.is-visible { display: inline-flex; }
.tams-debug-fab:disabled { opacity: .72; cursor: wait; }
.tams-debug-fab__icon { font-size: 1.15rem; line-height: 1; }
.tams-debug-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
    background: rgba(18, 22, 30, .72);
    backdrop-filter: blur(3px);
}
.tams-debug-overlay.is-open { display: flex; }
.tams-debug-panel {
    width: min(1180px, 96vw);
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.tams-debug-panel__header,
.tams-debug-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: #fff;
}
.tams-debug-panel__header { border-bottom: 1px solid #e9ecef; }
.tams-debug-panel__footer { border-top: 1px solid #e9ecef; justify-content: flex-end; flex-wrap: wrap; }
.tams-debug-panel__title { margin: 0; font-size: 1.05rem; font-weight: 800; color: #212529; }
.tams-debug-panel__subtitle { margin-top: .25rem; color: #6c757d; font-size: .82rem; }
.tams-debug-panel__body {
    overflow: auto;
    padding: 1rem 1.2rem 1.25rem;
    background: #f7f8fa;
}
.tams-debug-grid {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(360px, 1.35fr);
    gap: 1rem;
    align-items: start;
}
.tams-debug-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
}
.tams-debug-label { display: block; margin-bottom: .4rem; font-weight: 700; color: #343a40; }
.tams-debug-required { color: #dc3545; }
.tams-debug-input,
.tams-debug-textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: .65rem;
    padding: .65rem .75rem;
    font: inherit;
    color: #212529;
    background: #fff;
}
.tams-debug-input:focus,
.tams-debug-textarea:focus { outline: 0; border-color: #8b1e2d; box-shadow: 0 0 0 .2rem rgba(139,30,45,.13); }
.tams-debug-screenshot-wrap {
    min-height: 180px;
    border: 1px dashed #adb5bd;
    border-radius: 12px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tams-debug-screenshot-wrap img { width: 100%; height: auto; display: block; }
.tams-debug-screenshot-empty { padding: 2rem 1rem; text-align: center; color: #856404; }
.tams-debug-meta {
    margin-top: .9rem;
    padding: .75rem;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: .78rem;
    color: #495057;
    overflow-wrap: anywhere;
}
.tams-debug-meta div + div { margin-top: .28rem; }
.tams-debug-actions-inline { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.tams-debug-btn {
    border: 1px solid transparent;
    border-radius: .6rem;
    padding: .58rem .9rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.tams-debug-btn--primary { color:#fff; background:#8b1e2d; }
.tams-debug-btn--secondary { color:#343a40; background:#fff; border-color:#ced4da; }
.tams-debug-btn--dark { color:#fff; background:#343a40; }
.tams-debug-btn:disabled { opacity:.6; cursor:wait; }
.tams-debug-alert { margin-bottom: .8rem; padding: .7rem .85rem; border-radius: .6rem; background:#fff3cd; color:#664d03; font-size:.86rem; }
.tams-debug-note-shell .note-editor.note-frame { border: 1px solid #ced4da; border-radius: .65rem; overflow: hidden; }
.tams-debug-note-shell .note-toolbar { background: #f8f9fa; }
.tams-debug-note-shell .note-editable { min-height: 260px; background: #fff; color: #212529; }
@media (max-width: 850px) {
    .tams-debug-overlay { padding: 0; }
    .tams-debug-panel { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
    .tams-debug-grid { grid-template-columns: 1fr; }
    .tams-debug-fab { right: 12px; bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px)); min-width: 48px; justify-content: center; }
    .tams-debug-fab__label { display:none; }
}
