/* MVO Panel — fundações visuais compartilhadas
 * Carregado após os estilos de cada superfície para uniformizar interação,
 * acessibilidade e comportamento responsivo sem alterar a arquitetura.
 */
:root {
    --mvo-primary: #2563eb;
    --mvo-primary-hover: #1d4ed8;
    --mvo-primary-soft: #eaf2ff;
    --mvo-structural: #0f172a;
    --mvo-heading: #16376a;
    --mvo-surface: #ffffff;
    --mvo-surface-subtle: #f8fafc;
    --mvo-page: #f6f8fc;
    --mvo-border: #dfe6ee;
    --mvo-border-strong: #cbd5e1;
    --mvo-text: #1e293b;
    --mvo-muted: #64748b;
    --mvo-success: #198754;
    --mvo-danger: #dc3545;
    --mvo-warning: #e8a33d;
    --mvo-radius-sm: 4px;
    --mvo-radius-md: 7px;
    --mvo-radius-lg: 10px;
    --mvo-radius-xl: 14px;
    --mvo-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --mvo-shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
    --mvo-focus: 0 0 0 3px rgba(37, 99, 235, .18);
}

html { color-scheme: light; scroll-behavior: smooth; }
body { color: var(--mvo-text); background-color: var(--mvo-page); text-rendering: optimizeLegibility; }
body, button, input, select, textarea { font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; }
a, button, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 0; box-shadow: var(--mvo-focus); }
::selection { color: #fff; background: var(--mvo-primary); }

:where(h1, h2, h3, h4, h5, h6) { color: var(--mvo-structural); font-weight: 700; letter-spacing: -.02em; }
:where(p, .text-muted, small) { line-height: 1.55; }
:where(.text-muted) { color: var(--mvo-muted) !important; }

:where(.form-control, .form-select, .input-group-text) {
    min-height: 42px;
    border-color: var(--mvo-border-strong);
    border-radius: var(--mvo-radius-md);
}
:where(.form-control, .form-select)::placeholder { color: #94a3b8; opacity: 1; }
:where(.form-control, .form-select):focus {
    border-color: var(--mvo-primary);
    box-shadow: var(--mvo-focus);
}
:where(.form-control, .form-select):disabled { color: var(--mvo-muted); background: var(--mvo-surface-subtle); cursor: not-allowed; }
:where(.form-label) { color: #334155; font-weight: 650; }
:where(.form-text) { color: var(--mvo-muted); }
:where(.form-check-input):focus { border-color: var(--mvo-primary); box-shadow: var(--mvo-focus); }
:where(.form-check-input):checked { border-color: var(--mvo-primary); background-color: var(--mvo-primary); }

:where(.btn) {
    min-height: 38px;
    border-radius: var(--mvo-radius-md);
    font-weight: 650;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
:where(.btn-primary) { color: var(--mvo-primary-text); border-color: var(--mvo-primary); background: var(--mvo-primary); }
:where(.btn-primary:hover, .btn-primary:active, .btn-primary:focus) { color: var(--mvo-primary-text); border-color: var(--mvo-primary-hover); background: var(--mvo-primary-hover); }
:where(.btn-outline-primary) { color: var(--mvo-primary); border-color: var(--mvo-primary); }
:where(.btn-outline-primary:hover) { color: #fff; background: var(--mvo-primary); }
:where(.btn-outline-secondary, .btn-secondary, .btn-light) { color: var(--mvo-button-secondary-text); border-color: var(--mvo-button-secondary-border); background: var(--mvo-button-secondary); }
:where(.btn-outline-secondary:hover, .btn-secondary:hover, .btn-light:hover) { color: var(--mvo-button-secondary-text); border-color: var(--mvo-button-secondary-border); background: color-mix(in srgb, var(--mvo-button-secondary) 88%, var(--mvo-button-secondary-text)); }
:where(.btn-danger) { border-color: var(--mvo-danger); background: var(--mvo-danger); }
:where(.btn:disabled, .btn.disabled) { transform: none !important; box-shadow: none !important; cursor: not-allowed; opacity: .58; }
:where(.btn:not(:disabled):active) { transform: translateY(1px); }

:where(.card) { border-color: var(--mvo-border); border-radius: var(--mvo-radius-lg); box-shadow: var(--mvo-shadow-sm); }
:where(.card-header) { background: var(--mvo-surface-subtle); border-color: var(--mvo-border); }
:where(.table) { margin-bottom: 0; color: var(--mvo-text); }
:where(.table > :not(caption) > * > *) { padding: .78rem .85rem; border-bottom-color: var(--mvo-border); vertical-align: middle; }
:where(.table thead th) { color: var(--mvo-muted); background: var(--mvo-surface-subtle); font-size: .75rem; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; }
:where(.table-hover > tbody > tr:hover > *) { --bs-table-bg-state: #f5f8ff; }
:where(.table-responsive) { border-radius: inherit; scrollbar-width: thin; }
:where(.card-body, .card, .modal-body):has(> .table) { overflow-x: auto; }
:where(.card-body, .modal-body) > .table { min-width: 640px; }

:where(.dropdown-menu) { padding: .4rem; border-color: var(--mvo-border); border-radius: var(--mvo-radius-lg); box-shadow: var(--mvo-shadow-md); }
:where(.dropdown-item) { border-radius: var(--mvo-radius-sm); }
:where(.dropdown-item:hover, .dropdown-item:focus) { color: var(--mvo-primary-hover); background: var(--mvo-primary-soft); }
:where(.modal-content) { border: 1px solid var(--mvo-border); border-radius: var(--mvo-radius-xl); box-shadow: 0 24px 64px rgba(15, 23, 42, .2); }
:where(.modal-header, .modal-footer) { border-color: var(--mvo-border); }
:where(.alert) { border-radius: var(--mvo-radius-lg); }
:where(.badge) { font-weight: 700; }

@media (max-width: 767.98px) {
    :where(.container, .container-fluid) { --bs-gutter-x: 1.25rem; }
    :where(.page-head, .page-header, .content-header, .section-head) { align-items: stretch; flex-direction: column; }
    :where(.page-head, .page-header, .content-header, .section-head) :where(.btn, .btn-group) { width: 100%; }
    :where(.modal-dialog) { margin: .75rem; }
    :where(.modal-content) { max-height: calc(100dvh - 1.5rem); }
    :where(.table > :not(caption) > * > *) { padding: .68rem .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Auth layouts: prevent intrinsic grid width from overflowing narrow screens. */
.auth-shell,
.auth-visual,
.auth-card,
.field-wrap { min-width: 0; }
.auth-shell { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth-card > * { max-width: 100%; }
@media (max-width: 767.98px) {
    .auth-shell { width: calc(100vw - 1.5rem); max-width: calc(100vw - 1.5rem); grid-template-columns: minmax(0, 1fr); }
    .auth-visual,
    .auth-card { width: 100%; overflow: hidden; }
    .auth-card .d-flex { min-width: 0; gap: .5rem; }
    .forgot-link { flex: 0 1 auto; text-align: right; }
    .field-wrap .form-control { width: 100%; }
    .auth-message h2,
    .auth-message p { overflow-wrap: anywhere; }
}

/* Typography calibration — shared by admin and client surfaces.
   Weight communicates hierarchy; it is not the default treatment for every control. */
:root {
    --mvo-weight-regular: 400;
    --mvo-weight-control: 500;
    --mvo-weight-active: 550;
    --mvo-weight-title: 600;
    --mvo-weight-display: 650;
}
body { font-weight: var(--mvo-weight-regular); }
h1 { font-weight: var(--mvo-weight-display) !important; }
h2, h3 { font-weight: var(--mvo-weight-title) !important; }
h4, h5, h6, strong, b { font-weight: var(--mvo-weight-title); }

.form-label,
.form-check-label,
legend,
.dropdown-item { font-weight: var(--mvo-weight-control) !important; }
.btn,
.badge,
.card-header,
.modal-title,
.accordion-button,
.pagination .page-link { font-weight: var(--mvo-weight-active) !important; }
.table thead th,
.table tbody td::before { font-weight: var(--mvo-weight-active) !important; }

.adm-sidebar-link,
.adm-sidebar-toggle,
.adm-sidebar-sub a,
.adm-sidebar-subgroup > summary,
.adm-desktop-item,
.adm-mobile-item,
.adm-nav a,
.cli-nav a,
.client-context-nav a,
.nav-tabs .nav-link,
.product-editor-tabs .nav-link,
.catalog-tabs a { font-weight: var(--mvo-weight-regular) !important; }
.adm-sidebar-link.active,
.adm-sidebar-sub a.active,
.adm-sidebar-toggle.open,
.adm-desktop-item.active,
.adm-mobile-item.active,
.adm-nav a.active,
.cli-nav a.active,
.client-context-nav a.active,
.nav-tabs .nav-link.active,
.product-editor-tabs .nav-link.active,
.catalog-tabs a.active { font-weight: var(--mvo-weight-active) !important; }

.client-ops-eyebrow,
.client-meta,
.client-kpi > span,
.service-overview-meta,
.service-facts span,
.client-stat-label,
.dashboard-stat-label { font-weight: var(--mvo-weight-regular) !important; }
.client-kpi > strong,
.service-facts strong,
.client-stat-value,
.dashboard-stat-value { font-weight: var(--mvo-weight-title) !important; }

[class*="-kicker"],
[class*="-eyebrow"] { font-weight: var(--mvo-weight-title) !important; }
[class*="-status"],
[class*="-badge"],
[class*="-count"] { font-weight: var(--mvo-weight-active) !important; }
