:root {
    --sidebar-width: 16rem;
    --content-max: 1600px;
    --gold: #C9A227;
    --gold-light: #E8D48B;
    --gold-dark: #9A7B1A;
    --black: #0A0A0A;
    --text: #1a1a1a;
    --text-muted: #6b7280;
    --bg-page: #f0f0f0;
    --bg-container: #ffffff;
    --bg-sidebar: #ffffff;
    --border: #e5e0d4;
    --border-gold: rgba(201, 162, 39, 0.45);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --accent-blue: #2563eb;
    --accent-green: #059669;
    --accent-red: #dc2626;
    --accent-purple: #7c3aed;
}

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

body {
    color: var(--text);
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

@media (min-width: 1024px) {
    body.sidebar-open {
        overflow: auto;
    }
}

/* Layout */
.page-bg {
    background: var(--bg-page);
    color: var(--text);
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-gold);
    box-shadow: var(--shadow);
}

.topbar {
    background: var(--bg-container);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Navegação */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all 0.2s;
}
.nav-link:hover {
    background: rgba(201, 162, 39, 0.12);
    color: var(--gold-dark);
}
.nav-link.active {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.18), rgba(201, 162, 39, 0.06));
    color: var(--gold-dark);
    font-weight: 600;
    border-left: 3px solid var(--gold);
}

.nav-group-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.nav-group-toggle .nav-chevron {
    opacity: 0.6;
}
.nav-group--open .nav-group-toggle .nav-chevron {
    transform: rotate(180deg);
}
.nav-submenu {
    display: none;
    margin: 0.25rem 0 0.5rem 0.5rem;
    padding-left: 0.75rem;
    border-left: 2px solid rgba(201, 162, 39, 0.2);
}
.nav-group--open .nav-submenu {
    display: block;
}
.nav-link--child {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}
.nav-link--nested {
    padding-left: 1.5rem;
    font-size: 0.75rem;
    opacity: 0.92;
}
.nav-link--nested::before {
    content: '↳';
    margin-right: 0.35rem;
    opacity: 0.5;
}
.nav-link--cat {
    padding-left: 2rem;
    font-size: 0.7rem;
    opacity: 0.88;
}
.nav-link--cat::before {
    content: '•';
    margin-right: 0.35rem;
    opacity: 0.45;
}
.nav-link--cat-empty {
    padding-left: 2rem;
    font-size: 0.65rem;
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.ce-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.ce-badge--normal { background: #dcfce7; color: #166534; }
.ce-badge--baixo { background: #fef3c7; color: #b45309; }
.ce-badge--sem { background: #fee2e2; color: #b91c1c; }
tr.ce-row--baixo { background: rgba(245, 158, 11, 0.06); }
tr.ce-row--sem { background: rgba(220, 38, 38, 0.06); }

/* Containers brancos */
.card {
    background: var(--bg-container);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    color: var(--text);
}

.stat-card {
    background: var(--bg-container);
    border: 1px solid var(--border-gold);
    border-radius: 0.75rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.2) 0%, transparent 70%);
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}
.stat-card .stat-value {
    color: var(--text);
}
.stat-card .stat-value-gold {
    color: var(--gold-dark);
}

/* Botões */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-gold:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.35);
}

.btn-outline {
    border: 1px solid var(--gold);
    color: var(--gold-dark);
    background: transparent;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}
.btn-outline:hover {
    background: rgba(201, 162, 39, 0.1);
}

.btn-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}
.btn-green:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.35);
}
.btn-green:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Formulários */
.input-field {
    width: 100%;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-field:focus {
    outline: none;
    border-color: var(--gold);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
.input-field::placeholder {
    color: #9ca3af;
}

.label-field {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Títulos de seção */
.section-title {
    color: var(--gold-dark);
    font-weight: 600;
}

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

.text-gold-accent {
    color: var(--gold-dark);
    font-weight: 600;
}

/* Badges de status — cores de destaque */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-preparacao { background: #e0f2fe; color: #0369a1; border: 1px solid #38bdf8; }
.badge-enviado { background: #ede9fe; color: #6d28d9; border: 1px solid #8b5cf6; }
.badge-entregue { background: #d1fae5; color: #047857; border: 1px solid #059669; }
.badge-chamado_aberto { background: #fef3c7; color: #b45309; border: 1px solid #f59e0b; }
.badge-extraviado { background: #ffedd5; color: #c2410c; border: 1px solid #ea580c; }
.badge-cancelado { background: #fee2e2; color: #b91c1c; border: 1px solid #dc2626; }

/* Tabelas */
.table-biotech {
    width: 100%;
    font-size: 0.875rem;
    color: var(--text);
}
.table-biotech thead {
    background: #faf8f3;
    border-bottom: 2px solid var(--border-gold);
}
.table-biotech th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
}
.table-biotech td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0ebe0;
}
.table-biotech tbody tr:hover {
    background: rgba(201, 162, 39, 0.06);
}

/* Tabela responsiva */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-produtos {
    min-width: 720px;
}

.table-produtos .col-acoes {
    min-width: 13.5rem;
    white-space: nowrap;
    vertical-align: middle;
}


/* Botões de ação com ícones (Heroicons + Tailwind) */
.prod-action-btn {
    cursor: pointer;
    flex-shrink: 0;
}

/* Produtos — layout mobile */
.produtos-table-card {
    padding: 0;
    overflow: hidden;
}

.produtos-table-wrap {
    padding: 0;
}

.produtos-paginacao {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}


.produto-card {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    background: #fff;
}

.produto-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.produto-card__prices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.produto-card .flex {
    justify-content: flex-end;
}

.pedido-card .produto-card__head .badge {
    flex-shrink: 0;
}

@media (max-width: 1023px) {
    .table-produtos .col-atacado {
        display: none;
    }
}

@media (max-width: 767px) {
    .table-produtos .col-fabricante,
    .table-produtos .col-atacado {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .produtos-layout {
        grid-template-columns: 1fr;
    }

    .produtos-detail-card {
        order: -1;
    }
}

/* Toasts */
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
}
.toast-success { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.toast-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.toast-info { background: #fffbeb; color: var(--gold-dark); border: 1px solid var(--border-gold); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Modais */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-content {
    background: var(--bg-container);
    border: 1px solid var(--border-gold);
    border-radius: 0.75rem;
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    color: var(--text);
}

/* Alertas */
.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}
.alert-info {
    background: #fffbeb;
    border: 1px solid var(--border-gold);
    color: var(--gold-dark);
}

/* Estoque baixo */
.row-low-stock {
    background: #fef2f2 !important;
}
.stock-low {
    color: var(--accent-red);
    font-weight: 700;
}
.stock-ok {
    color: var(--gold-dark);
    font-weight: 600;
}

/* Logo da empresa */
.brand-logo {
    display: block;
    object-fit: contain;
    max-width: 100%;
    height: auto;
}
.brand-logo--sidebar {
    max-height: 96px;
    max-width: 280px;
}
.brand-logo--topbar {
    max-height: 52px;
    max-width: 200px;
}
.brand-logo--login {
    max-height: 120px;
    max-width: 360px;
}
.brand-logo--preview {
    max-height: 100px;
    max-width: 320px;
}

/* Login */
.login-page {
    background: linear-gradient(160deg, #f5f5f5 0%, #fff 40%, #faf6eb 100%);
}
.login-brand {
    color: var(--gold-dark);
}
.login-card {
    background: var(--bg-container);
    border: 1px solid var(--border-gold);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Dashboard — gráficos compactos */
.chart-card-compact {
    padding: 0.875rem 1rem !important;
}
.chart-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gold-dark);
    margin-bottom: 0.5rem;
}
.chart-wrap {
    position: relative;
    height: 140px;
    width: 100%;
}
.chart-wrap--donut {
    height: 150px;
}

/* Autocomplete / typeahead */
.search-bar-wrap {
    position: relative;
    width: 100%;
    max-width: 28rem;
}
.search-bar-wrap .typeahead-wrap input {
    padding-left: 2.25rem;
}
.search-bar-wrap::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    z-index: 2;
    opacity: 0.45;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239A7B1A'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center/contain no-repeat;
    pointer-events: none;
}
.typeahead-wrap {
    position: relative;
    width: 100%;
}
.typeahead-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-gold);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.typeahead-list.hidden {
    display: none;
}
.typeahead-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 1px solid #f0ebe0;
    color: var(--text);
}
.typeahead-item:hover,
.typeahead-item:focus {
    background: rgba(201, 162, 39, 0.12);
    outline: none;
}
.typeahead-item:last-child {
    border-bottom: none;
}
.typeahead-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
}
.typeahead-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}
.typeahead-empty {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}
.typeahead-loading {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--gold-dark);
    text-align: center;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* Paginação */
.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
}
.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}
.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}
.pagination-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg-container);
    color: var(--text);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pagination-btn:hover:not(:disabled):not(.is-active) {
    border-color: var(--gold);
    color: var(--gold-dark);
}
.pagination-btn.is-active {
    background: var(--gold);
    border-color: var(--gold);
    color: #fff;
    font-weight: 600;
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination-ellipsis {
    padding: 0 0.35rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   Layout responsivo — todas as telas
   ========================================================================== */

.app-shell {
    width: 100%;
    max-width: 100vw;
}

.app-main {
    isolation: isolate;
}

.app-content {
    box-sizing: border-box;
}

.app-sidebar {
    max-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.app-topbar {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0));
}

.topbar-meta {
    line-height: 1.3;
}

.topbar-user__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .topbar-user__name {
        font-size: 0.875rem;
        max-width: 16rem;
    }
}

.topbar-user__meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

@media (min-width: 640px) {
    .topbar-user__meta {
        font-size: 0.75rem;
    }
}

.topbar-user__perfil {
    font-weight: 600;
    color: var(--gold-dark);
}

.topbar-user__logout {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.topbar-user__logout:hover {
    color: var(--gold-dark);
}

.topbar-meta__divider {
    width: 1px;
    height: 2rem;
    background: var(--border);
    flex-shrink: 0;
}

.topbar-datetime {
    flex-shrink: 0;
}

.app-toasts {
    right: max(1rem, env(safe-area-inset-right, 0));
    bottom: max(1rem, env(safe-area-inset-bottom, 0));
    left: auto;
    max-width: min(24rem, calc(100vw - 2rem));
}

/* Toolbar padrão: busca + botão */
.page-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .page-toolbar {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.page-toolbar__start {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.page-toolbar__cta {
    flex-shrink: 0;
    width: 100%;
    text-align: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .page-toolbar__cta {
        width: auto;
    }
}

/* Filtros (pedidos) */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.filter-panel__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filter-panel__period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
    .filter-panel__period {
        width: auto;
        padding-top: 0;
        border-top: none;
        border-left: 1px solid var(--border);
        padding-left: 0.75rem;
        margin-left: 0.25rem;
    }
}

.filter-panel .input-field {
    min-width: 0;
}

.filter-panel select.input-field {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 480px) {
    .filter-panel select.input-field {
        width: auto;
        min-width: 10rem;
    }
}

.filter-panel input[type="date"].input-field {
    flex: 1 1 8.5rem;
    max-width: 100%;
}

.repasses-filtros-row {
    align-items: flex-end;
    width: 100%;
}

.repasses-filtro-field {
    flex: 1 1 10rem;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 640px) {
    .repasses-filtro-field {
        flex: 0 1 auto;
        min-width: 11rem;
    }

    .repasses-filtro-field--action {
        flex: 0 0 auto;
        min-width: auto;
    }
}

.search-bar-wrap {
    max-width: 100%;
}

@media (min-width: 640px) {
    .search-bar-wrap {
        max-width: 28rem;
    }
}

/* Cards com tabela */
.card-table {
    padding: 0;
    overflow: hidden;
}

.card-table .table-responsive {
    margin: 0;
}

.pedidos-grid-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.pedidos-grid-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
}

@media (min-width: 768px) {
    .pedidos-grid-header__actions {
        width: auto;
    }
}

.card-table .table-biotech {
    min-width: 640px;
}

.card-table .table-biotech--wide {
    min-width: 900px;
}

.card-table .pagination-bar,
.card-table .produtos-paginacao,
.card-table > [id$="-paginacao"] {
    padding: 1rem 1.25rem;
    margin-top: 0;
    border-top: 1px solid var(--border);
}

.comissao-vendedor-card {
    min-height: 100%;
}
.comissao-vendedor-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #f5f0e1 0%, #e8d48b 100%);
    color: #9A7B1A;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .dashboard-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 100%;
}

@media (min-width: 768px) {
    .dashboard-charts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .dashboard-charts {
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
}

.dashboard-grid .card-table,
.dashboard-grid .card {
    width: 100%;
    min-width: 0;
}

.dashboard-grid .table-biotech--wide {
    width: 100%;
    min-width: 0;
}

/* Pedido — formulário e itens */
.pedido-flow {
    width: 100%;
    max-width: 64rem;
}

.pedido-resumo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .pedido-resumo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.add-item-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
}

.add-item-bar .search-bar-wrap {
    flex: 1 1 12rem;
    min-width: min(100%, 12rem);
}

/* Modais em telas pequenas */
@media (max-width: 639px) {
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        max-height: 92dvh;
        border-radius: 1rem 1rem 0 0;
        margin: 0;
    }
}

/* Paginação mobile */
@media (max-width: 479px) {
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination-controls {
        justify-content: center;
    }
}

/* Login */
.login-page {
    padding: env(safe-area-inset-top, 1rem) env(safe-area-inset-right, 1rem) env(safe-area-inset-bottom, 1rem) env(safe-area-inset-left, 1rem);
}

.login-card {
    padding: clamp(1.25rem, 4vw, 2rem);
}

/* Configurações — largura fluida */
.config-page {
    width: 100%;
    max-width: 42rem;
}

.config-page--wide {
    max-width: 56rem;
}

/* Utilitários */
.w-full-min {
    width: 100%;
    min-width: 0;
}

.overflow-touch {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
