:root {
    --bg: #f3f5f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #111827;
    --muted: #64748b;
    --line: #dbe3ee;
    --brand: #b11217;
    --brand-dark: #8f0f13;
    --ok: #047857;
    --warn: #b45309;
    --danger: #b91c1c;
    --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.18s ease;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    background: #fbfcfe;
    border-right: 1px solid var(--line);
    padding: 18px 14px;
    z-index: 30;
    transition: width 0.18s ease, padding 0.18s ease, box-shadow 0.18s ease;
}

.brand-block {
    display: flex;
    position: relative;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    margin-bottom: 18px;
}

.brand-block img {
    width: 150px;
    max-width: 100%;
    transition: width 0.18s ease;
}

.brand-block span {
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
}

.side-nav {
    display: grid;
    gap: 8px;
    transition: opacity 0.14s ease;
}

.nav-group {
    border: 1px solid transparent;
    border-radius: 10px;
}

.nav-group.is-open {
    background: #ffffff;
    border-color: var(--line);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.nav-group-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #263241;
    padding: 10px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    text-transform: uppercase;
    cursor: pointer;
}

.nav-group-toggle:hover {
    background: #f1f5f9;
}

.nav-group-toggle i {
    width: 9px;
    height: 9px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.nav-group.is-open .nav-group-toggle i {
    transform: rotate(225deg);
}

.nav-group-items {
    display: none;
    padding: 0 8px 10px;
}

.nav-group.is-open .nav-group-items {
    display: grid;
    gap: 3px;
}

.side-nav a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: #334155;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}

.side-nav a::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-radius: 999px;
    background: #cbd5e1;
}

.side-nav a:hover,
.side-nav a.active {
    background: #fff1f2;
    color: var(--brand);
}

.side-nav a.active::before {
    background: var(--brand);
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.admin-topbar strong,
.page-head h1 {
    display: block;
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.admin-topbar small,
.page-head p {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.content-wrapper {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 26px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 18px;
}

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

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

.page-section {
    margin-top: 16px;
}

.notice {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 12px 14px;
}

.notice.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--ok);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal-panel-small {
    width: min(560px, 100%);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 0;
}

.modal-head h2 {
    margin: 0;
}

.modal-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.modal-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: 24px;
    line-height: 1;
}

.modal-close:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #fff1f2;
}

.print-material-options {
    display: grid;
    gap: 10px;
}

.print-material-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    cursor: pointer;
}

.print-material-option:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.print-material-option:has(input:checked) {
    border-color: var(--brand);
    background: #fff1f2;
}

.print-material-option input {
    margin-top: 3px;
    accent-color: var(--brand);
}

.print-material-option strong {
    display: block;
    font-size: 14px;
}

.print-material-option small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.4;
}

.metric span {
    color: var(--muted);
    font-weight: 650;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-bottom: 16px;
}

.toolbar-split {
    width: 100%;
}

.toolbar-push {
    margin-left: auto;
}

.field {
    display: grid;
    gap: 6px;
    min-width: 190px;
}

.field label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

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

.form-grid .field {
    min-width: 0;
}

.compact-form {
    gap: 10px 12px;
}

.compact-form .field {
    gap: 4px;
}

.compact-form .field label {
    font-size: 12px;
}

.compact-form .input,
.compact-form .select {
    min-height: 36px;
    padding: 7px 10px;
}

.compact-form .textarea {
    min-height: 92px;
    padding: 8px 10px;
}

.compact-form .form-actions {
    padding-top: 4px;
}

.compact-form .field-small {
    min-width: 110px;
}

.compact-form .field-half {
    grid-column: span 1;
}

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

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

.compact-form .field-wide {
    grid-column: 1 / -1;
}

.form-group-box {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafc;
}

.form-group-box legend {
    grid-column: 1 / -1;
    width: auto;
    margin: 0 0 0 -2px;
    padding: 0 6px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 850;
}

.modal-panel .compact-form {
    margin-top: -2px;
}

.compact-form .checkbox-grid {
    gap: 6px;
}

.compact-form .check-option {
    min-height: 36px;
    padding: 7px 9px;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    gap: 8px;
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    padding: 10px 14px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.button-small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

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

.button:disabled,
.button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.is-hidden {
    display: none !important;
}

.button-outline {
    background: #fff;
    color: var(--brand);
}

.button-outline:hover {
    background: #fff1f2;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

.data-table th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

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

.data-table tr.modality-group-a td {
    background: #fff;
}

.data-table tr.modality-group-b td {
    background: #f8fafc;
}

.data-table tr.modality-group-a + tr.modality-group-b td,
.data-table tr.modality-group-b + tr.modality-group-a td {
    border-top: 2px solid var(--brand);
}

.sections-table tr[draggable="true"] {
    cursor: grab;
}

.sections-table tr.is-dragging td {
    background: #fff1f2;
    opacity: 0.72;
}

.drag-handle {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    vertical-align: middle;
}

.drag-handle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
}

.compact-table-wrap {
    max-height: 620px;
    overflow: auto;
}

.data-table-compact {
    min-width: 520px;
    font-size: 13px;
}

.data-table-compact th,
.data-table-compact td {
    padding: 7px 9px;
}

.data-table-compact th {
    position: sticky;
    top: 0;
    z-index: 1;
    font-size: 11px;
}

.data-table-compact td {
    line-height: 1.25;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
}

.badge.paid {
    background: #dcfce7;
    color: var(--ok);
}

.badge.pending,
.badge.draft {
    background: #fef3c7;
    color: var(--warn);
}

.badge.canceled,
.badge.error {
    background: #fee2e2;
    color: var(--danger);
}

.badge.processed {
    background: #dcfce7;
    color: var(--ok);
}

.badge.processing {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.approved {
    background: #dcfce7;
    color: var(--ok);
}

.badge.rejected {
    background: #fee2e2;
    color: var(--danger);
}

.badge.active,
.badge.ativa,
.badge.normal {
    background: #dcfce7;
    color: var(--ok);
}

.badge.inactive,
.badge.inativa {
    background: #fee2e2;
    color: var(--danger);
}

.badge.reward {
    background: #fef3c7;
    color: var(--warn);
}

.badge.promo {
    background: #dbeafe;
    color: #1d4ed8;
}

.muted-line {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.icon-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.icon-action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-action:hover {
    border-color: var(--brand);
    background: #fff1f2;
    color: var(--brand);
}

.icon-action.is-ok:hover {
    border-color: var(--ok);
    background: #dcfce7;
    color: var(--ok);
}

.icon-action.is-danger:hover {
    border-color: var(--danger);
    background: #fee2e2;
    color: var(--danger);
}

.pcd-table {
    min-width: 1060px;
}

.voucher-table {
    min-width: 1080px;
}

.voucher-user-table {
    min-width: 900px;
}

.voucher-group-table {
    min-width: 1120px;
}

.event-table {
    min-width: 860px;
}

.webhook-table {
    min-width: 1120px;
}

.organizer-table {
    min-width: 1080px;
}

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

.detail-list h2 {
    margin: 0 0 4px;
}

.detail-list p {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.detail-list p:last-child {
    border-bottom: 0;
}

.detail-list span {
    color: var(--muted);
    font-weight: 700;
}

.detail-list strong {
    font-weight: 750;
}

.empty-state {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.shirt-chart {
    display: grid;
    gap: 10px;
}

.shirt-chart-row {
    display: grid;
    grid-template-columns: 80px 70px minmax(120px, 1fr) 58px;
    align-items: center;
    gap: 12px;
}

.shirt-chart-row strong {
    font-size: 15px;
}

.shirt-chart-row span,
.shirt-chart-row small {
    color: var(--muted);
    font-weight: 750;
    text-align: right;
}

.shirt-chart-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.shirt-chart-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

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

.ranking-row {
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.ranking-row > span,
.ranking-row > strong,
.ranking-row > em {
    position: relative;
    z-index: 1;
}

.ranking-row > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff1f2;
    color: var(--brand);
    font-weight: 850;
}

.ranking-row > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-row > em {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.ranking-row > i {
    position: absolute;
    inset: auto auto 0 0;
    height: 3px;
    background: var(--brand);
}

.mailing-table {
    min-width: 980px;
}

.mailing-campaign-table {
    min-width: 1080px;
}

.queue-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.import-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 8px 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.import-tab {
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 7px 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.import-tab.active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.import-panel {
    display: none;
}

.import-panel.active {
    display: block;
}

.mail-editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 12px;
}

.template-select {
    width: min(260px, 100%);
    min-height: 36px;
}

.template-name-input {
    width: min(260px, 100%);
}

.mail-editor-tools .button {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

.editor-tabbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.editor-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.button-preview {
    min-height: 42px;
    border-color: #eab308;
    background: #facc15;
    color: #422006;
}

.button-preview:hover {
    background: #eab308;
    color: #422006;
}

.editor-tab {
    min-height: 34px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    padding: 7px 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.editor-tab.active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.editor-tab:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.editor-panel {
    display: none;
}

.editor-panel.active {
    display: block;
}

.content-accordion {
    display: grid;
    gap: 10px;
}

.content-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.content-section summary {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--text);
    font-weight: 850;
    cursor: pointer;
    list-style: none;
}

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

.content-section summary::after {
    content: "+";
    margin-left: auto;
    color: var(--brand);
    font-size: 18px;
    line-height: 1;
}

.content-section[open] summary {
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.content-section[open] summary::after {
    content: "-";
}

.content-section-body {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.code-textarea {
    min-height: 260px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.55;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.check-option {
    display: grid;
    grid-template-columns: 18px minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.check-option span {
    font-weight: 850;
}

.check-option small {
    min-width: 0;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-only,
.desktop-only,
.sidebar-backdrop {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 9px;
}

.icon-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
}

.sidebar-collapse-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.sidebar-collapse-button:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #fff1f2;
}

.sidebar-collapse-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.18s ease;
}

body.sidebar-collapsed .sidebar-collapse-button svg {
    transform: rotate(180deg);
}

body.sidebar-collapsed .admin-shell {
    grid-template-columns: 76px minmax(0, 1fr);
}

body.sidebar-collapsed .admin-sidebar {
    width: 76px;
    padding: 18px 8px;
    overflow-x: hidden;
}

body.sidebar-collapsed .admin-sidebar:hover,
body.sidebar-collapsed .admin-sidebar:focus-within {
    width: 280px;
    padding: 18px 14px;
    box-shadow: 14px 0 32px rgba(15, 23, 42, 0.12);
}

body.sidebar-collapsed .brand-block {
    justify-content: center;
    overflow: hidden;
}

body.sidebar-collapsed .brand-block::after {
    content: "NC";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: #fff1f2;
    color: var(--brand);
    font-size: 15px;
    font-weight: 900;
}

body.sidebar-collapsed .brand-block img,
body.sidebar-collapsed .brand-block span,
body.sidebar-collapsed .nav-group-toggle span,
body.sidebar-collapsed .side-nav a {
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .side-nav {
    opacity: 0;
    pointer-events: none;
}

body.sidebar-collapsed .admin-sidebar:hover .brand-block,
body.sidebar-collapsed .admin-sidebar:focus-within .brand-block {
    justify-content: flex-start;
    overflow: visible;
}

body.sidebar-collapsed .admin-sidebar:hover .brand-block::after,
body.sidebar-collapsed .admin-sidebar:focus-within .brand-block::after {
    display: none;
}

body.sidebar-collapsed .admin-sidebar:hover .brand-block img,
body.sidebar-collapsed .admin-sidebar:focus-within .brand-block img {
    width: 150px;
}

body.sidebar-collapsed .admin-sidebar:hover .brand-block span,
body.sidebar-collapsed .admin-sidebar:hover .nav-group-toggle span,
body.sidebar-collapsed .admin-sidebar:hover .side-nav a,
body.sidebar-collapsed .admin-sidebar:focus-within .brand-block span,
body.sidebar-collapsed .admin-sidebar:focus-within .nav-group-toggle span,
body.sidebar-collapsed .admin-sidebar:focus-within .side-nav a {
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-collapsed .admin-sidebar:hover .side-nav,
body.sidebar-collapsed .admin-sidebar:focus-within .side-nav {
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-collapsed .admin-sidebar:hover .nav-group.is-open .nav-group-items,
body.sidebar-collapsed .admin-sidebar:focus-within .nav-group.is-open .nav-group-items {
    display: grid;
}

body.sidebar-collapsed .admin-sidebar:hover .nav-group-toggle,
body.sidebar-collapsed .admin-sidebar:focus-within .nav-group-toggle {
    justify-content: space-between;
    padding: 10px 12px;
}

@media (max-width: 1180px) {
    .responsive-table-wrap,
    .table-wrap:has(.responsive-table) {
        overflow-x: visible;
    }

    .responsive-table {
        min-width: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

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

    .responsive-table td {
        display: grid;
        grid-template-columns: 128px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
        border-bottom: 0;
    }

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

    .responsive-table td:last-child {
        display: block;
        padding-top: 12px;
    }

    .responsive-table td:last-child::before {
        display: none;
    }

    .responsive-table .row-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
        width: 100%;
        gap: 8px;
        white-space: normal;
    }

    .responsive-table .row-actions form {
        width: 100%;
    }

    .responsive-table .icon-action {
        width: 100%;
        min-height: 38px;
    }

    .dashboard-audit-table td,
    .data-table-compact.responsive-table td {
        padding: 7px 0;
    }
}

@media (max-width: 900px) {
    body.sidebar-collapsed .admin-shell {
        display: block;
    }

    body.sidebar-collapsed .admin-sidebar,
    body.sidebar-collapsed .admin-sidebar:hover,
    body.sidebar-collapsed .admin-sidebar:focus-within {
        width: min(86vw, 320px);
        padding: 18px 14px;
        box-shadow: none;
    }

    body.sidebar-collapsed .brand-block,
    body.sidebar-collapsed .admin-sidebar:hover .brand-block,
    body.sidebar-collapsed .admin-sidebar:focus-within .brand-block {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .brand-block img,
    body.sidebar-collapsed .admin-sidebar:hover .brand-block img,
    body.sidebar-collapsed .admin-sidebar:focus-within .brand-block img {
        width: 150px;
    }

    body.sidebar-collapsed .brand-block::after {
        display: none;
    }

    body.sidebar-collapsed .brand-block img,
    body.sidebar-collapsed .brand-block span,
    body.sidebar-collapsed .nav-group-toggle span,
    body.sidebar-collapsed .side-nav a {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-collapsed .side-nav {
        opacity: 1;
        pointer-events: auto;
    }

    .desktop-only {
        display: none;
    }

    .admin-shell {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(15, 23, 42, 0.38);
    }

    body.sidebar-open .sidebar-backdrop,
    .mobile-only {
        display: block;
    }

    .admin-topbar {
        padding: 12px;
    }

    .topbar-actions span {
        display: none;
    }

    .content-wrapper {
        padding: 16px 12px 28px;
    }

    .page-head {
        display: block;
    }

    .page-head .button {
        width: 100%;
        margin-top: 12px;
    }

    .grid-3,
    .grid-2,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        display: grid;
    }

    .modal-shell {
        align-items: stretch;
        padding: 12px;
    }

    .modal-panel {
        max-height: calc(100vh - 24px);
    }

    .toolbar {
        display: grid;
    }

    .field,
    .toolbar .button {
        width: 100%;
    }

    .form-group-box {
        grid-template-columns: 1fr;
    }

    .compact-form .field-pair {
        grid-template-columns: 1fr;
    }

    .field-triplet {
        grid-template-columns: 1fr;
    }

    .shirt-chart-row {
        grid-template-columns: 58px 54px minmax(90px, 1fr) 48px;
        gap: 8px;
    }

    .ranking-row {
        grid-template-columns: 30px minmax(0, 1fr) 74px;
    }

    .pcd-table {
        min-width: 0;
    }

    .pcd-table thead {
        display: none;
    }

    .pcd-table,
    .pcd-table tbody,
    .pcd-table tr,
    .pcd-table td {
        display: block;
        width: 100%;
    }

    .pcd-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

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

    .pcd-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border-bottom: 0;
    }

    .pcd-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .pcd-table td:last-child {
        display: block;
        padding-top: 12px;
    }

    .pcd-table td:last-child::before {
        display: none;
    }

    .pcd-table .row-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .pcd-table .row-actions form {
        width: 100%;
    }

    .pcd-table .icon-action {
        width: 100%;
    }

    .mailing-table {
        min-width: 0;
    }

    .mailing-table thead {
        display: none;
    }

    .mailing-table,
    .mailing-table tbody,
    .mailing-table tr,
    .mailing-table td {
        display: block;
        width: 100%;
    }

    .mailing-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .mailing-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border-bottom: 0;
    }

    .mailing-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .mailing-table td:last-child {
        display: block;
        padding-top: 12px;
    }

    .mailing-table td:last-child::before {
        display: none;
    }

    .mailing-table .row-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .mailing-table .icon-action {
        width: 100%;
    }

    .mailing-campaign-table {
        min-width: 0;
    }

    .mailing-campaign-table thead {
        display: none;
    }

    .mailing-campaign-table,
    .mailing-campaign-table tbody,
    .mailing-campaign-table tr,
    .mailing-campaign-table td {
        display: block;
        width: 100%;
    }

    .mailing-campaign-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .mailing-campaign-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border-bottom: 0;
    }

    .mailing-campaign-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .mailing-campaign-table td:last-child {
        display: block;
        padding-top: 12px;
    }

    .mailing-campaign-table td:last-child::before {
        display: none;
    }

    .mailing-campaign-table .row-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .mailing-campaign-table .row-actions form,
    .mailing-campaign-table .icon-action {
        width: 100%;
    }

    .voucher-table,
    .voucher-user-table,
    .voucher-group-table,
    .event-table,
    .webhook-table {
        min-width: 0;
    }

    .voucher-table thead,
    .voucher-user-table thead,
    .voucher-group-table thead,
    .event-table thead,
    .webhook-table thead {
        display: none;
    }

    .voucher-table,
    .voucher-user-table,
    .voucher-group-table,
    .event-table,
    .webhook-table,
    .voucher-table tbody,
    .voucher-user-table tbody,
    .voucher-group-table tbody,
    .event-table tbody,
    .webhook-table tbody,
    .voucher-table tr,
    .voucher-user-table tr,
    .voucher-group-table tr,
    .event-table tr,
    .webhook-table tr,
    .voucher-table td,
    .voucher-user-table td,
    .voucher-group-table td,
    .event-table td,
    .webhook-table td {
        display: block;
        width: 100%;
    }

    .voucher-table tr,
    .voucher-user-table tr,
    .voucher-group-table tr,
    .event-table tr,
    .webhook-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .voucher-table td,
    .voucher-user-table td,
    .voucher-group-table td,
    .event-table td,
    .webhook-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 7px 0;
        border-bottom: 0;
    }

    .voucher-table td::before,
    .voucher-user-table td::before,
    .voucher-group-table td::before,
    .event-table td::before,
    .webhook-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 800;
        text-transform: uppercase;
    }

    .voucher-table td:last-child,
    .voucher-user-table td:last-child,
    .voucher-group-table td:last-child,
    .event-table td:last-child,
    .webhook-table td:last-child,
    .organizer-table td:last-child {
        display: block;
        padding-top: 12px;
    }

    .voucher-table td:last-child::before,
    .voucher-user-table td:last-child::before,
    .voucher-group-table td:last-child::before,
    .event-table td:last-child::before,
    .webhook-table td:last-child::before,
    .organizer-table td:last-child::before {
        display: none;
    }

    .voucher-table .row-actions,
    .voucher-user-table .row-actions,
    .voucher-group-table .row-actions,
    .event-table .row-actions,
    .webhook-table .row-actions,
    .organizer-table .row-actions {
        display: grid;
        grid-template-columns: repeat(1, minmax(0, 1fr));
        width: 100%;
    }

    .event-table .row-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .voucher-table .icon-action,
    .voucher-user-table .icon-action,
    .voucher-group-table .icon-action,
    .event-table .icon-action,
    .webhook-table .icon-action,
    .organizer-table .icon-action {
        width: 100%;
    }
}
