/* Defender MED — interface interna.
   Paleta única: azul-marinho #0b1424, laranja #f97316 e texto branco.
   Superfícies, bordas e textos secundários são branco translúcido sobre o azul-marinho. */

@font-face {
    font-family: "Inter";
    src: url("../fonts/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #0b1424;
    --orange: #f97316;
    --orange-hover: #fb8a3c;
    --orange-soft: rgba(249, 115, 22, 0.14);

    --text: #ffffff;
    --text-2: rgba(255, 255, 255, 0.76);
    --text-3: rgba(255, 255, 255, 0.58);

    --fill-1: rgba(255, 255, 255, 0.04);
    --fill-2: rgba(255, 255, 255, 0.07);
    --fill-3: rgba(255, 255, 255, 0.11);
    --line: rgba(255, 255, 255, 0.11);
    --line-strong: rgba(255, 255, 255, 0.26);
    /* Superfície opaca (menus flutuantes): branco translúcido já composto sobre o fundo. */
    --surface-solid: linear-gradient(var(--fill-2), var(--fill-2)), var(--bg);

    --radius: 8px;
    --radius-lg: 14px;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --sidebar-w: 260px;
    --topbar-h: 58px;
    --bottomnav-h: 64px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/1.55 var(--font);
    font-feature-settings: "calt", "kern";
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--orange);
    color: var(--bg);
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -0.012em;
    line-height: 1.25;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.mono {
    font-family: var(--mono);
    font-size: 0.92em;
    letter-spacing: 0;
}

.num {
    font-variant-numeric: tabular-nums;
}

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

/* ---------- Estrutura (desktop) ---------- */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px 16px 16px;
    border-right: 1px solid var(--line);
    background: var(--bg);
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.brand__mark {
    flex: none;
    width: 28px;
    height: 28px;
    color: var(--orange);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-2);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.12s, color 0.12s;
}

.nav__link svg {
    flex: none;
    width: 19px;
    height: 19px;
}

.nav__link:hover {
    background: var(--fill-2);
    color: var(--text);
}

.nav__link[aria-current="page"] {
    background: var(--fill-3);
    color: var(--text);
}

.nav__link[aria-current="page"] svg {
    color: var(--orange);
}

.nav__link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--orange);
}

/* Conta do usuário (rodapé da barra lateral; menu suspenso no mobile) */

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--bg);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.account-toggle {
    display: none;
}

.sidebar__user {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--fill-1);
}

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 2px 2px 10px;
    border-bottom: 1px solid var(--line);
}

.account__text {
    min-width: 0;
}

.account__name,
.account__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account__name {
    font-weight: 600;
    line-height: 1.3;
}

.account__role {
    color: var(--orange);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu form {
    margin: 0;
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text-2);
    font: 500 14px/1.2 var(--font);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
}

.menu__item svg {
    flex: none;
    width: 17px;
    height: 17px;
}

.menu__item:hover {
    background: var(--fill-2);
    color: var(--text);
}

.main {
    min-width: 0;
    padding: 36px 44px 72px;
}

.main__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
    margin-bottom: 26px;
}

.page-head h1 {
    font-size: 28px;
}

.page-head p {
    margin-top: 6px;
    max-width: 64ch;
    color: var(--text-2);
}

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

/* ---------- Componentes ---------- */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--fill-1);
}

.panel--pad {
    padding: 24px;
}

.panel__title {
    margin-bottom: 14px;
    font-size: 15px;
}

.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius);
    background: var(--fill-2);
    color: var(--text);
    font-weight: 500;
}

.flash svg {
    flex: none;
    width: 19px;
    height: 19px;
    margin-top: 1px;
    color: var(--orange);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    font: 600 14.5px/1 var(--font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn svg {
    flex: none;
    width: 17px;
    height: 17px;
}

.btn:hover {
    border-color: var(--text-2);
    background: var(--fill-2);
}

.btn--primary {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--bg);
}

.btn--primary:hover {
    border-color: var(--orange-hover);
    background: var(--orange-hover);
}

.btn--danger {
    border-color: var(--orange);
    color: var(--orange);
}

.btn--danger:hover {
    border-color: var(--orange);
    background: var(--orange-soft);
}

.btn--sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13.5px;
}

.btn--block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn.is-done {
    border-color: var(--orange);
    background: var(--orange-soft);
    color: var(--orange);
}

/* ---------- Formulários ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.field > legend.field__label {
    margin-bottom: 7px;
}

.field__label {
    padding: 0;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
}

.field__hint {
    color: var(--text-3);
    font-size: 13px;
}

.field__error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: var(--orange);
    font-size: 13px;
    font-weight: 600;
}

.field__error:empty {
    display: none;
}

.field__error::before {
    content: "!";
    flex: none;
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    margin-top: 2px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
}

.input,
.select {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--fill-1);
    color: var(--text);
    font: 400 15px/1.3 var(--font);
    transition: border-color 0.12s, box-shadow 0.12s, background-color 0.12s;
}

.input::placeholder {
    color: rgba(255, 255, 255, 0.36);
}

.input:hover,
.select:hover {
    border-color: var(--text-3);
}

.input:focus,
.select:focus {
    border-color: var(--orange);
    background: var(--fill-2);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
    outline: none;
}

/* Autopreenchimento do navegador não deve trazer fundo claro. */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    box-shadow: 0 0 0 1000px #131c2d inset;
    transition: background-color 9999s;
}

.input--mono {
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.01em;
}

.input--money {
    font-variant-numeric: tabular-nums;
}

.select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.75' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
}

.select option {
    background: var(--bg);
    color: var(--text);
}

.field--error .input,
.field--error .select {
    border-color: var(--orange);
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group .input {
    flex: 1;
    min-width: 0;
}

/* Modalidade: controle segmentado (radios). */
.segmented {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.segmented__item {
    position: relative;
}

.segmented__item input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.segmented__item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--fill-1);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.segmented__item:hover span {
    border-color: var(--text-3);
    color: var(--text);
}

.segmented__item input:checked + span {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--bg);
}

.segmented__item input:focus-visible + span {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.field--error .segmented__item span {
    border-color: var(--orange);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
}

.check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--orange);
}

.check__text small {
    display: block;
    color: var(--text-3);
    font-size: 13px;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

/* ---------- Nova defesa ---------- */

.workbench {
    display: grid;
    grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.workbench__form {
    position: sticky;
    top: 24px;
}

.stage {
    max-width: 660px;
    padding: 22px;
}

.stage__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.stage__head h2 {
    font-size: 15px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
}

.status::before {
    content: "";
    width: 9px;
    height: 9px;
    border: 1.5px solid var(--text-3);
    border-radius: 50%;
}

.status[data-state="ready"] {
    color: var(--text);
}

.status[data-state="ready"]::before {
    border-color: var(--orange);
    background: var(--orange);
}

.status[data-state="loading"] {
    color: var(--text);
}

.status[data-state="loading"]::before {
    border-color: var(--orange);
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* O PNG tem uma margem branca ao redor do card; na tela ela é recortada para o card
   aparecer sem moldura clara (o arquivo baixado/copiado continua idêntico ao original). */
.card-frame {
    position: relative;
    aspect-ratio: 1534 / 2014;
    border: 1px solid var(--line);
    border-radius: 1.96% / 1.49%;
    background: #131f35;
    overflow: hidden;
}

.card-frame img {
    position: absolute;
    top: -1.64%;
    left: -2.15%;
    width: 104.3%;
    max-width: none;
    height: auto;
    transition: opacity 0.15s;
}

.card-frame.is-loading img {
    opacity: 0.5;
}

.card-frame__empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    border: 1px dashed var(--line-strong);
    border-radius: inherit;
    background: var(--fill-1);
    color: var(--text-3);
    text-align: center;
}

.card-frame__empty p {
    max-width: 30ch;
}

.card-frame:not(.is-empty) .card-frame__empty {
    display: none;
}

.textbox {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.textbox__label {
    margin-bottom: 9px;
    font-size: 13.5px;
    font-weight: 600;
}

.textbox__body {
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--fill-1);
    color: var(--text);
    line-height: 1.7;
    overflow-wrap: anywhere;
    user-select: all;
}

.textbox__body:empty::before {
    content: "O texto da defesa aparece aqui.";
    color: var(--text-3);
    user-select: none;
}

.textbox__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* ---------- Detalhe da defesa ---------- */

.detail {
    display: grid;
    grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.detail__aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail__media {
    padding: 22px;
}

.detail__media .textbox__actions {
    margin-top: 18px;
}

.datalist {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 11px 22px;
    margin: 0;
}

.datalist dt {
    color: var(--text-3);
}

.datalist dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* ---------- Tabelas ---------- */

.filters {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(130px, 1fr));
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
    padding: 20px;
}

.filters--admin {
    grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(120px, 1fr));
}

.filters__actions {
    display: flex;
    gap: 8px;
    grid-column: 1 / -1;
}

.table-wrap {
    overflow-x: auto;
}

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

.table th {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--fill-1);
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

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

.table tbody tr:hover td {
    background: var(--fill-1);
}

.table .is-right {
    text-align: right;
}

.table__primary {
    font-weight: 600;
    text-decoration: none;
}

.table__primary:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.table__secondary {
    display: block;
    margin-top: 2px;
    color: var(--text-3);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.chip {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.chip--admin {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--bg);
}

.chip--on {
    border-color: var(--orange);
    color: var(--orange);
}

.chip--off {
    border-style: dashed;
    color: var(--text-3);
}

.empty {
    padding: 56px 24px;
    text-align: center;
}

.empty h2 {
    margin-bottom: 6px;
    font-size: 17px;
}

.empty p {
    margin: 0 auto 18px;
    max-width: 44ch;
    color: var(--text-2);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: var(--text-3);
    font-size: 13.5px;
}

.pager__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pager__link {
    min-width: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.pager__link:hover {
    border-color: var(--text-2);
    background: var(--fill-2);
}

.pager__link[aria-current="page"] {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--bg);
}

.pager__link[aria-disabled="true"] {
    opacity: 0.4;
    pointer-events: none;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ---------- Páginas de formulário simples ---------- */

.narrow {
    max-width: 540px;
}

/* ---------- Visitante (login / erros) ---------- */

.guest {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 16px;
    background: var(--bg);
}

.guest .brand {
    padding: 0;
    font-size: 20px;
}

.guest .brand__mark {
    width: 34px;
    height: 34px;
}

.guest__panel {
    width: 100%;
    max-width: 410px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--fill-1);
}

.guest__panel h1 {
    margin-bottom: 4px;
    font-size: 22px;
}

.guest__panel > p {
    margin-bottom: 22px;
    color: var(--text-2);
}

.guest__note {
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
}

.guest__panel .error-code {
    margin-bottom: 8px;
    color: var(--orange);
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

/* ---------- Responsivo ---------- */

/* Notebooks e tablets em paisagem: conteúdo empilhado, barra lateral mantida. */
@media (max-width: 1280px) {
    .main {
        padding: 32px 32px 64px;
    }

    .workbench {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .workbench__form {
        position: static;
    }

    .workbench__form.panel--pad,
    .stage,
    .detail__media {
        max-width: 700px;
    }

    .detail {
        grid-template-columns: 1fr;
        max-width: 700px;
    }

    .filters,
    .filters--admin {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .filters > :first-child {
        grid-column: 1 / -1;
    }
}

/* Tablets em retrato e celulares: barra superior + navegação inferior. */
@media (max-width: 960px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: var(--topbar-h);
        padding: 9px 16px;
        padding-top: max(9px, env(safe-area-inset-top));
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow: visible;
    }

    .sidebar .brand {
        padding: 0;
    }

    .account-toggle {
        display: block;
        padding: 0;
        border: 2px solid transparent;
        border-radius: 50%;
        background: none;
        cursor: pointer;
    }

    .account-toggle .avatar {
        width: 36px;
        height: 36px;
    }

    .account-toggle[aria-expanded="true"] {
        border-color: var(--text);
    }

    .sidebar__user {
        position: absolute;
        top: calc(100% + 8px);
        right: 12px;
        z-index: 50;
        display: none;
        width: min(320px, calc(100vw - 24px));
        margin: 0;
        padding: 14px;
        background: var(--surface-solid);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    }

    .sidebar__user.is-open {
        display: flex;
    }

    .nav {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        flex-direction: row;
        gap: 0;
        padding: 0 8px env(safe-area-inset-bottom);
        border-top: 1px solid var(--line);
        background: var(--bg);
    }

    .nav__link {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        min-height: var(--bottomnav-h);
        padding: 8px 4px;
        border-radius: 0;
        font-size: 12px;
        text-align: center;
    }

    .nav__link svg {
        width: 22px;
        height: 22px;
    }

    .nav__link:hover,
    .nav__link[aria-current="page"] {
        background: none;
    }

    .nav__link[aria-current="page"]::before {
        inset: 0 22% auto;
        width: auto;
        height: 3px;
        border-radius: 0 0 3px 3px;
    }

    .main {
        padding: 22px 16px calc(var(--bottomnav-h) + 32px + env(safe-area-inset-bottom));
    }

    .page-head {
        margin-bottom: 20px;
    }

    .page-head h1 {
        font-size: 24px;
    }

    .panel--pad,
    .stage,
    .detail__media {
        padding: 18px;
    }
}

/* Celulares: tabelas viram cartões. */
@media (max-width: 720px) {
    .filters,
    .filters--admin {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 16px;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
        background: none;
    }

    .table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .table,
    .table tbody {
        display: block;
    }

    .table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
        gap: 8px 14px;
        margin-bottom: 12px;
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: var(--fill-1);
    }

    .table tbody tr:hover td,
    .table td {
        background: none;
    }

    .table td {
        display: block;
        padding: 0;
        border: 0;
    }

    .table td[data-label]::before {
        content: attr(data-label);
        display: block;
        color: var(--text-3);
        font-size: 12px;
        font-weight: 500;
    }

    .table td.c-main {
        grid-column: 1 / -1;
        order: -1;
    }

    .table td.is-right {
        text-align: left;
    }

    .table td.c-amount {
        order: 1;
        font-size: 16px;
        font-weight: 650;
    }

    .table td.c-modality {
        order: 2;
    }

    .table td.c-paydate {
        order: 3;
    }

    .table td.c-created {
        order: 4;
    }

    .table td.c-manager {
        order: 5;
    }

    .table td.c-action {
        grid-column: 1 / -1;
        order: 9;
        padding-top: 4px;
    }

    .table td.c-action .btn {
        width: 100%;
    }

    .datalist {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .datalist dd {
        margin-bottom: 10px;
    }

    .pager {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .segmented {
        grid-template-columns: 1fr 1fr;
    }

    .guest__panel {
        padding: 24px 20px;
    }

    .page-head__actions {
        width: 100%;
    }

    .page-head__actions .btn,
    .page-head__actions .inline-form {
        flex: 1;
    }

    .page-head__actions .inline-form .btn {
        width: 100%;
    }

    .form__actions .btn {
        flex: 1;
    }
}

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