/* Master-only presentation. Business forms and the PDV keep their contracts. */
.master-shell {
    --color-primary: #087f64;
    --color-primary-hover: #06634e;
    --color-text-muted: #536174;
    --color-bg: #f6f7f9;
    --color-border: #e0e5eb;
    --master-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
}
.master-shell .master-layout { --master-sidebar-width: 232px; background: var(--color-bg); }
.master-shell .master-main { padding: 32px 40px 48px; }
.master-shell .master-main > * { width: 100%; max-width: 1360px; margin-left: auto; margin-right: auto; }
.master-shell .master-sidebar { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); overflow-y: auto; }
.master-shell .master-sidebar-brand { padding: 28px 20px; border-color: var(--color-border); }
.master-shell .master-sidebar-brand h2 { color: var(--color-text-strong); font-size: 15px; }
.master-shell .master-sidebar-brand p { color: var(--color-text-muted); font-size: 12px; }
.master-shell .master-brand-mark { border-radius: 9px; }
.master-shell .master-sidebar-nav { padding: 24px 12px; gap: 6px; }
.master-shell .master-sidebar-nav a { color: var(--color-text-muted); min-height: 44px; font-size: 14px; font-weight: 500; padding: 10px 14px; }
.master-shell .master-sidebar-nav a:hover { color: var(--color-text-strong); background: var(--color-surface-muted); }
.master-shell .master-sidebar-nav a.active { color: var(--color-primary-hover); background: var(--color-primary-soft); box-shadow: none; font-weight: 700; }
.master-shell .master-sidebar-footer { border-color: var(--color-border); padding: 20px; }
.master-shell .master-sidebar-health, .master-shell .master-sidebar-footer a { color: var(--color-text-muted); }
.master-shell .master-sidebar-footer a { min-height: 44px; }
.master-shell .master-sidebar-footer a:hover { color: var(--color-primary-hover); }
.master-shell .master-nav-toggle { display: none; }
.master-shell .master-breadcrumb { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; color: var(--color-text-muted); font-size: 13px; }
.master-shell .master-breadcrumb a { color: inherit; text-decoration: none; }
.master-shell .master-breadcrumb a:hover { text-decoration: underline; }
.master-shell :is(.master-command, .master-company-hero, .master-header, .master-empresas-header) {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 24px;
    margin-bottom: 24px;
    align-items: center;
}
.master-shell .master-main h1 { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.25; letter-spacing: -0.025em; font-weight: 700; }
.master-shell .master-main h2 { font-size: 17px; line-height: 1.4; letter-spacing: -0.015em; }
.master-shell .master-main .eyebrow { color: var(--color-text-muted); font-size: 11px; letter-spacing: 0.08em; margin-bottom: 6px; }
.master-shell .master-company-avatar.large { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.master-shell .master-company-meta { gap: 12px; margin-top: 6px; }
.master-shell .master-company-meta span { padding: 0; border: 0; background: transparent; width: auto; font-size: 13px; }
.master-shell :is(.master-panel, .master-settings-panel, .master-settings-audit, .master-attention-section, .master-recent-section, .master-form-card) {
    border: 1px solid var(--color-border);
    border-radius: var(--master-radius);
    background: var(--color-surface);
    box-shadow: none;
}
.master-shell .master-panel { padding: 24px; }
.master-shell :is(.master-attention-section, .master-recent-section, .master-settings-audit, .master-settings-panel) { padding: 24px; }
.master-shell .master-panel-head { align-items: center; }
.master-shell .master-apps-locais-page .master-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.master-shell .master-panel-head { gap: 16px; margin-bottom: 20px; }
.master-shell :is(.master-kpi-card, .master-empresa-kpi) { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--master-radius); box-shadow: none; padding: 18px 20px; }
.master-shell :is(.master-kpi-card, .master-empresa-kpi)::before { display: none; }
.master-shell :is(.master-kpi-card, .master-empresa-kpi) strong { font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.master-shell :is(.master-kpi-card, .master-empresa-kpi) > span { text-transform: none; font-size: 13px; letter-spacing: 0; font-weight: 500; }
.master-shell :is(.primary-action, .secondary-action, .outline-action, .danger-action, .lic-btn) {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; height: auto; padding: 10px 16px; border-radius: 7px;
    font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
    text-decoration: none; box-shadow: none; cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease;
}
.master-shell :is(.primary-action, .lic-btn--primary) { background: var(--color-primary); border: 1px solid var(--color-primary); color: var(--color-text-inverse); }
.master-shell :is(.primary-action, .lic-btn--primary):hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
.master-shell :is(.secondary-action, .outline-action, .lic-btn--secondary, .lic-btn--copy) { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.master-shell :is(.secondary-action, .outline-action, .lic-btn--secondary, .lic-btn--copy):hover { background: var(--color-surface-soft); border-color: var(--color-border-strong); }
.master-shell :is(.danger-action, .lic-btn--danger) { color: var(--color-danger-strong); background: var(--color-surface); border: 1px solid var(--color-danger-border); }
.master-shell :is(.danger-action, .lic-btn--danger):hover { background: var(--color-danger-soft); }
.master-shell :is(button, input, select):disabled { opacity: 0.6; cursor: not-allowed; }
.master-shell :is(a, button, input, select, textarea, summary):focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
.master-shell :is(.master-badge, .lic-badge) { display: inline-flex; align-items: center; width: fit-content; border-radius: 6px; padding: 4px 9px; height: auto; font-size: 12px; line-height: 1.4; font-weight: 600; text-transform: none; letter-spacing: 0; }
.master-shell .lic-badge--active { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.master-shell .lic-badge--inactive { background: var(--color-danger-soft); color: var(--color-danger-strong); }
.master-shell .master-tabs { background: transparent; border: 0; border-bottom: 1px solid var(--color-border); box-shadow: none; border-radius: 0; padding: 0; gap: 24px; margin-bottom: 24px; overflow-x: auto; }
.master-shell .master-tab { min-height: 48px; padding: 12px 2px; border: 0; border-radius: 0; border-bottom: 2px solid transparent; color: var(--color-text-muted); background: transparent; box-shadow: none; font-size: 13px; flex-shrink: 0; }
.master-shell .master-tab.active { background: transparent; border-color: var(--color-primary); color: var(--color-primary-hover); box-shadow: none; }
.master-shell .master-license-overview { gap: 16px; }
.master-shell .master-client-record { padding: 24px; }
.master-shell .master-fact { background: transparent; box-shadow: none; border: 0; padding: 12px 0; }
.master-shell :is(.master-table, .master-empresas-table) th { background: var(--color-surface-soft); color: var(--color-text-muted); text-transform: none; font-size: 12px; letter-spacing: 0; font-weight: 600; padding: 13px 16px; }
.master-shell :is(.master-table, .master-empresas-table) td { padding: 16px; border-bottom: 1px solid var(--color-border-soft); font-size: 13px; }
.master-shell :is(.master-table, .master-empresas-table) tbody tr:hover { background: var(--color-surface-soft); }
.master-shell :is(.master-form-group, .lic-field) { min-width: 0; }
.master-shell :is(.master-form-group label, .lic-field-label) { color: var(--color-text); font-size: 13px; font-weight: 500; }
.master-shell :is(.master-form-group input, .master-form-group select, .master-form-group textarea, .lic-input, .master-empresas-search input) {
    width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--color-border-strong); border-radius: 7px;
    color: var(--color-text); background: var(--color-surface); font: inherit;
}
.master-shell .master-tenant-form { max-width: 1040px; }
.master-shell .master-form-row { gap: 20px; }
.master-shell .master-form-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.master-shell :is(.master-form-actions, .master-wizard-actions) { padding-top: 20px; border-top: 1px solid var(--color-border); gap: 12px; }
.master-shell .master-empty { padding: 36px 20px; }
.master-shell .lic-section { margin-bottom: 20px; }
.master-shell .lic-status-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--color-border); }
.master-shell .lic-status-item { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.master-shell .lic-status-label { color: var(--color-text-muted); font-size: 12px; }
.master-shell .lic-status-value { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.master-shell :is(.lic-status-sub, .lic-field-hint, .lic-form-note) { font-size: 12px; line-height: 1.6; color: var(--color-text-muted); }
.master-shell .lic-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.master-shell .lic-form-section { border-top: 1px solid var(--color-border); }
.master-shell .lic-form-section--fixed { padding-top: 20px; margin-top: 16px; border-top: 1px solid var(--color-border); }
.master-shell .lic-section-header { margin-bottom: 16px; }
.master-shell .lic-section-heading { font-size: 15px; font-weight: 700; color: var(--color-text-strong); margin: 0 0 4px 0; letter-spacing: -0.01em; }
.master-shell .lic-section-sub { font-size: 12px; color: var(--color-text-muted); margin: 0; line-height: 1.5; }
.master-shell .lic-activation-section { padding-bottom: 4px; }
.master-shell .lic-form-toggle { min-height: 48px; padding: 14px 0; font-size: 13px; font-weight: 600; cursor: pointer; }
.master-shell .lic-form { padding: 4px 0 20px; }
.master-shell .lic-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.master-shell .lic-field { display: flex; flex-direction: column; gap: 6px; }
.master-shell .lic-field--narrow { max-width: 240px; }
.master-shell .lic-advanced { margin-top: 20px; }
.master-shell .lic-advanced--fixed { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--color-border); }
.master-shell .lic-advanced-heading { font-size: 13px; font-weight: 600; color: var(--color-text); margin: 0 0 10px 0; }
.master-shell .lic-advanced summary { cursor: pointer; color: var(--color-text-muted); min-height: 44px; align-content: center; }
.master-shell .lic-advanced .lic-field { margin-top: 8px; }
.master-shell .lic-form-note { margin: 16px 0; }
.master-shell .lic-activation-info { padding: 8px 0; }
.master-shell .lic-code-inline { overflow-wrap: anywhere; }
.master-shell .lic-form-section > form:not(.lic-form) { margin: 0 0 16px; }
.master-shell .lic-activation-list { margin-top: 8px; padding-top: 20px; }
.master-shell .lic-activation-card { background: var(--color-surface-soft); border-radius: 8px; padding: 18px; }
.master-shell .lic-activation-label { color: var(--color-text); font-size: 13px; }
.master-shell .lic-activation-code { border: 1px solid var(--color-border); background: var(--color-surface); padding: 6px 6px 6px 14px; }
.master-shell .lic-activation-code code { font-weight: 400; font-size: 13px; }
.master-shell .master-skip-link { position: fixed; left: 16px; top: -100px; z-index: 200; background: var(--color-surface); color: var(--color-primary-hover); padding: 12px 20px; border: 2px solid var(--color-primary); }
.master-shell .master-skip-link:focus { top: 12px; }
@media (min-width: 1600px) { .master-shell .master-main { padding-left: 64px; padding-right: 64px; } }
@media (max-width: 1100px) {
    .master-shell .master-main { padding: 24px; }
    .master-shell .lic-status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .master-shell :is(.master-kpi-grid, .master-empresas-kpis) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .master-shell .master-apps-locais-page .master-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .master-shell .master-apps-locais-page .master-kpi-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .master-shell .master-layout { display: block; }
    .master-shell .master-sidebar { position: sticky; top: 0; width: 100%; min-height: 0; height: auto; max-height: 90dvh; z-index: 100; border-bottom: 1px solid var(--color-border); }
    .master-shell .master-sidebar-brand { padding: 12px 16px; border-bottom: 0; }
    .master-shell .master-nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; margin-left: auto; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); border-radius: 7px; font: inherit; }
    .master-shell .master-sidebar-nav, .master-shell .master-sidebar-footer { display: none; }
    .master-shell .master-sidebar.is-open .master-sidebar-nav { display: flex; flex-direction: column; padding: 8px 12px; overflow: visible; }
    .master-shell .master-sidebar.is-open .master-sidebar-footer { display: block; padding: 8px 24px; }
    .master-shell .master-main { margin-left: 0; padding: 24px 16px; min-height: calc(100vh - 70px); }
    .master-shell :is(.master-command, .master-company-hero, .master-header) { align-items: flex-start; gap: 16px; }
    .master-shell .master-company-identity { flex-direction: row; gap: 12px; }
    .master-shell .master-company-hero-actions { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
    .master-shell .master-panel { padding: 18px; }
    .master-shell :is(.master-attention-section, .master-recent-section, .master-settings-audit, .master-settings-panel) { padding: 18px; }
    .master-shell .master-client-record { padding: 4px 18px; }
    .master-shell .master-tabs { gap: 20px; }
    .master-shell :is(.master-form-group input, .master-form-group select, .lic-input) { font-size: 16px; }
    .master-shell .master-breadcrumb { flex-wrap: wrap; }
}
@media (max-width: 560px) {
    .master-shell :is(.master-form-row, .master-form-row.four, .lic-form-grid) { grid-template-columns: minmax(0, 1fr); }
    .master-shell .master-panel-head { align-items: stretch; flex-wrap: wrap; }
    .master-shell .lic-status-bar { gap: 18px 12px; }
    .master-shell .lic-status-value { font-size: 14px; }
    .master-shell .lic-activation-header { flex-wrap: wrap; }
    .master-shell .lic-activation-code { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
    .master-shell .lic-activation-code code { word-break: break-all; }
    .master-shell .master-empresas-search { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .master-shell *, .master-shell *::before, .master-shell *::after { transition: none; animation: none; scroll-behavior: auto; }
}
