﻿*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f5f5;
    color: #222;
    overflow-x: hidden;
}

body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.9rem;
    background:
        radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.18), transparent 40%),
        radial-gradient(circle at 86% 22%, rgba(34, 197, 94, 0.16), transparent 36%),
        linear-gradient(135deg, #e9f5ff 0%, #f3f9ff 48%, #eefbf3 100%);
}

.app {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.login-page .app {
    width: min(100%, 980px);
    max-width: 980px;
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
    margin-top: 0;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #e6edf5;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 1.25rem;
    letter-spacing: 0.01em;
    color: #163a5f;
}

.admin-user-box {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    background: #f5f9ff;
    border: 1px solid #d7e5f6;
    border-radius: 999px;
    padding: 0.3rem 0.45rem 0.3rem 0.7rem;
}

.admin-user-text {
    font-size: 0.9rem;
    color: #444;
}

.admin-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.admin-role-badge.role-suporte {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #a5d6a7;
}

.admin-role-badge.role-administrador {
    background: #e3f2fd;
    color: #0d47a1;
    border-color: #90caf9;
}

.admin-role-badge.role-operador {
    background: #fff3e0;
    color: #e65100;
    border-color: #ffcc80;
}

.admin-logout-form {
    margin: 0;
    display: inline-flex;
}

.admin-company-switch-form {
    gap: 0.4rem;
}

.admin-company-switch-select {
    width: auto;
    min-width: 190px;
}

.admin-company-active-note {
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.login-page .card {
    border-radius: 16px;
    padding: 1.6rem;
    border: 1px solid #d4e6f8;
    box-shadow: 0 20px 46px rgba(17, 60, 96, 0.14);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(4px);
    margin-bottom: 0.75rem;
}

.login-shell {
    display: grid;
    gap: 0.9rem;
}

.login-hero {
    border-radius: 18px;
    border: 1px solid #cfe7dc;
    background: linear-gradient(140deg, #f6fffb 0%, #eef8ff 100%);
    padding: 1.25rem;
}

.login-hero .login-brand {
    margin-bottom: 0.5rem;
}

.login-hero-text {
    max-width: 40ch;
}

.login-hero-badges {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
}

.login-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #b9d9f2;
    background: #ffffff;
    color: #21537c;
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.login-mode-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.14rem 0.6rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
}

.login-mode-tag.is-support {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.login-form-title {
    margin: 0.55rem 0 0.25rem 0;
}

.login-form-text {
    margin: 0 0 0.7rem 0;
}

.login-form {
    gap: 0.82rem;
}

.login-alt-link {
    margin-top: 0.65rem;
    font-size: 0.9rem;
}

.login-alt-link a {
    color: #1668c0;
    text-decoration: none;
    font-weight: 600;
}

.login-alt-link a:hover {
    text-decoration: underline;
}

.login-brand {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #ebf3ff;
    border: 1px solid #c9dcff;
    color: #1758a8;
    font-size: 0.8rem;
    font-weight: 600;
}

.login-title {
    margin-bottom: 0.4rem;
}

form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #273648;
    min-width: 0;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="time"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.65rem;
    border-radius: 0.4rem;
    border: 1px solid #c9d3df;
    background: #fff;
    font-size: 0.95rem;
    color: #1f2d3a;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #5b9fe2;
    box-shadow: 0 0 0 3px rgba(91, 159, 226, 0.18);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

button {
    padding: 0.55rem 0.9rem;
    border-radius: 0.3rem;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1e88e5;
    color: #fff;
    border: none;
    text-decoration: none;
    padding: 0 0.95rem;
    min-width: 96px;
    width: auto;
    min-height: 38px;
    font-size: 0.95rem;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
}

.btn-primary:hover {
    background: #1565c0;
}

.login-page input[type="email"],
.login-page input[type="password"] {
    background: #f7f9ff;
    border-color: #c8d8ff;
}

.login-page input[type="email"]:focus,
.login-page input[type="password"]:focus {
    outline: none;
    border-color: #4f8df0;
    box-shadow: 0 0 0 3px rgba(79, 141, 240, 0.18);
}

.login-page .btn-primary {
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, #1773cc 0%, #0f5ca7 100%);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2e7d32;
    color: #fff;
    border: none;
    text-decoration: none;
    padding: 0 0.9rem;
    min-width: 96px;
    width: auto;
    min-height: 38px;
    border-radius: 0.3rem;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #1b5e20;
}

.btn-highlight-green {
    background: #1f9d45;
    box-shadow: 0 0 0 2px rgba(31, 157, 69, 0.18);
}

.btn-highlight-green:hover {
    background: #16853a;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d32f2f;
    color: #fff;
    padding: 0 0.9rem;
    min-width: 96px;
    width: auto;
    min-height: 38px;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

.btn-danger:hover {
    background: #b71c1c;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.flash--error {
    background: #ffebee;
    color: #c62828;
}

.flash--success {
    background: #e8f5e9;
    color: #2e7d32;
}

.admin-menu {
    background: linear-gradient(180deg, #f7fbff 0%, #f4f9ff 100%);
    border: 1px solid #dce9f7;
    border-radius: 12px;
    padding: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: center;
}

.admin-menu a,
.admin-submenu-row a,
.admin-submenu-toggle {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #c7d9ec;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    color: #23415d;
    background: #ffffff;
    transition: all 0.18s ease;
}

.admin-menu a,
.admin-submenu-row a,
.admin-submenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.nav-glyph {
    width: 1rem;
    min-width: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.9;
}

.admin-menu a:hover,
.admin-submenu-row a:hover,
.admin-submenu-toggle:hover {
    border-color: #9fc3e9;
    background: #eef6ff;
    transform: translateY(-1px);
}

.admin-menu a.is-active,
.admin-submenu-row a.is-active,
.admin-submenu-toggle.is-active {
    background: linear-gradient(135deg, #1e88e5 0%, #176cc2 100%);
    color: #fff;
    border-color: #176cc2;
    box-shadow: 0 6px 16px rgba(30, 136, 229, 0.22);
}

.admin-submenu-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: inherit;
}

.admin-menu-wrap {
    display: block;
}

.admin-submenu-row {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
    padding: 0.6rem;
    border-radius: 12px;
    border: 1px dashed #d3e2f1;
    background: #fbfdff;
}

.admin-submenu-row.is-open {
    display: flex;
}

.admin-submenu-row a {
    background: #eef8f0;
    color: #fff;
    border-color: #b8e0be;
    color: #14532d;
}

.admin-submenu-row a:hover {
    background: #dff3e4;
    border-color: #8dc89a;
}

.admin-submenu-row a.is-active {
    background: linear-gradient(135deg, #1e88e5 0%, #176cc2 100%);
    border-color: #176cc2;
    color: #fff;
}

.admin-submenu {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.text-muted {
    color: #666;
    font-size: 0.9rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.table-scroll table {
    min-width: 1280px;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.62rem;
    vertical-align: middle;
}

th {
    background: #eee;
    text-align: left;
}

.grid-2 {
    display: grid;
    gap: 1rem;
}

.crud-form {
    gap: 0.9rem;
    margin-top: 0;
}

.crud-section {
    border: 1px solid #e3eaf2;
    border-radius: 10px;
    padding: 1rem;
    background: linear-gradient(180deg, #fdfefe 0%, #f8fbff 100%);
}

.crud-section-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #1f344b;
}

.crud-grid-2,
.crud-grid-3 {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.crud-grid-2 > *,
.crud-grid-3 > * {
    min-width: 0;
}

.crud-grid-2 .full-width,
.crud-grid-3 .full-width {
    grid-column: 1 / -1;
}

.crud-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

.crud-actions .btn-primary,
.crud-actions .btn-secondary,
.crud-actions .btn-danger {
    min-width: 136px;
    min-height: 40px;
}

.crud-form .field-with-button {
    gap: 0.55rem;
}

.crud-form .crud-grid-2 label,
.crud-form .crud-grid-3 label {
    margin: 0;
}

.crud-form .crud-grid-2 input[type="text"],
.crud-form .crud-grid-2 input[type="tel"],
.crud-form .crud-grid-2 input[type="email"],
.crud-form .crud-grid-2 input[type="password"],
.crud-form .crud-grid-2 input[type="date"],
.crud-form .crud-grid-2 input[type="number"],
.crud-form .crud-grid-2 input[type="time"],
.crud-form .crud-grid-2 select,
.crud-form .crud-grid-2 textarea,
.crud-form .crud-grid-3 input[type="text"],
.crud-form .crud-grid-3 input[type="tel"],
.crud-form .crud-grid-3 input[type="email"],
.crud-form .crud-grid-3 input[type="password"],
.crud-form .crud-grid-3 input[type="date"],
.crud-form .crud-grid-3 input[type="number"],
.crud-form .crud-grid-3 input[type="time"],
.crud-form .crud-grid-3 select,
.crud-form .crud-grid-3 textarea {
    width: 100%;
}

.crud-search-form {
    gap: 0.6rem;
}

.crud-search-form .actions-row {
    margin-top: 0.1rem;
}

.actions-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.actions-row form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
}

.actions-row form .btn-primary,
.actions-row form .btn-secondary,
.actions-row form .btn-danger,
.actions-row form button {
    min-height: 40px;
}

.actions-row input[type="text"],
.actions-row input[type="email"],
.actions-row input[type="number"],
.actions-row input[type="date"],
.actions-row input[type="time"],
.actions-row select {
    flex: 1 1 220px;
    min-width: 160px;
}

.actions-row .btn-primary,
.actions-row .btn-secondary,
.actions-row .btn-danger,
.actions-row button {
    width: auto;
    min-width: 110px;
    min-height: 38px;
    padding: 0 0.9rem;
    font-size: 0.92rem;
    white-space: nowrap;
}

.crud-card {
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 40, 70, 0.06);
}

.crud-card > h2,
.crud-card > h3 {
    margin-bottom: 0.35rem;
    color: #173654;
}

.crud-card > .text-muted {
    margin-top: 0.1rem;
    margin-bottom: 0.8rem;
}

.crud-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d7e3f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.crud-table thead th {
    background: #edf4fb;
    color: #1d3853;
    font-weight: 700;
    border-bottom: 1px solid #d0dcea;
}

.crud-table tbody tr:nth-child(even) {
    background: #f9fcff;
}

.crud-table tbody tr:hover {
    background: #f1f7ff;
}

.crud-table td,
.crud-table th {
    border-right: 1px solid #e2eaf3;
}

.crud-table td:last-child,
.crud-table th:last-child {
    border-right: 0;
}

.event-address-row {
    display: grid;
    grid-template-columns: minmax(100px, 0.8fr) minmax(180px, 1.8fr);
    gap: 0.5rem;
    align-items: end;
}

.event-city-state-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.9fr) minmax(72px, 0.7fr);
    gap: 0.5rem;
    align-items: end;
}

.client-freight-note {
    background: #f1f3f5;
    border: 1px solid #e1e5ea;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.is-hidden {
    display: none;
}

.no-margin {
    margin: 0;
}

.u-mb-1 {
    margin-bottom: 1rem;
}

.u-mb-075 {
    margin-bottom: 0.75rem;
}

.u-mt-1 {
    margin-top: 1rem;
}

.u-mt-075 {
    margin-top: 0.75rem;
}

.u-mt-0 {
    margin-top: 0;
}

.u-m-0 {
    margin: 0;
}

.u-my-1 {
    margin: 1rem 0;
}

.u-mb-09 {
    margin-bottom: 0.9rem;
}

.u-mb-065 {
    margin-bottom: 0.65rem;
}

.u-mb-06 {
    margin-bottom: 0.6rem;
}

.u-mb-055 {
    margin-bottom: 0.55rem;
}

.u-mb-05 {
    margin-bottom: 0.5rem;
}

.u-mb-035 {
    margin-bottom: 0.35rem;
}

.u-mt-09 {
    margin-top: 0.9rem;
}

.u-mt-08 {
    margin-top: 0.8rem;
}

.u-mt-055 {
    margin-top: 0.55rem;
}

.u-mt-05 {
    margin-top: 0.5rem;
}

.u-mt-045 {
    margin-top: 0.45rem;
}

.u-mt-035 {
    margin-top: 0.35rem;
}

.u-mt-025 {
    margin-top: 0.25rem;
}

.no-mt {
    margin-top: 0;
}

.btn-inline {
    width: auto;
    padding: 0 0.9rem;
}

.btn-inline-block {
    display: inline-block;
}

.btn-inline-sm {
    width: auto;
    padding: 0 0.8rem;
}

.btn-inline-xs {
    width: auto;
    padding: 0.2rem 0.7rem;
}

.btn-fixed-140 {
    width: 140px;
    padding: 0 0.9rem;
}

.btn-inline-nowrap {
    width: auto;
    padding: 0 0.9rem;
    white-space: nowrap;
}

.customer-main-grid .customer-doc-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) 220px;
    gap: 0.6rem;
    align-items: end;
}

@media (max-width: 900px) {
    .customer-main-grid .customer-doc-row {
        grid-template-columns: 1fr;
    }
}

.supplier-main-grid .supplier-top-row,
.supplier-main-grid .supplier-contact-row,
.supplier-main-grid .supplier-address-row,
.supplier-main-grid .supplier-location-row {
    grid-column: 1 / -1;
    display: grid;
    gap: 0.6rem;
    align-items: end;
}

.supplier-main-grid .supplier-top-row {
    grid-template-columns: 180px minmax(240px, 1fr) 180px minmax(220px, 1fr);
}

.supplier-main-grid .supplier-contact-row {
    grid-template-columns: 180px minmax(180px, 1fr) minmax(220px, 1fr);
}

.supplier-main-grid .supplier-address-row {
    grid-template-columns: 140px minmax(220px, 1fr) 120px minmax(220px, 1fr);
}

.supplier-main-grid .supplier-location-row {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) 120px;
}

@media (max-width: 1100px) {
    .supplier-main-grid .supplier-top-row,
    .supplier-main-grid .supplier-contact-row,
    .supplier-main-grid .supplier-address-row,
    .supplier-main-grid .supplier-location-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .supplier-main-grid .supplier-top-row,
    .supplier-main-grid .supplier-contact-row,
    .supplier-main-grid .supplier-address-row,
    .supplier-main-grid .supplier-location-row {
        grid-template-columns: 1fr;
    }
}

.print-density-control {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 0.3rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #d5dbe5;
    border-radius: 999px;
    background: #f7f9fc;
}

.print-density-control label {
    margin: 0;
    font-size: 0.88rem;
    color: #374151;
    white-space: nowrap;
}

.actions-row .print-density-control input[type="number"] {
    flex: 0 0 84px;
    width: 84px;
    min-width: 84px;
    max-width: 84px;
    text-align: center;
    min-height: 36px;
    padding: 0 0.35rem;
}

.print-density-suffix {
    font-size: 0.85rem;
    color: #4b5563;
    white-space: nowrap;
}

.print-density-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e8eef9;
    color: #2d5aa6;
    font-size: 12px;
    margin-right: 0.2rem;
}

.print-actions-row {
    align-items: center;
}

.print-layout-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #d5dbe5;
    border-radius: 999px;
    background: #f7f9fc;
}

.print-layout-control label {
    margin: 0;
    font-size: 0.88rem;
    color: #374151;
    white-space: nowrap;
}

.actions-row .print-layout-control select {
    flex: 0 0 auto;
    width: auto;
    min-width: 200px;
    min-height: 36px;
}

@media (max-width: 768px) {
    .print-actions-row {
        align-items: stretch;
    }

    .print-actions-row .print-density-control {
        width: 100%;
        justify-content: flex-start;
    }

    .print-actions-row .print-layout-control {
        width: 100%;
        justify-content: flex-start;
    }

    .actions-row .print-layout-control select {
        min-width: 0;
        width: 100%;
    }
}

.btn-mini {
    min-height: 24px;
    padding: 0 6px;
    font-size: 11px;
    width: auto;
}

.btn-mini-primary {
    background: #1b8f3a;
    color: #fff;
    border-color: #1b8f3a;
}

.overflow-auto {
    overflow: auto;
}

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

.activity-logs-wrap {
    overflow-x: auto;
}

.activity-col-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.9rem;
    align-items: center;
    margin: 0.25rem 0 0.7rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #d7e3f0;
    border-radius: 8px;
    background: #f7fbff;
    font-size: 0.86rem;
}

.activity-col-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.activity-logs-table {
    min-width: 1020px;
    table-layout: auto;
}

.activity-logs-table th,
.activity-logs-table td {
    font-size: 0.84rem;
    padding: 0.48rem 0.42rem;
    vertical-align: top;
}

.activity-logs-table th:nth-child(1),
.activity-logs-table td:nth-child(1) {
    width: 56px;
    white-space: nowrap;
}

.activity-logs-table th:nth-child(2),
.activity-logs-table td:nth-child(2) {
    width: 138px;
    white-space: nowrap;
}

.activity-logs-table th:nth-child(4),
.activity-logs-table td:nth-child(4),
.activity-logs-table th:nth-child(5),
.activity-logs-table td:nth-child(5),
.activity-logs-table th:nth-child(7),
.activity-logs-table td:nth-child(7),
.activity-logs-table th:nth-child(9),
.activity-logs-table td:nth-child(9) {
    white-space: nowrap;
}

.activity-logs-table th:nth-child(8),
.activity-logs-table td:nth-child(8) {
    min-width: 280px;
    max-width: 420px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .activity-col-controls {
        gap: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }
    .activity-logs-table {
        min-width: 900px;
    }
}

.products-manage-wrap {
    overflow-x: auto;
}

.products-manage-table {
    min-width: 1500px !important;
    width: 100%;
    table-layout: auto;
}

.products-manage-table th,
.products-manage-table td {
    padding: 0.45rem 0.4rem;
    font-size: 0.85rem;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.products-manage-table th:nth-child(1),
.products-manage-table td:nth-child(1) {
    width: 14%;
}

.products-manage-table th:nth-child(2),
.products-manage-table td:nth-child(2) {
    width: 7%;
    text-align: center;
}

.products-manage-table th:nth-child(11),
.products-manage-table td:nth-child(11) {
    width: 8%;
}

.products-manage-table th:nth-child(12),
.products-manage-table td:nth-child(12) {
    width: 16%;
    min-width: 246px;
}

.products-manage-table .product-list-thumb {
    width: 44px;
    height: 44px;
}

.products-manage-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: stretch;
    min-width: 220px;
}

.products-manage-actions .btn-primary,
.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions button,
.products-manage-actions form {
    width: 100%;
    min-width: 0;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form button {
    min-height: 38px;
    padding: 0 0.75rem;
    white-space: nowrap;
    justify-content: center;
}

html {
    scroll-behavior: smooth;
}

.section-focus-flash {
    box-shadow: 0 0 0 3px rgba(43, 135, 232, 0.25), 0 12px 24px rgba(16, 62, 108, 0.12) !important;
    transition: box-shadow 0.25s ease;
}

.table-scroll-220 {
    max-height: 220px;
    overflow: auto;
}

.p-08 {
    padding: 0.8rem;
}

.p-075 {
    padding: 0.75rem;
}

.u-mb-08 {
    margin-bottom: 0.8rem;
}

.company-select {
    width: 100%;
    max-width: 360px;
}

.company-select-wide {
    width: 100%;
    max-width: 420px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.inline-check-gap {
    margin: 0.35rem 0;
    gap: 0.5rem;
}

.smtp-provider-help {
    margin: 0.35rem 0 0.75rem 0;
}

.card-success-border {
    border: 2px solid #2e7d32;
}

.btn-company-delete {
    width: 196px;
    max-width: 100%;
    padding: 0 0.9rem;
    white-space: nowrap;
}

.product-main-thumb {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #f6f6f6;
}

.mass-preview-wrap {
    margin-top: 0.9rem;
}

.mass-preview-title {
    margin: 0 0 0.45rem 0;
}

.mass-preview-summary {
    margin-bottom: 0.45rem;
}

.product-list-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.product-gallery {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.product-gallery-item {
    display: grid;
    gap: 4px;
}

.product-gallery-thumb {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f6f6f6;
}

.product-gallery-thumb.is-primary {
    border-color: #1b8f3a;
}

.file-list-scroll {
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    background: #fafafa;
}

.file-list-scroll-lg {
    max-height: 180px;
}

.file-list-scroll-md {
    max-height: 160px;
}

.font-mono-sm {
    font-family: monospace;
    font-size: 0.83rem;
}

.hash-cell {
    font-family: monospace;
    word-break: break-all;
}

.damage-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 8px;
}

.finance-chart-month {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.finance-chart-stack {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.finance-chart-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.finance-chart-progress {
    height: 10px;
    width: min(100%, 260px);
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}

.finance-chart-progress::-webkit-progress-bar {
    background: #e5e7eb;
    border-radius: 999px;
}

.finance-chart-progress::-webkit-progress-value {
    border-radius: 999px;
}

.finance-chart-progress::-moz-progress-bar {
    border-radius: 999px;
}

.finance-chart-progress--receber::-webkit-progress-value {
    background: #2e7d32;
}

.finance-chart-progress--receber::-moz-progress-bar {
    background: #2e7d32;
}

.finance-chart-progress--pagar::-webkit-progress-value {
    background: #c62828;
}

.finance-chart-progress--pagar::-moz-progress-bar {
    background: #c62828;
}

.finance-chart-progress--saldo::-webkit-progress-value {
    background: #1565c0;
}

.finance-chart-progress--saldo::-moz-progress-bar {
    background: #1565c0;
}

.finance-chart-label {
    width: 56px;
    font-size: 0.8rem;
}

.finance-chart-label--receber {
    color: #2e7d32;
}

.finance-chart-label--pagar {
    color: #c62828;
}

.finance-chart-label--saldo {
    color: #1565c0;
}

.finance-chart-value {
    font-size: 0.8rem;
}

.text-success {
    color: #2e7d32;
}

.text-danger {
    color: #c62828;
}

.text-sm {
    font-size: 0.82rem;
}

.selected-items-list {
    display: grid;
    gap: 0.5rem;
}

.client-order-summary {
    margin-top: 0.75rem;
    border: 1px solid #d9e7f5;
    border-radius: 10px;
    background: #f8fbff;
    padding: 0.7rem;
}

.client-order-summary--focus {
    border-color: #5aa0db;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.28), 0 8px 20px rgba(22, 58, 95, 0.12);
    animation: clientSummaryPulse 0.55s ease-in-out 2;
}

.client-order-summary__title {
    margin: 0 0 0.45rem 0;
    font-size: 1rem;
    color: #184264;
}

.client-order-summary__total {
    margin-top: 0.55rem;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #c7dcf0;
    background: #eaf4ff;
    color: #123a5a;
    font-weight: 700;
}

.client-order-empty {
    border: 1px dashed #c6d6e8;
    border-radius: 8px;
    padding: 0.6rem;
    color: #5a6b79;
    background: #ffffff;
}

.selected-item-row {
    margin: 0;
    border: 1px solid #d8e4f1;
    border-radius: 8px;
    background: #fff;
    padding: 0.55rem;
    align-items: center;
}

.selected-item-info {
    flex: 1 1 auto;
    min-width: 0;
}

.selected-item-title {
    font-weight: 700;
    color: #1b3650;
    margin-bottom: 0.12rem;
}

.selected-item-meta {
    font-size: 0.84rem;
    color: #4f6376;
}

.selected-item-qty {
    width: 84px;
    text-align: center;
}

#order-lock-warning a {
    font-weight: 700;
}

body.client-page details {
    margin: 0.45rem 0;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    background: #f8fbff;
}

body.client-page details > summary {
    cursor: pointer;
}

.client-add-feedback {
    margin-top: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #1b5e20;
    font-size: 0.88rem;
}

.client-add-feedback.is-visible {
    animation: fadeInOutSoft 1.8s ease;
}

.client-add-prompt {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 1.2rem));
    z-index: 1200;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #b9d6ee;
    background: linear-gradient(180deg, #fafdff 0%, #eef7ff 100%);
    box-shadow: 0 10px 28px rgba(22, 58, 95, 0.2);
    animation: clientPromptIn 0.2s ease-out;
}

.client-add-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 1150;
}

.client-add-prompt.client-add-prompt--anchored {
    bottom: auto;
    transform: none;
    width: min(520px, calc(100vw - 1rem));
}

.client-add-prompt__title {
    font-size: 0.98rem;
    font-weight: 700;
    color: #134165;
    margin-bottom: 0.22rem;
}

.client-add-prompt__text {
    font-size: 0.88rem;
    color: #194a72;
    margin-bottom: 0.45rem;
    line-height: 1.35;
}

.client-add-prompt__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.client-add-prompt__actions .btn-primary,
.client-add-prompt__actions .btn-secondary {
    min-height: 36px;
    padding: 0 0.8rem;
}

@keyframes clientPromptIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes clientSummaryPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
    100% { transform: translateY(0); }
}

.selected-item-row {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.selected-item-row.is-just-added {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

.client-summary-card {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.client-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.client-summary-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #cce7d1;
    background: #edf8ef;
    color: #1f7a2f;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.client-summary-values {
    display: grid;
    gap: 0.35rem;
    padding: 0.75rem;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    background: #fafbfd;
}

.client-summary-values p {
    margin: 0;
}

.client-summary-amount-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.client-summary-amount {
    display: grid;
    gap: 0.2rem;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    border: 1px solid #dce3ea;
    background: #fff;
}

.client-summary-amount--primary {
    border-color: #bcd5f7;
    background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%);
}

.client-summary-amount__label {
    color: #4d5a68;
    font-size: 0.82rem;
}

.client-summary-amount__value {
    font-size: 1.15rem;
    line-height: 1.2;
    color: #112233;
}

.client-summary-actions {
    justify-content: flex-start;
    align-items: center;
}

.client-summary-actions .btn-primary,
.client-summary-actions .btn-secondary {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 190px;
}

.client-summary-actions .btn-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.client-summary-actions .btn-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

.client-summary-pix-card {
    border: 1px solid #d9eadc;
    background: linear-gradient(180deg, #f7fcf8 0%, #ffffff 100%);
}

.client-summary-pix-grid {
    display: grid;
    gap: 0.35rem;
}

.client-summary-pix-grid p {
    margin: 0;
}

.client-summary-pix-key {
    word-break: break-word;
}

@keyframes fadeInOutSoft {
    0% { opacity: 0; transform: translateY(4px); }
    12% { opacity: 1; transform: translateY(0); }
    82% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-3px); }
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

.overlay-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.overlay-modal.is-hidden {
    display: none;
}

.overlay-modal-card {
    max-width: 760px;
    width: 100%;
    max-height: 88vh;
    overflow: auto;
}

.share-contract-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2000;
    padding: 1rem;
}

.share-contract-modal-card {
    max-width: 520px;
    margin: 6vh auto;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.share-contract-steps {
    margin: 0 0 1rem 1.1rem;
    padding: 0;
    line-height: 1.5;
}

.selected-customer-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.1rem 0.2rem 0.1rem 0;
    padding: 0.2rem 0.45rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
}

.selected-customer-chip-remove {
    border: 0;
    background: transparent;
    color: #b91c1c;
    cursor: pointer;
    font-weight: 700;
}

.session-row-foreign {
    background: #fdeaea;
}

.session-row-suspicious {
    background: #fff5e6;
}

.session-row-support {
    background: #eaf3ff;
}

.monitor-alert-tag {
    font-weight: 700;
}

.monitor-alert-tag--spaced {
    margin-left: 0.45rem;
}

.monitor-alert-tag--foreign {
    color: #b00020;
}

.monitor-alert-tag--suspicious {
    color: #b36b00;
}

.monitor-alert-tag--support {
    color: #0b4f9a;
}

.link-actions {
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.link-actions form {
    display: inline-flex;
}

.link-actions .btn-primary,
.link-actions .btn-secondary,
.link-actions .btn-danger {
    min-width: 88px;
    min-height: 36px;
    padding: 0 0.6rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.security-card {
    border-left: 6px solid #43a047;
}

.security-card--medium {
    border-left-color: #f9a825;
}

.security-card--high {
    border-left-color: #d32f2f;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.12rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1b5e20;
}

.security-badge--medium {
    background: #fff8e1;
    border-color: #ffe082;
    color: #ef6c00;
}

.security-badge--high {
    background: #ffebee;
    border-color: #ef9a9a;
    color: #b71c1c;
}

.item-row select {
    flex: 1 1 320px;
    min-width: 220px;
}

.item-row input[type="number"] {
    width: 90px;
    flex: 0 0 auto;
}

.admin-order-edit-card .item-row.actions-row {
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.admin-order-edit-card .item-row.actions-row select {
    flex: 1 1 auto;
    min-width: 180px;
}

.admin-order-edit-card .item-row.actions-row input[type="number"] {
    width: 78px;
    min-height: 36px;
    padding: 0.35rem 0.45rem;
}

.admin-order-edit-card .item-row.actions-row .btn-danger,
.admin-order-edit-card .item-row.actions-row .btn-secondary,
.admin-order-edit-card .item-row.actions-row .btn-primary {
    min-height: 36px;
    padding: 0 0.7rem;
}

.checkbox-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.field-with-button {
    display: grid;
    gap: 0.5rem;
}

.field-with-button .btn-secondary {
    width: auto;
}

.product-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 240px);
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
    scroll-snap-type: x mandatory;
}

.product-card {
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fff;
    padding: 0.55rem;
    display: grid;
    gap: 0.35rem;
    scroll-snap-align: start;
    width: 210px;
    min-width: 210px;
    box-sizing: border-box;
    position: relative;
}

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

.client-offer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid #ffd37d;
    background: #fff6df;
    color: #8a4b00;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-card__offer {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
}

.product-card__image-wrap {
    width: 100%;
    height: 90px;
    border-radius: 6px;
    border: 1px solid #efefef;
    overflow: hidden;
    background: #fff;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.product-card__no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 0.85rem;
}

.product-card__name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
}

.product-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.product-gallery-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.product-gallery-modal__dialog {
    position: relative;
    width: min(94vw, 520px);
    max-height: 88vh;
    margin: 6vh auto;
    background: #fff;
    border-radius: 10px;
    padding: 0.65rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    overflow: auto;
    z-index: 1;
}

.product-gallery-modal__close {
    width: auto;
    min-height: 32px;
    padding: 0 0.65rem;
    margin-left: auto;
    display: block;
}

.product-gallery-modal__main {
    width: 100%;
    height: min(56vh, 320px);
    object-fit: contain;
    object-position: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f7f7f7;
}

.product-gallery-modal__viewer {
    position: relative;
}

.product-gallery-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid #cfcfcf;
    background: rgba(255, 255, 255, 0.92);
    color: #222;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

.product-gallery-modal__nav--prev {
    left: 8px;
}

.product-gallery-modal__nav--next {
    right: 8px;
}

.product-gallery-modal__thumbs {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.2rem;
}

.product-gallery-modal__thumb {
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    padding: 2px;
    min-width: 58px;
    width: 58px;
    height: 58px;
    background: #fff;
}

.product-gallery-modal__thumb.is-active {
    border-color: #1f7a2f;
}

.product-gallery-modal__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card__meta {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.25;
}

.product-card__price {
    color: #1f7a2f;
    font-weight: 700;
}

.product-card__controls {
    display: grid;
    grid-template-columns: 34px 64px 34px 1fr;
    gap: 0.35rem;
    align-items: center;
}

.product-card__qty {
    min-height: 34px;
    text-align: center;
    width: 64px;
    min-width: 64px;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.product-card__step {
    min-height: 34px;
    min-width: 34px;
    width: 34px;
    padding: 0;
}

.product-card__add {
    min-height: 34px;
    padding: 0 0.55rem;
    width: 100%;
    font-size: 0.85rem;
    white-space: nowrap;
}

body.client-page .product-card .btn-primary,
body.client-page .product-card .btn-secondary {
    width: auto;
    min-height: 34px;
}

.dev-footer {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 0.5rem;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
}

.login-page .dev-footer {
    margin-top: 0;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

.dev-footer-text {
    color: #555;
    font-size: 0.9rem;
}

.dev-footer-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    background: #25d366;
    color: #fff;
    border: 1px solid #25d366;
    font-size: 0.9rem;
    line-height: 1;
}

.dev-footer-whatsapp:hover {
    background: #1da851;
    border-color: #1da851;
}

body.client-page input[type="text"],
body.client-page input[type="tel"],
body.client-page input[type="email"],
body.client-page input[type="password"],
body.client-page input[type="date"],
body.client-page input[type="number"],
body.client-page input[type="time"],
body.client-page select,
body.client-page textarea {
    min-height: 44px;
}

body.client-page .btn-primary,
body.client-page .btn-secondary,
body.client-page .btn-danger {
    min-height: 44px;
}

body.client-page .card {
    margin-bottom: 1rem;
}

body.client-page form {
    gap: 0.95rem;
}

body.client-page label {
    gap: 0.35rem;
}

body.client-page .app {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

body.client-page .grid-2 {
    grid-template-columns: 1fr;
}

body.client-page .product-carousel {
    grid-auto-flow: row;
    grid-auto-columns: 1fr;
    overflow-x: hidden;
}

body.client-page .product-card {
    width: 100%;
    min-width: 0;
}

@media (min-width: 768px) {
    .login-shell {
        grid-template-columns: 1.05fr 1fr;
        align-items: stretch;
    }

    .login-hero {
        padding: 1.5rem;
    }

    .field-with-button {
        grid-template-columns: 1fr auto;
        align-items: end;
    }

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

    .crud-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1.2fr 1fr;
    }

    .app {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    body.client-page,
    body.client-page .app,
    body.client-page .card,
    body.client-page form,
    body.client-page .grid-2 {
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    body.client-page label input,
    body.client-page label select,
    body.client-page label textarea {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    body {
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="number"],
    select {
        font-size: 1rem;
    }

    button {
        width: 100%;
    }

    .admin-menu,
    .admin-submenu-row {
        flex-direction: column;
    }

    .admin-menu a,
    .admin-submenu-row a,
    .admin-submenu-toggle {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .admin-submenu-row {
        margin-top: 0.5rem;
        padding: 0.5rem;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .admin-user-box {
        justify-content: center;
        border-radius: 12px;
        padding: 0.55rem;
    }

    .admin-logout-form {
        width: 100%;
    }

    .dev-footer-whatsapp {
        width: auto;
    }

    .item-row {
        flex-direction: column;
        align-items: stretch;
    }

    .event-address-row {
        grid-template-columns: minmax(88px, 0.75fr) minmax(140px, 1.85fr);
    }

    .event-city-state-row {
        grid-template-columns: minmax(140px, 1.9fr) minmax(70px, 0.75fr);
    }

    .crud-actions .btn-primary,
    .crud-actions .btn-secondary,
    .crud-actions .btn-danger {
        width: 100%;
        min-width: 0;
    }

    .item-row select,
    .item-row input[type="number"] {
        width: 100%;
        min-width: 0;
    }

    .admin-order-edit-card .item-row.actions-row {
        gap: 0.35rem;
    }

    .admin-order-edit-card .item-row.actions-row select,
    .admin-order-edit-card .item-row.actions-row input[type="number"] {
        min-height: 38px;
    }

    .admin-order-edit-card .item-row.actions-row .btn-danger,
    .admin-order-edit-card .item-row.actions-row .btn-secondary,
    .admin-order-edit-card .item-row.actions-row .btn-primary {
        min-height: 38px;
    }

    .product-carousel {
        grid-auto-flow: row;
        grid-auto-columns: 1fr;
        overflow-x: hidden;
    }

    .product-card {
        width: 100%;
        min-width: 0;
    }

    .product-card__image-wrap {
        height: 84px;
    }

    .product-gallery-modal__nav {
        width: 32px;
        height: 32px;
        min-height: 32px;
        font-size: 18px;
    }

    .product-card__controls {
        grid-template-columns: 36px 70px 36px 1fr;
    }

    .selected-item-row {
        flex-direction: column;
        align-items: stretch;
        padding: 0.45rem;
        gap: 0.45rem;
    }

    .selected-item-qty {
        width: 100%;
        min-height: 38px;
    }

    .selected-item-title {
        font-size: 0.95rem;
        line-height: 1.2;
        margin-bottom: 0.08rem;
    }

    .selected-item-meta {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    body.client-page input[type="text"],
    body.client-page input[type="tel"],
    body.client-page input[type="email"],
    body.client-page input[type="password"],
    body.client-page input[type="date"],
    body.client-page input[type="number"],
    body.client-page input[type="time"],
    body.client-page select,
    body.client-page textarea {
        font-size: 1rem;
    }

    body.client-page .actions-row {
        gap: 0.65rem;
    }

    body.client-page .actions-row .btn-primary,
    body.client-page .actions-row .btn-secondary,
    body.client-page .actions-row .btn-danger {
        width: 100%;
    }

    body.client-page .client-summary-actions .btn-primary,
    body.client-page .client-summary-actions .btn-secondary {
        width: 100%;
    }

    .client-add-prompt__actions {
        flex-direction: column;
    }

    .client-add-prompt__actions .btn-primary,
    .client-add-prompt__actions .btn-secondary {
        width: 100%;
    }

    .client-add-prompt {
        bottom: 0.6rem;
        width: calc(100vw - 1rem);
        padding: 0.65rem 0.7rem;
    }

    .client-summary-head {
        flex-direction: column;
        align-items: flex-start;
    }

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

    body.client-page .app {
        padding: 0.8rem;
    }

    body.client-page .card {
        padding: 1.05rem;
        margin-bottom: 0.9rem;
    }

    body.client-page h1 {
        margin-bottom: 0.65rem;
    }

    body.client-page h3 {
        margin-bottom: 0.55rem;
    }

    body.client-page .client-submit-sticky {
        position: sticky;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
        z-index: 10;
        box-shadow: 0 8px 18px rgba(30, 136, 229, 0.3);
    }

    body.client-page .client-submit-sticky.client-submit-sticky--ready {
        box-shadow: 0 0 0 2px rgba(33, 150, 83, 0.25), 0 12px 24px rgba(33, 150, 83, 0.38);
        animation: clientSubmitReadyPulse 1.25s ease-in-out infinite;
    }

    @keyframes clientSubmitReadyPulse {
        0% { transform: translateY(0); }
        50% { transform: translateY(-1px); }
        100% { transform: translateY(0); }
    }

    body.client-page.keyboard-open .client-submit-sticky {
        min-height: 38px;
        font-size: 0.9rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
        box-shadow: 0 5px 12px rgba(30, 136, 229, 0.22);
    }

    body.client-page.keyboard-open .dev-footer {
        display: none;
    }
}

@media (max-width: 768px) {
    body:not(.client-page) .crud-card {
        padding: 0.95rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }

    body:not(.client-page) .crud-section {
        padding: 0.8rem;
        border-radius: 8px;
    }

    body:not(.client-page) .crud-grid-2,
    body:not(.client-page) .crud-grid-3 {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    body:not(.client-page) .actions-row {
        gap: 0.45rem;
    }

    body:not(.client-page) .actions-row .btn-primary,
    body:not(.client-page) .actions-row .btn-secondary,
    body:not(.client-page) .actions-row .btn-danger,
    body:not(.client-page) .actions-row button,
    body:not(.client-page) .crud-actions .btn-primary,
    body:not(.client-page) .crud-actions .btn-secondary,
    body:not(.client-page) .crud-actions .btn-danger {
        width: 100%;
        min-width: 0;
    }

    body:not(.client-page) .table-wrap-x {
        border: 1px solid #d7e3f0;
        border-radius: 8px;
        background: #fff;
    }

    body:not(.client-page) .crud-table {
        min-width: 720px;
    }
}

/* Admin shell with left sidebar */
.admin-app-shell {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 1rem;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid #d8e3f1;
    background: linear-gradient(180deg, #f8fbff 0%, #f5f9ff 100%);
}

.admin-brand-head {
    margin-bottom: 0.9rem;
}

.admin-brand-head h1 {
    margin: 0 0 0.15rem 0;
    font-size: 1.18rem;
    color: #11385f;
    letter-spacing: 0.01em;
}

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

.admin-topbar-card {
    margin-bottom: 1rem;
    border: 1px solid #dce7f4;
}

.admin-topbar-left {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.admin-page-title {
    margin: 0;
    font-size: 1.2rem;
    color: #11385f;
    line-height: 1.2;
}

.admin-sidebar-toggle {
    display: none;
    min-width: 84px;
}

.admin-app-shell .admin-menu-wrap {
    display: block;
}

.admin-app-shell .admin-menu {
    margin-top: 0;
    display: grid;
    gap: 0.5rem;
    padding: 0.55rem;
}

.admin-app-shell .admin-menu a,
.admin-app-shell .admin-submenu-toggle {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
    padding: 0.56rem 0.72rem;
}

.admin-app-shell .admin-submenu-row {
    margin-top: 0.55rem;
    display: none;
    gap: 0.42rem;
    padding: 0.55rem;
}

.admin-app-shell .admin-submenu-row.is-open {
    display: grid;
}

.admin-app-shell .admin-submenu-row a {
    width: 100%;
    justify-content: flex-start;
    border-radius: 9px;
    padding: 0.5rem 0.68rem;
}

@media (max-width: 980px) {
    .admin-app-shell {
        grid-template-columns: 1fr;
        padding: 0.85rem;
    }

    .admin-sidebar {
        position: fixed;
        left: 0.85rem;
        right: 0.85rem;
        top: 0.85rem;
        max-height: calc(100vh - 1.7rem);
        z-index: 1200;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
        box-shadow: 0 16px 36px rgba(17, 44, 71, 0.24);
    }

    .admin-sidebar.is-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .admin-sidebar-toggle {
        display: inline-flex;
    }
}


/* Modern button system */
:root {
    --btn-radius: 12px;
    --btn-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
    --btn-shadow-hover: 0 14px 28px rgba(15, 23, 42, 0.16);
    --btn-focus: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.btn-primary,
.btn-secondary,
.btn-danger,
button[type="submit"],
input[type="submit"] {
    border-radius: var(--btn-radius);
    border: 1px solid transparent;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1f7ae0 0%, #155db7 100%);
    border-color: #13519d;
    box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-hover);
    filter: saturate(1.05);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--btn-focus), var(--btn-shadow-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, #1f9d59 0%, #157a43 100%);
    border-color: #12673a;
    box-shadow: var(--btn-shadow);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-hover);
    filter: saturate(1.05);
}

.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.24), var(--btn-shadow-hover);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3f3f 0%, #b91c1c 100%);
    border-color: #991b1b;
    box-shadow: var(--btn-shadow);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-hover);
    filter: saturate(1.04);
}

.btn-danger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22), var(--btn-shadow-hover);
}

.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
button[type="submit"]:active,
input[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
}

.btn-primary[disabled],
.btn-secondary[disabled],
.btn-danger[disabled],
button[disabled],
input[disabled] {
    opacity: 0.62;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Modern sidebar navigation */
.admin-app-shell .admin-menu {
    background: transparent;
    border: 0;
    padding: 0;
    gap: 0.45rem;
}

.admin-app-shell .admin-menu a,
.admin-app-shell .admin-submenu-toggle,
.admin-app-shell .admin-submenu-row a {
    position: relative;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #d8e4f3;
    background: #ffffff;
    color: #183a5a;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 0.58rem 0.78rem;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.admin-app-shell .admin-menu a:hover,
.admin-app-shell .admin-submenu-toggle:hover,
.admin-app-shell .admin-submenu-row a:hover {
    background: #f4f8ff;
    border-color: #c6d8ee;
    color: #102f4b;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.09);
}

.admin-app-shell .admin-menu a.is-active,
.admin-app-shell .admin-submenu-toggle.is-active,
.admin-app-shell .admin-submenu-row a.is-active {
    background: linear-gradient(135deg, #1f7ae0 0%, #155db7 100%);
    border-color: #15509b;
    color: #fff;
    box-shadow: 0 10px 20px rgba(21, 93, 183, 0.3);
}

.admin-app-shell .admin-submenu-row {
    border: 1px solid #dbe6f4;
    border-radius: 12px;
    background: #f8fbff;
}


/* Sidebar color hierarchy: main menu vs submenu */
.admin-app-shell .admin-menu > a,
.admin-app-shell .admin-menu > .admin-submenu-toggle {
    background: linear-gradient(180deg, #edf4ff 0%, #e5efff 100%);
    border-color: #c9daf2;
    color: #143a63;
}

.admin-app-shell .admin-menu > a:hover,
.admin-app-shell .admin-menu > .admin-submenu-toggle:hover {
    background: linear-gradient(180deg, #e2edff 0%, #d9e8ff 100%);
    border-color: #b8cee9;
}

.admin-app-shell .admin-menu > a.is-active,
.admin-app-shell .admin-menu > .admin-submenu-toggle.is-active {
    background: linear-gradient(135deg, #1f7ae0 0%, #155db7 100%);
    border-color: #15509b;
    color: #fff;
}

.admin-app-shell .admin-submenu-row {
    border: 1px solid #cfe6d7;
    background: linear-gradient(180deg, #f3fbf6 0%, #edf9f1 100%);
}

.admin-app-shell .admin-submenu-row a {
    background: linear-gradient(180deg, #e8f7ee 0%, #def2e6 100%);
    border-color: #b8deca;
    color: #1d5b3e;
}

.admin-app-shell .admin-submenu-row a:hover {
    background: linear-gradient(180deg, #dcf2e5 0%, #d2ecd9 100%);
    border-color: #9fceb7;
    color: #184b34;
}

.admin-app-shell .admin-submenu-row a.is-active {
    background: linear-gradient(135deg, #1f9d59 0%, #157a43 100%);
    border-color: #12673a;
    color: #fff;
    box-shadow: 0 10px 20px rgba(21, 122, 67, 0.28);
}

/* Products manage table: action buttons sizing */
.products-manage-wrap {
    overflow-x: auto;
}

.products-manage-table {
    min-width: 1500px;
}

.products-manage-table th:last-child,
.products-manage-table td:last-child {
    min-width: 246px;
}

.products-manage-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    min-width: 220px;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form,
.products-manage-actions form button {
    width: 100%;
    min-width: 0;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form button {
    min-height: 38px;
    padding: 0 0.75rem;
    white-space: nowrap;
    justify-content: center;
}

@media (max-width: 768px) {
    body:not(.client-page) .products-manage-actions .btn-secondary,
    body:not(.client-page) .products-manage-actions .btn-danger,
    body:not(.client-page) .products-manage-actions form button {
        width: 100%;
        min-width: 0;
    }
}

/* Products manage table final alignment */
.products-manage-wrap {
    overflow-x: auto !important;
}

.products-manage-table {
    width: 100% !important;
    min-width: 1240px !important;
    table-layout: auto !important;
}

.products-manage-table th,
.products-manage-table td {
    vertical-align: middle;
    text-align: left;
}

.products-manage-table th:nth-child(1),
.products-manage-table td:nth-child(1) {
    min-width: 220px;
}

.products-manage-table th:nth-child(2),
.products-manage-table td:nth-child(2) {
    min-width: 90px;
}

.products-manage-table th:last-child,
.products-manage-table td:last-child {
    min-width: 240px;
}

.products-manage-actions {
    min-width: 220px;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form,
.products-manage-actions form button {
    width: 100%;
    min-width: 0;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form button {
    min-height: 38px;
    white-space: nowrap;
}

/* Products manage table compact sizing */
.products-manage-wrap {
    overflow-x: auto !important;
}

.products-manage-table {
    width: 100% !important;
    min-width: 980px !important;
    table-layout: fixed !important;
}

.products-manage-table th,
.products-manage-table td {
    font-size: 0.82rem;
    padding: 0.4rem 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.products-manage-table th:nth-child(1),
.products-manage-table td:nth-child(1) {
    width: 18%;
}

.products-manage-table th:nth-child(2),
.products-manage-table td:nth-child(2) {
    width: 9%;
    text-align: center;
}

.products-manage-table th:last-child,
.products-manage-table td:last-child {
    width: 18%;
    min-width: 170px;
}

.products-manage-actions {
    min-width: 160px;
    gap: 0.35rem;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form button {
    min-height: 34px;
    padding: 0 0.6rem;
    font-size: 0.84rem;
}

/* Products actions compact buttons */
.products-manage-table {
    min-width: 900px !important;
}

.products-manage-table th:last-child,
.products-manage-table td:last-child {
    width: 16% !important;
    min-width: 128px !important;
}

.products-manage-actions {
    min-width: 122px !important;
    gap: 0.24rem !important;
}

.products-manage-actions .btn-secondary,
.products-manage-actions .btn-danger,
.products-manage-actions form button {
    min-height: 25px !important;
    padding: 0 0.35rem !important;
    font-size: 0.72rem !important;
    border-radius: 8px !important;
}



/* Admin products page: extra compact buttons */
#topo-cadastro-produto .btn-primary,
#topo-cadastro-produto .btn-secondary,
#topo-cadastro-produto .btn-danger,
#produtos-pesquisa .btn-primary,
#produtos-pesquisa .btn-secondary,
#produtos-pesquisa .btn-danger {
    min-height: 30px !important;
    padding: 0 0.5rem !important;
    font-size: 0.78rem !important;
    border-radius: 9px !important;
}

#topo-cadastro-produto .crud-actions .btn-primary,
#topo-cadastro-produto .crud-actions .btn-secondary,
#topo-cadastro-produto .crud-actions .btn-danger {
    min-width: 108px !important;
}


/* Admin products page: ultra compact buttons */
#topo-cadastro-produto .btn-primary,
#topo-cadastro-produto .btn-secondary,
#topo-cadastro-produto .btn-danger,
#produtos-pesquisa .btn-primary,
#produtos-pesquisa .btn-secondary,
#produtos-pesquisa .btn-danger {
    min-height: 28px !important;
    padding: 0 0.42rem !important;
    font-size: 0.74rem !important;
    border-radius: 8px !important;
}

#topo-cadastro-produto .crud-actions .btn-primary,
#topo-cadastro-produto .crud-actions .btn-secondary,
#topo-cadastro-produto .crud-actions .btn-danger {
    min-width: 98px !important;
}

/* Admin visual refresh (Figma-like) */
body {
    background: radial-gradient(circle at 8% 8%, #f3f8ff 0%, #eef3fb 32%, #e9edf4 100%);
}

.app.admin-app-shell {
    max-width: 1360px !important;
    margin: 0 auto !important;
    padding: 1.15rem !important;
    gap: 1.1rem !important;
}

.card {
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(15, 30, 60, 0.08);
}

.admin-sidebar {
    border-radius: 14px;
    background: linear-gradient(180deg, #f7fbff 0%, #f2f7ff 100%);
}

.admin-brand-head h1 {
    font-size: 2rem;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.admin-brand-head .text-muted {
    font-size: 1.05rem;
    color: #536579;
}

.admin-topbar-card {
    padding: 1rem 1.1rem;
}

.admin-page-title {
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.admin-user-box {
    border-radius: 14px;
    padding: 0.4rem 0.55rem 0.4rem 0.75rem;
}

.admin-app-shell .admin-menu > a,
.admin-app-shell .admin-menu > .admin-submenu-toggle {
    min-height: 46px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.admin-app-shell .admin-submenu-row {
    border-radius: 12px;
    padding: 0.6rem;
}

.admin-app-shell .admin-submenu-row a {
    min-height: 42px;
    font-size: 0.9rem;
    border-radius: 10px;
}

@media (min-width: 981px) {
    .app.admin-app-shell {
        grid-template-columns: 290px minmax(0, 1fr) !important;
    }

    .admin-sidebar {
        position: sticky !important;
        top: 1rem !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        max-height: calc(100vh - 2rem);
    }

    .admin-sidebar-toggle {
        display: none !important;
    }
}

@media (max-width: 980px) {
    .app.admin-app-shell {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }

    .admin-page-title {
        font-size: 1.6rem;
    }

    .admin-brand-head h1 {
        font-size: 1.7rem;
    }
}
