:root {
    --bg: #edf2f6;
    --bg-soft: #f7f9fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d7dde7;
    --line-soft: #edf1f6;
    --brand: #0aa37f;
    --brand-dark: #087a65;
    --brand-soft: #e8f7f2;
    --ink: #0b1220;
    --ok: #067647;
    --warn: #b54708;
    --bad: #b42318;
    --shadow: 0 14px 36px rgba(16, 24, 40, 0.07);
    --shadow-soft: 0 6px 18px rgba(16, 24, 40, 0.05);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #fbfcfd 0, var(--bg) 380px),
        var(--bg);
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover { color: var(--brand-dark); }

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(10, 163, 127, 0.12), transparent 360px),
        radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 320px);
    pointer-events: none;
}

.auth-card,
.panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.auth-card {
    position: relative;
    width: min(440px, 100%);
    padding: 32px;
}

.auth-logo {
    display: block;
    width: min(210px, 72%);
    margin: 0 auto 22px;
    border-radius: 18px;
}

.auth-card h1,
.page-title h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.1;
    letter-spacing: 0;
}

.auth-card p,
.page-title p {
    color: var(--muted);
    margin: 0 0 20px;
    line-height: 1.5;
}

.app-shell { min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    background: rgba(11, 18, 32, 0.96);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 18px;
}

.brand img {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(10, 163, 127, 0.28);
    object-fit: cover;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-toggle,
.nav-toggle-button {
    display: none;
}

.topbar a,
.topbar span {
    color: #d9e2f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
}

.topbar a:hover,
.topbar a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.topbar .user-name {
    color: #9fb0ca;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 44px;
}

.page-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.form-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-subgrid[hidden] {
    display: none;
}

.dashboard-account {
    margin-top: 16px;
}

.dashboard-metrics::before {
    display: none;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.usage-meter {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.usage-meter span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.usage-meter strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}

.usage-meter small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 700;
}

.progress {
    overflow: hidden;
    height: 10px;
    margin-top: 12px;
    border-radius: 999px;
    background: #e4eaf2;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 20px;
    min-height: 118px;
}

.stat::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: var(--brand-soft);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 10px;
    font-size: 32px;
    line-height: 1;
}

.stat-link {
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease;
}

.stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(5, 18, 32, .12);
}

.media-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
    padding: 22px;
    margin-bottom: 20px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 19px;
    letter-spacing: 0;
}

.tv-code-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.tv-code-field input {
    flex: 1;
    min-width: 0;
}

.qr-scan-button {
    white-space: nowrap;
    padding-left: 14px;
    padding-right: 14px;
}

.qr-scanner-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 10, 18, .72);
}

.qr-scanner-dialog {
    width: min(100%, 420px);
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
}

.qr-scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.qr-scanner-dialog video {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    background: #07111d;
    transform: scale(1.08);
    clip-path: inset(0 round 14px);
}

.qr-scanner-dialog p {
    margin: 12px 0 0;
    color: var(--muted);
}

.pwa-install-banner {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 980;
    width: min(440px, calc(100% - 36px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(10, 163, 127, .20);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 24px 58px rgba(5, 18, 32, .20);
}

.pwa-install-banner strong,
.pwa-install-banner span {
    display: block;
}

.pwa-install-banner strong {
    color: var(--ink);
    font-size: 15px;
}

.pwa-install-banner span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
}

.pwa-install-actions .button {
    min-height: 38px;
    padding: 0 13px;
    white-space: nowrap;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.section-heading p {
    margin-top: 4px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: 0; }

.table th {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .06em;
    background: var(--bg-soft);
}

.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table tbody tr:hover { background: #fbfcff; }

.report-media-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.report-media-preview {
    position: relative;
    display: grid;
    place-items: center;
    width: 92px;
    aspect-ratio: 16 / 9;
    flex: 0 0 92px;
    overflow: hidden;
    border-radius: 8px;
    background: #07111d;
    border: 1px solid var(--border);
    text-decoration: none;
}

.report-media-preview img,
.report-media-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.report-media-preview span {
    position: absolute;
    inset: auto 6px 6px;
    border-radius: 999px;
    background: rgba(7, 17, 29, .78);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    padding: 3px 6px;
}

.collapsible-create summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}

.collapsible-create summary::-webkit-details-marker {
    display: none;
}

.collapsible-create summary h2 {
    margin: 0 0 6px;
}

.collapsible-create summary .muted {
    margin: 0;
}

.collapsible-create-body {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.table .table-group td {
    background: #eef7f4;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.table .table-group:hover {
    background: transparent;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: #eef2f6;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.badge.online { color: var(--ok); background: #dcfae6; }
.badge.offline { color: var(--bad); background: #fee4e2; }
.badge.pending { color: var(--warn); background: #fef0c7; }

.badge.draft { color: var(--warn); background: #fef0c7; }
.badge.published { color: var(--ok); background: #dcfae6; }
.badge.inactive { color: var(--muted); background: #eef2f6; }

.form-section {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--bg-soft);
}

.form-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.form-section-title h3 {
    margin: 0;
    font-size: 15px;
    color: var(--ink);
}

.form-section-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.form-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -4px 0 18px;
}

.page-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-weight: 800;
    font-size: 13px;
}

.page-tabs a:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.summary-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, var(--bg-soft));
}

.summary-card strong {
    font-size: 20px;
}

.form {
    display: grid;
    gap: 14px;
}

.form.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form .span-two {
    grid-column: 1 / -1;
}

.form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
    font-size: 13px;
    color: #344054;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0 12px;
    font: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form input,
.form select {
    height: 44px;
}

.form textarea {
    min-height: 128px;
    padding: 12px;
    resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(10, 163, 127, 0.13);
}

.form input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.check-line {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 10px !important;
}

.check-line input {
    width: 18px !important;
    height: 18px !important;
}

.switch-field {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px !important;
    min-height: 52px;
    padding: 11px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--bg-soft);
}

.switch-field span {
    min-width: 0;
    color: #344054;
    line-height: 1.25;
}

.switch-field input[type="checkbox"] {
    position: relative;
    flex: 0 0 auto;
    width: 76px !important;
    height: 34px !important;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    cursor: pointer;
    background: #d0d5dd;
    box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.08);
    transition: background .18s ease, box-shadow .18s ease;
}

.switch-field input[type="checkbox"]::before {
    content: "OFF";
    position: absolute;
    top: 4px;
    left: 4px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 2px 7px rgba(16, 24, 40, 0.18);
    transition: transform .18s ease, color .18s ease;
}

.switch-field input[type="checkbox"]:checked {
    background: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(8, 122, 101, 0.24);
}

.switch-field input[type="checkbox"]:checked::before {
    content: "ON";
    transform: translateX(30px);
    color: var(--brand-dark);
}

.switch-field input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(10, 163, 127, 0.16);
}

.file-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f8fafc);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.file-control:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(10, 163, 127, 0.08);
}

.file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 9px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.file-name {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.button:disabled {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
    box-shadow: none;
}

.button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(10, 163, 127, 0.18);
}

.button.primary:hover { background: var(--brand-dark); }

.tv-code-field input {
    min-height: 48px;
    font-size: 15px;
}

.button.qr-scan-button {
    min-height: 48px;
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}

.button.qr-scan-button:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .24);
}

.button.danger {
    border-color: #fecdca;
    background: #fff;
    color: var(--bad);
}

.button.danger:hover { background: #fff5f5; }

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions form { margin: 0; }

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form select {
    min-width: 190px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 10px;
    color: var(--text);
    background: #fff;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.link-list a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.check-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.campaign-device-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.campaign-device-grid label {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 10px;
    row-gap: 3px;
    min-height: 72px;
    padding: 10px 12px;
}

.campaign-device-grid input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
}

.campaign-device-grid span,
.campaign-device-grid small {
    grid-column: 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.campaign-device-grid span {
    line-height: 1.3;
}

.campaign-device-grid small {
    line-height: 1.25;
}

.multi-picker-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.multi-picker-summary div {
    min-width: 0;
}

.multi-picker-summary p {
    margin: 4px 0 0;
}

.multi-picker-dialog {
    width: min(820px, 100%);
    max-height: min(90vh, 760px);
    overflow: auto;
}

.multi-picker-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 10px;
    margin: 16px 0 12px;
}

.multi-picker-toolbar input,
.multi-picker-toolbar select {
    width: 100%;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 0 12px;
    font: inherit;
    background: #fff;
}

.multi-picker-tools,
.multi-picker-footer {
    display: flex;
    align-items: center;
    gap: 9px;
}

.multi-picker-tools {
    justify-content: space-between;
    margin-bottom: 12px;
}

.multi-picker-tools > div,
.multi-picker-footer {
    display: flex;
    gap: 8px;
}

.multi-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(48vh, 420px);
    padding: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.multi-picker-grid label {
    min-width: 0;
}

.multi-picker-grid input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    margin: 0;
    padding: 0;
}

.multi-picker-footer {
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 14px;
    border-top: 1px solid var(--line-soft);
}

body.modal-open {
    overflow: hidden;
}


.alert {
    border-radius: 12px;
    padding: 13px 15px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-weight: 700;
}

.alert.success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: var(--ok);
}

.alert.error {
    background: #fef3f2;
    border-color: #fecdca;
    color: var(--bad);
}

.alert.warning {
    background: #fffaeb;
    border-color: #fedf89;
    color: var(--warn);
}

.alert.info {
    background: #eef7ff;
    border-color: #b9dcff;
    color: #175cd3;
}

.delegation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.delegation-banner div {
    display: grid;
    gap: 3px;
}

.delegation-banner span {
    font-weight: 600;
}

.delegation-banner .button {
    flex: 0 0 auto;
    border-color: #175cd3;
    color: #175cd3;
}

.readonly-banner a {
    color: var(--warn);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.support-whatsapp {
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 60;
    display: grid;
    gap: 2px;
    min-width: 220px;
    padding: 13px 16px;
    border-radius: 12px;
    color: #f7fffb;
    background: #128c62;
    box-shadow: 0 18px 42px rgba(18, 140, 98, 0.28);
}

.support-whatsapp::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .24);
    pointer-events: none;
}

.support-whatsapp span {
    font-size: 12px;
    font-weight: 800;
    opacity: .82;
    text-transform: uppercase;
}

.support-whatsapp strong {
    font-size: 15px;
}

.is-readonly .readonly-disabled-form {
    opacity: 0.62;
}

.is-readonly .readonly-disabled-form button,
.is-readonly .readonly-disabled-form .file-button,
.disabled-link {
    cursor: not-allowed;
}

.disabled-link {
    opacity: 0.55;
    pointer-events: none;
}

.muted { color: var(--muted); }

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.videowall-config {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: end;
}

.videowall-config .alert {
    margin: 0;
}

.form input[readonly] {
    background: var(--bg-soft);
    color: var(--muted);
    cursor: default;
}

.portrait-media-guide {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(210px, .5fr);
    gap: 22px;
    align-items: center;
    padding: 20px;
    border: 1px solid #f2c94c;
    border-left: 5px solid #e5a900;
    border-radius: 10px;
    background: #fffaf0;
}

.portrait-media-guide[hidden] {
    display: none;
}

.portrait-guide-copy h3,
.portrait-help-option h3 {
    margin: 5px 0 8px;
    font-size: 18px;
}

.portrait-guide-copy p {
    margin: 0 0 14px;
    color: var(--muted);
    line-height: 1.55;
}

.portrait-guide-copy label {
    max-width: 380px;
}

.portrait-guide-result {
    margin-top: 12px !important;
    color: var(--ink) !important;
}

.portrait-rotation-demo {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    color: var(--ink);
}

.rotation-screen {
    display: grid;
    place-items: center;
    width: 168px;
    height: 112px;
    border: 5px solid #162033;
    border-radius: 7px;
    background: #07111d;
    box-shadow: 0 10px 24px rgba(16, 24, 40, .16);
}

.rotation-media {
    display: grid;
    place-items: center;
    width: 68px;
    height: 100px;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 4px;
    color: #fff;
    background: linear-gradient(145deg, #54c96d, #00a99d);
    transform-origin: center;
}

.rotation-media span {
    font-size: 12px;
    font-weight: 900;
}

.rotation-media small {
    color: rgba(255, 255, 255, .82);
    font-weight: 800;
}

.portrait-rotation-demo[data-media-rotation="left"] .rotation-media {
    animation: rotate-media-left 3.6s ease-in-out infinite;
}

.portrait-rotation-demo[data-media-rotation="right"] .rotation-media {
    animation: rotate-media-right 3.6s ease-in-out infinite;
}

.rotation-arrow {
    color: #b77900;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
}

.portrait-rotation-demo > strong {
    font-size: 13px;
    text-align: center;
}

.portrait-help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.portrait-help-option {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.portrait-help-option p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

@keyframes rotate-media-left {
    0%, 22% { transform: rotate(0deg); }
    45%, 82% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

@keyframes rotate-media-right {
    0%, 22% { transform: rotate(0deg); }
    45%, 82% { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .rotation-media {
        animation: none !important;
    }

    .portrait-rotation-demo[data-media-rotation="left"] .rotation-media {
        transform: rotate(-90deg);
    }

    .portrait-rotation-demo[data-media-rotation="right"] .rotation-media {
        transform: rotate(90deg);
    }
}

.media-preview {
    width: 190px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: #101828;
    object-fit: contain;
}

.media-library-panel {
    overflow: visible;
}

.media-library-table {
    min-width: 980px;
}

.media-library-table th,
.media-library-table td {
    padding: 11px 9px;
}

.media-library-table th:first-child,
.media-library-table td:first-child {
    width: 210px;
}

.media-library-table .media-preview {
    width: 210px;
    border-radius: 8px;
}

.media-library-table .button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
}

.media-library-table .actions {
    gap: 6px;
}

.media-library-table .inline-form {
    gap: 6px;
}

.media-library-table .inline-form select {
    min-width: 145px;
    height: 36px;
    font-size: 12px;
}

.media-library-table .link-list a {
    min-height: 24px;
    padding: 0 8px;
    font-size: 11px;
}

.compact-list {
    display: grid;
    gap: 12px;
}

.compact-item {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.05);
    overflow: hidden;
}

.compact-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 15px 16px;
    cursor: pointer;
    list-style: none;
}

.compact-summary::-webkit-details-marker {
    display: none;
}

.compact-summary::after {
    content: "Abrir";
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    max-width: 100%;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    background: #f7fbfa;
}

div.compact-item > .compact-summary::after {
    content: none;
    display: none;
}

.compact-item[open] .compact-summary {
    border-bottom: 1px solid var(--line-soft);
    background: #fbfcfd;
}

.compact-item[open] .compact-summary::after {
    content: "Fechar";
}

.compact-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.compact-title strong {
    font-size: 16px;
    word-break: break-word;
}

.compact-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.compact-details {
    padding: 16px;
    display: grid;
    gap: 16px;
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.compact-field {
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
    min-width: 0;
}

.compact-field > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.compact-field strong,
.compact-field div {
    word-break: break-word;
}

.copy-field {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 14px;
}

.copy-field input {
    flex: 1;
    min-width: 0;
    font-size: 14px;
}

.referral-copy-field {
    flex-direction: column;
    align-items: flex-start;
    width: min(720px, 100%);
}

.referral-copy-field input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.referral-copy-field .button {
    min-width: 170px;
}

.commission-settlement-form {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.commission-settlement-form label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.commission-settlement-form input {
    min-height: 38px;
    font-size: 13px;
}

.compact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.media-compact-list {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.media-compact-item .compact-summary {
    display: block;
    padding: 10px;
    width: 100%;
    min-width: 0;
}

.media-compact-item {
    position: relative;
    overflow: visible;
}

.media-compact-item[open] {
    z-index: 20;
}

.media-compact-item .compact-details {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: min(360px, calc(100vw - 48px));
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.18);
}

.media-compact-item .compact-summary::after {
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
}

.media-compact-item .media-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
}

.media-compact-item .compact-grid {
    grid-template-columns: 1fr;
}

.plan-card {
    display: grid;
    gap: 10px;
    margin: 0;
    box-shadow: var(--shadow-soft);
}

.plan-card strong {
    font-size: 22px;
}

.help-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: 22px;
    align-items: center;
}

.support-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-color: #b7eadc;
    background: linear-gradient(135deg, #ffffff, #effbf7);
}

.support-panel h2,
.support-panel p {
    margin: 0;
}

.support-panel p {
    margin-top: 6px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.help-flow {
    display: grid;
    gap: 10px;
}

.help-flow span {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
    font-weight: 800;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.help-card {
    margin-bottom: 0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 900;
}

.help-card ol {
    margin: 0 0 14px 20px;
    padding: 0;
}

.help-card li {
    margin-bottom: 8px;
    line-height: 1.45;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tips-grid > div {
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.tips-grid strong {
    display: block;
    margin-bottom: 6px;
}

.tips-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.faq-list {
    display: grid;
    gap: 10px;
}

.faq-list details {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.faq-list summary {
    cursor: pointer;
    padding: 14px 16px;
    font-weight: 850;
}

.faq-list p {
    margin: 0;
    padding: 0 16px 16px;
    color: var(--muted);
    line-height: 1.5;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(11, 18, 32, 0.54);
    backdrop-filter: blur(6px);
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(420px, 100%);
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(11, 18, 32, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.confirm-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #fff1f0;
    color: var(--bad);
    font-weight: 900;
    margin-bottom: 12px;
}

.confirm-dialog h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.confirm-dialog p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(11, 18, 32, 0.54);
    backdrop-filter: blur(6px);
}

.detail-modal[hidden] {
    display: none;
}

.detail-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: min(88vh, 680px);
    overflow: auto;
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(11, 18, 32, 0.28);
}

.detail-dialog h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.detail-dialog p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-wrap;
}

.detail-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
}

.device-events-dialog {
    width: min(1040px, 100%);
    max-height: min(90vh, 760px);
}

.device-events-summary {
    margin: -6px 0 18px !important;
}

.device-events-status {
    display: grid;
    place-items: center;
    min-height: 140px;
    margin-top: 14px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: var(--bg-soft);
    font-weight: 800;
    text-align: center;
}

.device-events-status.error {
    border-color: #fecaca;
    color: var(--bad);
    background: #fff1f0;
}

.device-events-table {
    margin-top: 16px;
    overflow-x: auto;
}

.device-events-table .table {
    margin: 0;
}

.device-events-table td {
    vertical-align: top;
}

.device-events-table td:nth-child(3) {
    max-width: 330px;
    overflow-wrap: anywhere;
}

.pix-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(11, 18, 32, 0.72);
}

.pix-modal[hidden] {
    display: none;
}

.pix-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 26px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(11, 18, 32, 0.28);
}

.pix-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    font-weight: 900;
}

.pix-dialog h2 {
    margin: 0 0 8px;
}

.pix-qr-wrap {
    display: grid;
    place-items: center;
    margin: 18px auto;
    padding: 12px;
    width: min(280px, 100%);
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--bg-soft);
}

.pix-qr-wrap img {
    display: block;
    width: 100%;
    height: auto;
}

.pix-copy-label {
    display: grid;
    gap: 8px;
    font-weight: 800;
    color: #344054;
}

.pix-copy-label textarea {
    width: 100%;
    min-height: 108px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    resize: vertical;
    font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.pix-actions {
    display: flex;
    gap: 10px;
    margin: 14px 0;
}

.admin-hero {
    align-items: stretch;
}

.admin-hero-card {
    min-width: 260px;
    padding: 18px 20px;
    border-radius: 12px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(10, 163, 127, 0.95), rgba(11, 18, 32, 0.96));
    box-shadow: var(--shadow);
}

.admin-hero-card span,
.admin-hero-card small {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

.admin-hero-card strong {
    display: block;
    margin: 9px 0 5px;
    font-size: 30px;
    line-height: 1;
}

.admin-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-kpis .stat {
    min-height: 128px;
}

.admin-kpis .stat small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-weight: 700;
}

.admin-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.admin-alert-list,
.admin-mini-list {
    display: grid;
    gap: 10px;
}

.admin-alert,
.admin-mini-list > div {
    padding: 13px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.admin-alert {
    border-left: 4px solid var(--brand);
}

.admin-alert.warning {
    border-left-color: var(--warn);
}

.admin-alert.danger {
    border-left-color: var(--bad);
}

.admin-alert strong,
.admin-alert span,
.admin-mini-list strong,
.admin-mini-list span {
    display: block;
}

.admin-alert span,
.admin-mini-list span {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.45;
}

.admin-commerce {
    display: grid;
    gap: 14px;
}

.admin-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.admin-media-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.admin-media-preview {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    background: #07111d;
}

.admin-media-preview img,
.admin-media-preview video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.admin-media-preview span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .58);
    font-size: 12px;
    font-weight: 900;
}

.admin-media-body {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
}

.admin-media-body strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-media-body .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.admin-commerce h3 {
    margin: 8px 0 0;
    font-size: 15px;
    color: var(--ink);
}

.admin-commerce-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--bg-soft);
}

.admin-commerce-form.new {
    border-style: dashed;
    background: #fff;
}

.admin-commerce-form.package {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-commerce-form .button {
    align-self: end;
}

.admin-check:not(.switch-field) {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 9px !important;
    min-height: 44px;
}

.admin-check:not(.switch-field) input {
    width: 18px !important;
    height: 18px !important;
}

@media (max-width: 820px) {
    body { background: var(--bg-soft); }
    .grid, .form.two, .form-section-grid, .form-subgrid, .help-grid, .help-hero, .tips-grid, .admin-kpis, .admin-split, .admin-commerce-form, .admin-commerce-form.package, .admin-shortcuts, .admin-media-grid, .usage-grid { grid-template-columns: 1fr; }
    .media-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 14px;
        margin-bottom: 14px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--panel);
        box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
    }
    .media-summary-grid::before {
        content: "Biblioteca";
        display: block;
        grid-column: 1 / -1;
        margin-bottom: 2px;
        color: var(--ink);
        font-size: 15px;
        font-weight: 900;
    }
    .media-summary-grid .stat {
        min-height: 78px;
        margin: 0;
        padding: 12px;
        border-radius: 10px;
        box-shadow: none;
        background: var(--bg-soft);
    }
    .media-summary-grid .stat::after {
        width: 54px;
        height: 54px;
        right: -24px;
        top: -24px;
    }
    .media-summary-grid .stat span {
        font-size: 11px;
    }
    .media-summary-grid .stat strong {
        margin-top: 7px;
        font-size: 22px;
        line-height: 1.08;
        overflow-wrap: anywhere;
    }
    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 14px;
        margin-bottom: 14px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--panel);
        box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
    }
    .dashboard-account {
        margin-top: 0;
    }
    .dashboard-metrics::before {
        display: block;
        grid-column: 1 / -1;
        margin-bottom: 2px;
        color: var(--ink);
        font-size: 15px;
        font-weight: 900;
    }
    .dashboard-operation::before {
        content: "Operação";
    }
    .dashboard-plan::before {
        content: "Plano";
    }
    .dashboard-metrics .stat {
        min-height: 78px;
        margin: 0;
        padding: 12px;
        border-radius: 10px;
        box-shadow: none;
        background: var(--bg-soft);
    }
    .dashboard-metrics .stat::after {
        width: 54px;
        height: 54px;
        right: -24px;
        top: -24px;
    }
    .dashboard-metrics .stat span {
        font-size: 11px;
    }
    .dashboard-metrics .stat strong {
        margin-top: 7px;
        font-size: 22px;
        line-height: 1.08;
        overflow-wrap: anywhere;
    }
    .support-panel { display: grid; }
    .container { width: min(100% - 20px, 1180px); margin: 16px auto 28px; }
    .panel { padding: 16px; border-radius: 12px; box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06); }
    .admin-media-grid,
    .admin-media-card,
    .admin-media-body,
    .admin-media-preview {
        width: 100%;
        max-width: 100%;
    }
    .admin-media-body strong {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .admin-media-body .compact-meta,
    .admin-media-body .muted {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .admin-media-body .button {
        width: 100%;
    }
    .page-title { display: block; margin-bottom: 16px; }
    .admin-hero-card { min-width: 0; margin-top: 14px; }
    .pwa-install-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        grid-template-columns: 1fr;
    }
    .pwa-install-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .topbar {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 16px;
        gap: 14px;
    }

    .nav-toggle-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
        padding: 0 14px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.10);
        color: #fff;
        font-weight: 800;
        cursor: pointer;
    }

    .topbar nav {
        grid-column: 1 / -1;
        width: 100%;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-toggle:checked ~ nav {
        display: grid;
    }

    .topbar a,
    .topbar span {
        text-align: center;
        background: rgba(255, 255, 255, 0.08);
    }

    .button { width: 100%; }
    .delegation-banner {
        align-items: stretch;
        flex-direction: column;
    }
    .tv-code-field {
        flex-direction: column;
    }
    .qr-scan-button {
        width: 100%;
    }
    .page-title .button { width: auto; margin-top: 12px; }
    .support-whatsapp {
        right: 12px;
        bottom: 72px;
        min-width: 0;
        max-width: calc(100% - 24px);
        padding: 11px 13px;
    }
    .pix-dialog { padding: 20px; }
    .pix-actions { display: grid; }
    .actions { width: 100%; }
    .actions a, .actions form, .actions button { width: 100%; }
    .inline-form { display: grid; width: 100%; }
    .inline-form select { width: 100%; min-width: 0; }
    .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .campaign-device-grid { grid-template-columns: 1fr; }
    .multi-picker-summary {
        align-items: stretch;
        flex-direction: column;
    }
    .multi-picker-summary .button { width: 100%; }
    .multi-picker-toolbar,
    .multi-picker-grid { grid-template-columns: 1fr; }
    .multi-picker-tools {
        align-items: stretch;
        flex-direction: column;
    }
    .multi-picker-tools > div,
    .multi-picker-footer {
        display: grid;
        grid-template-columns: 1fr;
    }
    .confirm-actions { display: grid; }
    .section-heading { display: block; }
    .section-heading .button { margin-top: 12px; }
    .portrait-media-guide,
    .portrait-help-grid,
    .portrait-help-option {
        grid-template-columns: 1fr;
    }
    .videowall-config {
        grid-template-columns: 1fr;
    }
    .portrait-media-guide {
        padding: 16px;
    }
    .portrait-help-option {
        text-align: center;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
    }

    .responsive-table thead { display: none; }

    .responsive-table tr {
        border: 1px solid var(--line-soft);
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(16, 24, 40, 0.05);
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        border-bottom: 1px solid var(--line-soft);
        padding: 10px 0;
        word-break: break-word;
    }

    .responsive-table td:last-child { border-bottom: 0; }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .responsive-table td[colspan] { display: block; }
    .responsive-table td[colspan]::before { display: none; }

    .responsive-table td[data-label="Mídia"] {
        display: block;
    }

    .responsive-table td[data-label="Mídia"]::before {
        display: none;
    }

    .report-media-cell {
        width: 100%;
        align-items: flex-start;
    }

    .report-media-preview {
        width: 124px;
        flex-basis: 124px;
    }

    .collapsible-create summary {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .collapsible-create summary .button {
        width: 100%;
        justify-content: center;
    }

    .media-library-panel {
        overflow-x: visible;
    }

    .media-library-table {
        min-width: 0;
    }

    .media-library-table td[data-label="Preview"] {
        display: block;
        width: 100%;
    }

    .media-library-table td[data-label="Preview"]::before {
        display: none;
    }

    .media-library-table .media-preview {
        width: 100%;
        max-width: none;
        display: block;
        margin: 0 auto;
    }

    .media-library-table .button {
        min-height: 40px;
        font-size: 13px;
    }

    .media-library-table .inline-form select {
        min-width: 0;
        width: 100%;
        height: 40px;
        font-size: 13px;
    }

    .compact-summary {
        grid-template-columns: 1fr;
    }

    .compact-summary::after {
        width: 100%;
        min-width: 0;
    }

    .compact-grid,
    .media-compact-list {
        grid-template-columns: 1fr;
    }

    .compact-actions {
        display: grid;
    }

    .media-compact-item .compact-details {
        position: static;
        min-width: 0;
        border: 0;
        border-top: 1px solid var(--line-soft);
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 460px) {
    .auth-card { padding: 22px; }
    .stat strong { font-size: 26px; }
    .responsive-table td { grid-template-columns: 1fr; gap: 4px; }
    .topbar nav { grid-template-columns: 1fr; }
}
[hidden] {
    display: none !important;
}
