/* EFORM v1.5 — responsif administrator dan preview poster */
html,
body {
    width: 100%;
    max-width: 100%;
}

.admin-shell,
.admin-main,
.admin-content,
.admin-content > *,
.dashboard-grid,
.editor-grid,
.qr-layout,
.stat-grid,
.card,
.card-header,
.card-body,
.table-wrap,
.filter-bar,
.form-group,
.form-control,
.form-select {
    min-width: 0;
}

.admin-main,
.admin-content,
.table-wrap {
    max-width: 100%;
}

.dashboard-grid > *,
.editor-grid > *,
.qr-layout > *,
.admin-users-grid > * {
    min-width: 0;
}

.table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.data-table td,
.data-table th,
.person-cell > div,
.topbar-left,
.page-title > div,
.card-header > div {
    min-width: 0;
}

.person-cell {
    min-width: 0;
    max-width: 100%;
}

.person-cell .muted,
.data-table td,
.page-title p,
.alert,
.form-help {
    overflow-wrap: anywhere;
}

.topbar-left strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-table-label {
    display: none;
}

@media (max-width: 820px) {
    .admin-content {
        padding: 18px 14px 28px;
    }

    .page-title {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }

    .page-title h1 {
        font-size: clamp(1.45rem, 6vw, 1.75rem);
    }

    .page-title > .gap {
        width: 100%;
    }

    .page-title > .gap .btn,
    .page-title > .btn {
        flex: 1 1 180px;
    }

    .admin-users-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .admin-users-grid > aside {
        width: 100%;
    }

    .card-header {
        padding: 16px;
        align-items: flex-start;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: 16px;
    }

    .filter-bar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 14px;
    }

    .filter-bar .form-group,
    .filter-bar .search,
    .filter-bar .form-filter {
        min-width: 0 !important;
        width: 100%;
    }

    .filter-bar > .btn {
        width: 100%;
    }

    .data-table.mobile-cards,
    .data-table.mobile-cards tbody,
    .data-table.mobile-cards tr {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .data-table.mobile-cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        clip-path: inset(50%);
    }

    .data-table.mobile-cards tbody tr {
        padding: 7px 0;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .data-table.mobile-cards tbody tr:last-child {
        border-bottom: 0;
    }

    .data-table.mobile-cards td {
        display: grid;
        grid-template-columns: minmax(105px, 32%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        width: 100%;
        padding: 9px 14px;
        border: 0;
        white-space: normal;
    }

    .data-table.mobile-cards td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .035em;
        line-height: 1.45;
        text-transform: uppercase;
    }

    .data-table.mobile-cards td[colspan] {
        display: block;
        padding: 0;
    }

    .data-table.mobile-cards td[colspan]::before,
    .data-table.mobile-cards td[data-label=""]::before {
        display: none;
    }

    .data-table.mobile-cards .person-cell {
        align-items: flex-start;
    }

    .data-table.mobile-cards td .gap {
        align-items: stretch;
    }

    .data-table.mobile-cards td .dropdown-menu {
        right: auto;
        left: 0;
        max-width: min(260px, calc(100vw - 56px));
    }

    .global-response-table {
        min-width: 0;
    }

    .form-poster-upload {
        padding: 14px;
    }

    .poster-upload-copy,
    .cover-preview,
    .cover-placeholder {
        min-width: 0;
        max-width: 100%;
    }

    .builder-head {
        flex-wrap: wrap;
    }

    .builder-title {
        min-width: calc(100% - 50px);
    }

    .builder-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 0 12px;
    }

    .topbar-user {
        gap: 8px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .admin-content {
        padding: 16px 10px 26px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 15px 16px;
    }

    .page-title > .gap {
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-title > .gap .btn,
    .page-title > .btn {
        width: 100%;
        flex-basis: auto;
    }

    .data-table.mobile-cards td {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 9px;
        padding-inline: 12px;
    }

    .data-table.mobile-cards td .gap {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .data-table.mobile-cards td .gap .btn,
    .data-table.mobile-cards td .gap form,
    .data-table.mobile-cards td .gap form .btn {
        width: 100%;
    }

    .form-cover-poster {
        max-height: 420px;
    }

    .form-cover-poster img {
        max-height: 420px;
    }
}

@media print {
    .data-table.mobile-cards {
        display: table;
    }

    .data-table.mobile-cards thead {
        position: static;
        width: auto;
        height: auto;
        clip: auto;
        clip-path: none;
    }

    .data-table.mobile-cards tbody {
        display: table-row-group;
    }

    .data-table.mobile-cards tr {
        display: table-row;
    }

    .data-table.mobile-cards td {
        display: table-cell;
    }

    .data-table.mobile-cards td::before {
        display: none;
    }
}
