:root {
    --gagp-navy: #0b1f3a;
    --gagp-primary: #1e5aa5;
    --gagp-deep: #081426;
    --gagp-text: #1b2430;
    --gagp-muted: #5c6b80;
    --gagp-line: #ced8e6;
    --gagp-surface: #ffffff;
    --gagp-surface-alt: #eef3fa;
    --gagp-accent-soft: #dfe9f7;
    --gagp-shadow: 0 24px 60px rgba(11, 31, 58, 0.12);
    --theme-page-top: rgba(30, 90, 165, 0.16);
    --theme-page-bottom: #edf4fc;
    --theme-surface: rgba(248, 251, 255, 0.88);
    --theme-surface-strong: rgba(255, 255, 255, 0.94);
    --theme-surface-soft: rgba(237, 244, 252, 0.92);
    --theme-border: #d4e2f2;
    --theme-border-strong: #bfd3eb;
    --theme-shadow: 0 18px 36px rgba(30, 90, 165, 0.10);
    --theme-shadow-hover: 0 22px 40px rgba(30, 90, 165, 0.14);
    --theme-accent: var(--gagp-accent-soft);
    --theme-accent-strong: #d2e3f6;
    --theme-warm: #edf4fc;
}

.checkbox-row--radio {
    min-height: 46px;
}

.setup-role-permissions {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.setup-role-permissions__group {
    padding: 16px 18px;
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    background: var(--theme-surface-soft);
}

.setup-role-permissions__group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.setup-role-permissions__group-head strong {
    display: block;
    color: var(--gagp-deep);
}

.setup-role-permissions__group-head span {
    display: block;
    margin-top: 4px;
    color: var(--gagp-muted);
    font-size: 13px;
}

.setup-role-permissions__list {
    display: grid;
    gap: 12px;
}

.setup-role-permission-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) minmax(320px, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface-strong);
}

.setup-role-permission-row__info {
    display: grid;
    gap: 4px;
}

.setup-role-permission-row__info strong {
    color: var(--gagp-text);
}

.setup-role-permission-row__info span {
    color: var(--gagp-muted);
    font-size: 13px;
    line-height: 1.5;
}

.setup-role-permission-row__levels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.setup-role-permission-row__actions {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--theme-border);
}

.setup-role-permission-action {
    align-items: flex-start;
    font-size: 13px;
}

.setup-role-permission-action input[type="checkbox"]:disabled + span {
    opacity: 0.5;
}

.setup-role-permission-action__hint {
    display: block;
    color: var(--gagp-muted);
    font-size: 12px;
    line-height: 1.4;
}

* {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    scroll-padding-top: calc(var(--erp-topbar-h, 72px) + var(--erp-menubar-h, 0px));
}

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--gagp-text);
    background:
        radial-gradient(circle at top left, var(--theme-page-top), transparent 36%),
        linear-gradient(180deg, #f8fbff 0%, var(--theme-page-bottom) 100%);
}

body.tenant-dashboard-page {
    background:
        radial-gradient(circle at top left, rgba(30, 90, 165, 0.18), transparent 34%),
        linear-gradient(180deg, var(--gagp-accent-soft) 0%, var(--gagp-surface-alt) 100%);
}

body.tenant-dashboard-page .app-shell {
    background: transparent;
}

body.superadmin-page,
body.superadmin-page .app-shell {
    max-width: 100%;
}

body.superadmin-page .erp-sticky-topbar {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body.has-modal-open {
    overflow: hidden;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 32px;
    position: relative;
}

.topbar__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    width: auto;
    flex: 0 0 auto;
}

.topbar--superadmin {
    background: #0b1f3a;
    color: #ffffff;
}

.topbar--superadmin .brand-lockup {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.topbar--superadmin .brand-lockup__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.erp-sticky-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
}

.erp-topbar-spacer {
    display: none;
}

.erp-header-spacer {
    flex-shrink: 0;
}

.topbar--tenant-brand {
    padding: 16px 20px;
    border: none;
    background: var(--gagp-navy);
    box-shadow: 0 4px 24px rgba(11, 31, 58, 0.28);
}

.topbar--tenant-brand .brand-lockup {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    min-width: 0;
    color: #ffffff;
}

.topbar--tenant-brand .brand-lockup__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.topbar--tenant-brand .brand-lockup strong {
    color: #ffffff;
    line-height: 1.15;
}

.topbar--tenant-brand .brand-lockup span {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.2;
}

.topbar--tenant-brand .topbar__center-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.01em;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.topbar--tenant-brand .topbar__center-title-subtitle {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.topbar--superadmin .brand-lockup,
.topbar--superadmin .brand-lockup strong,
.topbar--superadmin .brand-lockup span,
.topbar--superadmin .topbar__center-title,
.topbar--superadmin .welcome-chip,
.topbar--superadmin .welcome-chip--link,
.topbar--superadmin .logout-link {
    color: #ffffff;
}

.topbar--superadmin .brand-lockup span {
    color: rgba(255, 255, 255, 0.82);
}

.topbar--erp {
    background: rgba(248, 251, 255, 0.72);
    border-bottom: 1px solid rgba(191, 211, 235, 0.72);
    backdrop-filter: blur(10px);
}

.topbar__center-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
    max-width: calc(100% - 360px);
    line-height: 1.2;
    pointer-events: none;
    color: var(--gagp-muted);
}

.brand-lockup {
    display: flex;
    align-items: center;
    color: var(--gagp-navy);
}

.topbar--superadmin .brand-lockup,
.topbar--superadmin .brand-lockup__text,
.topbar--superadmin .brand-lockup__text strong {
    color: #ffffff;
}

.topbar--superadmin .brand-lockup__text strong {
    display: block;
    line-height: 1.15;
}

.topbar--superadmin .brand-lockup__text span {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.2;
}

.brand-lockup img {
    display: block;
    max-height: 56px;
    width: auto;
}

.brand-mark {
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
}

.brand-full {
    width: 300px;
    max-width: 48vw;
}

.hero {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
    display: grid;
    gap: 28px;
}

.hero--superadmin {
    width: min(1520px, calc(100% - 24px));
    grid-template-columns: minmax(0, 1.62fr) minmax(300px, 0.58fr);
}

.hero--superadmin-dashboard {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.hero--superadmin-dashboard .hero__panel {
    min-width: 0;
}

.dashboard-support-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
}

.hero--tenant-dashboard {
    width: min(1720px, calc(100% - 20px));
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    --dashboard-pastel-surface: #f8fbff;
    --dashboard-pastel-surface-alt: #eef4fb;
    --dashboard-pastel-surface-soft: #ffffff;
    --dashboard-pastel-border: #d6e4f3;
    --dashboard-pastel-border-strong: #c1d3ea;
    --dashboard-pastel-shadow: 0 16px 32px rgba(30, 90, 165, 0.10);
    --dashboard-pastel-shadow-hover: 0 20px 36px rgba(30, 90, 165, 0.14);
    --dashboard-pastel-text: var(--gagp-navy);
    --dashboard-pastel-muted: var(--gagp-muted);
    --dashboard-pastel-accent: var(--gagp-accent-soft);
    --dashboard-pastel-accent-border: #c4d7ef;
    --dashboard-pastel-accent-strong: #d5e4f6;
    --dashboard-pastel-warm: #edf4fc;
    --dashboard-pastel-warm-border: #d2e1f2;
    background: rgba(223, 233, 247, 0.52);
    border: 1px solid rgba(196, 215, 239, 0.8);
    border-radius: 32px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(30, 90, 165, 0.10);
}

body.tenant-dashboard-page .hero--tenant-dashboard .hero__panel--dashboard-summary {
    background: rgba(248, 251, 255, 0.76);
    border-color: rgba(196, 215, 239, 0.9);
}

.hero--tenant-dashboard .hero__panel {
    background: var(--theme-surface-strong);
    min-width: 0;
}

.erp-workspace__content {
    min-width: 0;
    display: grid;
    gap: 20px;
}

.tenant-menu-bar {
    margin: 0;
    padding: 0;
    position: fixed;
    top: var(--erp-topbar-h, 72px);
    left: 0;
    right: 0;
    z-index: 140;
    background: var(--gagp-navy);
    isolation: isolate;
    overflow: visible;
}

.tenant-menu-bar__inner,
.tenant-menu-panel__inner {
    padding: 16px 20px;
    border: 1px solid var(--theme-border);
    background: var(--gagp-navy);
    box-shadow: 0 24px 60px rgba(11, 31, 58, 0.22);
}

.tenant-menu-bar__inner {
    border-top-color: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
}

.tenant-menu-panel {
    position: relative;
    margin-top: 0;
    z-index: 141;
    overflow: visible;
}

.tenant-menu-panel__inner {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 142;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - var(--erp-topbar-h, 72px) - var(--erp-menubar-h, 60px) - 16px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
    border: 1px solid var(--theme-border);
    margin-top: 6px;
    padding-bottom: 12px;
    background: var(--gagp-navy);
    display: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
}
.tenant-menu-panel__inner::-webkit-scrollbar {
    width: 4px;
}
.tenant-menu-panel__inner::-webkit-scrollbar-track {
    background: transparent;
}
.tenant-menu-panel__inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.tenant-menu-panel--open .tenant-menu-panel__inner {
    display: block;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
}

.tenant-menu-panel[hidden] {
    display: none;
}

.tenant-menu-panel--ready[hidden] {
    display: none;
}

.tenant-menu-panel--ready:not(.tenant-menu-panel--open) .tenant-menu-panel__inner {
    display: none;
}

.tenant-menu-panel--ready.tenant-menu-panel--open .tenant-menu-panel__inner {
    border-radius: 0 24px 24px 0;
}

.tenant-menu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.tenant-menu-toggle__lead {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tenant-menu-toggle__menu-icon,
.tenant-menu-toggle__module-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    flex: 0 0 auto;
}

.tenant-menu-toggle__menu-icon {
    transition: transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
    will-change: transform;
}

.tenant-menu-toggle__menu-icon svg,
.tenant-menu-toggle__module-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tenant-menu-toggle__menu-icon svg {
    transition: transform 0.22s ease;
}

.tenant-menu-toggle__text {
    min-width: 0;
    display: grid;
    gap: 2px;
    text-align: left;
}

.tenant-menu-toggle__text span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tenant-menu-toggle__text strong {
    color: #ffffff;
    font-size: 20px;
    line-height: 1.2;
}

.tenant-menu-toggle--open .tenant-menu-toggle__menu-icon,
.tenant-menu-toggle--open .tenant-menu-toggle__module-icon {
    background: rgba(255, 255, 255, 0.22);
}

.tenant-menu-toggle--open .tenant-menu-toggle__menu-icon {
    transform: rotate(90deg) scale(1.06);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.tenant-menu-toggle--open .tenant-menu-toggle__menu-icon svg {
    transform: scale(1.06);
}

.tenant-menu-toggle:active .tenant-menu-toggle__menu-icon {
    transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
    .tenant-menu-toggle__menu-icon,
    .tenant-menu-toggle__menu-icon svg {
        transition: none;
    }
}

.erp-sidebar__nav {
    display: grid;
    gap: 12px;
}

.erp-nav-group {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.erp-nav-group__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}

.erp-nav-group__summary::-webkit-details-marker {
    display: none;
}

.erp-nav-group__summary-main,
.erp-nav-group__summary-side {
    display: flex;
    align-items: center;
    gap: 10px;
}

.erp-nav-group__summary-main {
    min-width: 0;
    flex: 1;
}

.erp-nav-group__label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.erp-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.erp-nav-group__caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.18s ease;
}

.erp-nav-group[open] .erp-nav-group__caret {
    transform: rotate(90deg);
}

.erp-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    flex: 0 0 auto;
}

.erp-nav-icon--sub {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.erp-nav-icon svg,
.erp-nav-group__caret svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erp-nav-list {
    list-style: none;
    margin: 0;
    padding: 0 10px 10px;
}

.erp-nav-list li + li {
    margin-top: 8px;
}

.erp-nav-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    text-decoration: none;
    color: #ffffff;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.erp-nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(1px);
}

.erp-nav-link__text {
    min-width: 0;
}

.erp-nav-link__text strong,
.erp-nav-link__text span {
    display: block;
}

.erp-nav-link__text strong {
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
}

.erp-nav-link__text span {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 12px;
    line-height: 1.45;
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    align-items: start;
}

.dashboard-card-grid > * {
    min-width: 0;
}

.dashboard-card-grid--setup {
    margin-top: 18px;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.data-card {
    display: grid;
    gap: 6px;
    align-content: start;
    min-width: 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #dbe3ef;
}

.data-card--warning {
    background: #fff8ee;
    border-color: #ead0a2;
}

.data-card--baja {
    background: #fff0f2;
    border-color: #efb8c2;
}

.data-card--activo {
    background: #eefaf1;
    border-color: #a9d7b4;
}

.data-card > strong,
.data-card > span,
.data-card > small,
.data-card > div,
.data-card > p {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.data-card > strong {
    color: var(--gagp-navy);
    line-height: 1.4;
}

.data-card > span:not(.data-card__label) {
    color: var(--gagp-muted);
    line-height: 1.5;
}

.data-card__label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gagp-muted);
}

.verifactu-trace-card {
    min-width: 0;
}

.verifactu-trace-card > strong,
.verifactu-trace-card > span,
.verifactu-trace-card > div {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.verifactu-trace-card__value {
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
}

.invoice-info-toggle {
    margin-top: 14px;
}

.invoice-info-toggle--inline {
    margin-top: 0;
    position: relative;
    align-self: flex-end;
}

.invoice-info-toggle--inline[open] {
    z-index: 6;
}

.invoice-info-toggle--inline .invoice-info-toggle__body {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    padding: 16px;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow);
}

.invoice-info-toggle summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}

.invoice-info-toggle summary::-webkit-details-marker {
    display: none;
}

.invoice-info-toggle__body {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.dashboard-card-grid--executive-pair {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-card-grid--stacked {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-status-block {
    margin-top: 22px;
}

.hero__panel--dashboard-summary {
    display: grid;
    gap: 22px;
}

.hero__panel--dashboard-summary > *,
.dashboard-async-block,
.dashboard-async-block > *,
.dashboard-analytics-card,
.dashboard-executive-card,
.dashboard-executive-card__summary,
.dashboard-executive-card__detail,
.dashboard-follow-up-card__summary,
.dashboard-follow-up-card__detail,
.kpi {
    min-width: 0;
    max-width: 100%;
}

.kpi.kpi--summary-first {
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 920px) {
    .kpi.kpi--summary-first {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .kpi.kpi--summary-first {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hero__panel--dashboard-summary h1 {
    margin: 0;
}

.hero__panel--dashboard-summary p,
.hero__panel--dashboard-summary .hero__list,
.hero__panel--dashboard-summary .actions {
    margin-top: 0;
}

.actions--dashboard-summary .button {
    background: var(--dashboard-pastel-accent);
    border-color: var(--dashboard-pastel-accent-border);
    color: var(--dashboard-pastel-text);
    box-shadow: var(--dashboard-pastel-shadow);
}

.actions--dashboard-summary .button:hover {
    border-color: var(--dashboard-pastel-border-strong);
    box-shadow: var(--dashboard-pastel-shadow-hover);
}

.actions--dashboard-summary .button--secondary {
    background: var(--dashboard-pastel-warm);
    border-color: var(--dashboard-pastel-warm-border);
    color: var(--dashboard-pastel-text);
}

.dashboard-module-shortcuts {
    display: grid;
    gap: 16px;
}

.dashboard-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.dashboard-module-card {
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 26px;
    background: var(--dashboard-pastel-surface-alt);
    border: 1px solid var(--dashboard-pastel-border);
    box-shadow: var(--dashboard-pastel-shadow);
    color: var(--dashboard-pastel-text);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-module-card:hover,
.dashboard-module-card:focus {
    transform: translateY(-2px);
    border-color: var(--dashboard-pastel-border-strong);
    box-shadow: var(--dashboard-pastel-shadow-hover);
    outline: none;
}

.dashboard-module-card__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.dashboard-module-card__icon,
.dashboard-module-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.dashboard-module-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--dashboard-pastel-accent-strong);
    border: 1px solid var(--dashboard-pastel-accent-border);
}

.dashboard-module-card__icon svg,
.dashboard-module-link__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-module-card__eyebrow {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dashboard-pastel-muted);
}

.dashboard-module-card h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    color: var(--dashboard-pastel-text);
}

.dashboard-module-card__summary {
    margin: 0;
    color: var(--dashboard-pastel-muted);
    line-height: 1.6;
    font-size: 14px;
}

.dashboard-module-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--dashboard-pastel-accent);
    border: 1px solid var(--dashboard-pastel-accent-border);
    color: var(--dashboard-pastel-text);
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
}

.dashboard-module-card--form {
    margin: 0;
}

.dashboard-module-card--action {
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
    appearance: none;
}

.dashboard-module-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--dashboard-pastel-accent);
    border: 1px solid var(--dashboard-pastel-accent-border);
    color: var(--dashboard-pastel-text);
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
    cursor: pointer;
}

.dashboard-module-card__button[disabled] {
    opacity: 0.52;
    cursor: not-allowed;
}

.dashboard-card-grid--summary-extras,
.dashboard-financial-grid {
    margin-top: 18px;
}

.dashboard-analytics-card {
    display: grid;
    gap: 16px;
}

.dashboard-executive-card {
    display: grid;
    gap: 18px;
}

.dashboard-executive-card__body {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
    align-items: start;
}

.dashboard-executive-card__summary,
.dashboard-executive-card__detail {
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 18px;
    border-radius: 22px;
    background: var(--dashboard-pastel-surface-soft);
    border: 1px solid var(--dashboard-pastel-border);
    box-shadow: var(--dashboard-pastel-shadow);
}

.dashboard-executive-card__summary .kpi {
    margin-top: 0;
}

.dashboard-executive-card__detail .dashboard-subtitle {
    margin-bottom: 0;
}

.dashboard-executive-card .data-list__row {
    flex-wrap: wrap;
    align-items: flex-start;
}

.dashboard-executive-card .data-list__row > div:first-child {
    flex: 1 1 260px;
    min-width: 0;
}

.dashboard-executive-card .data-list__meta {
    flex: 0 0 auto;
    min-width: fit-content;
}

.dashboard-follow-up-card__body {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: start;
}

.dashboard-follow-up-card__summary,
.dashboard-follow-up-card__detail {
    display: grid;
    gap: 16px;
    align-content: start;
    padding: 18px;
    border-radius: 22px;
    background: var(--dashboard-pastel-surface-soft);
    border: 1px solid var(--dashboard-pastel-border);
    box-shadow: var(--dashboard-pastel-shadow);
}

.dashboard-follow-up-card__summary .kpi {
    margin-top: 0;
}

.dashboard-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.dashboard-card-actions .button {
    min-height: 40px;
    background: var(--dashboard-pastel-accent);
    border-color: var(--dashboard-pastel-accent-border);
    color: var(--dashboard-pastel-text);
    box-shadow: none;
}

.dashboard-inline-link {
    color: var(--gagp-navy);
    text-decoration: none;
}

.dashboard-inline-link:hover,
.dashboard-inline-link:focus {
    color: var(--gagp-primary);
    text-decoration: underline;
}

.dashboard-chart {
    display: grid;
    align-items: end;
    gap: 12px;
    min-height: 270px;
    padding: 18px 0 0;
}

.dashboard-chart-scroll {
    width: 100%;
    min-width: 0;
}

.dashboard-chart-scroll--monthly {
    overflow: visible;
    padding-bottom: 0;
}

.dashboard-chart-scroll--annual {
    overflow: visible;
    padding-bottom: 0;
}

.dashboard-chart-scroll--canvas {
    min-width: 0;
}

.dashboard-chart-canvas {
    min-width: 0;
}

.dashboard-chart-canvas--monthly {
    height: 320px;
}

.dashboard-chart-canvas--annual {
    height: 300px;
}

.dashboard-chart-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
}

.dashboard-chart-scroll--monthly .dashboard-chart--monthly {
    width: auto;
    min-width: 0;
}

.dashboard-chart-scroll--annual .dashboard-chart--annual {
    width: auto;
    min-width: 0;
}

.dashboard-chart--monthly {
    grid-template-columns: repeat(12, minmax(42px, 1fr));
}

.dashboard-chart--annual {
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.dashboard-chart__group {
    display: grid;
    align-items: end;
    justify-items: center;
    gap: 10px;
    min-width: 0;
}

.dashboard-chart__bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    min-height: 180px;
    width: 100%;
    padding: 0 4px;
}

.dashboard-chart__bar {
    display: block;
    width: 14px;
    min-height: 10px;
    border-radius: 999px 999px 10px 10px;
    box-shadow: 0 12px 24px rgba(8, 20, 38, 0.12);
}

.dashboard-chart__bar--income {
    background: linear-gradient(180deg, #2b8cff 0%, #0b4f8a 100%);
}

.dashboard-chart__bar--expense {
    background: linear-gradient(180deg, #f7b267 0%, #b65c00 100%);
}

.dashboard-chart__label {
    color: var(--gagp-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-chart__net {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.dashboard-chart__net--positive {
    background: #dbf3e4;
    color: #16613b;
}

.dashboard-chart__net--negative {
    background: #fde7cf;
    color: #8a4f12;
}

.dashboard-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 4px;
    color: var(--gagp-muted);
    font-size: 13px;
    font-weight: 600;
}

.dashboard-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dashboard-chart__legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.dashboard-chart__legend-swatch--income {
    background: #0b4f8a;
}

.dashboard-chart__legend-swatch--expense {
    background: #b65c00;
}

.dashboard-status-block .auth-message,
.dashboard-status-block .auth-error {
    margin: 0;
}

.dashboard-inline-copy {
    margin-top: 16px;
    color: var(--gagp-muted);
    line-height: 1.6;
}

.kpi__note {
    display: block;
    margin-top: 8px;
    color: var(--gagp-muted);
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-split-grid > * {
    min-width: 0;
}

#dashboard-top-customers .dashboard-split-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

#dashboard-top-customers .data-list__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.dashboard-subtitle {
    margin: 0 0 12px;
    color: var(--gagp-deep);
    font-size: 16px;
}

.data-list--compact {
    margin-top: 0;
}

.data-list--compact .data-list__row {
    padding: 12px 14px;
    border-radius: 14px;
}

.dashboard-alert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-alert-grid--quad {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-alert-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--dashboard-pastel-surface-soft);
    border: 1px solid var(--dashboard-pastel-border);
    box-shadow: var(--dashboard-pastel-shadow);
}

.dashboard-alert-card--highlight {
    border-color: var(--color-warning, #f59e0b);
    background: #fffbeb;
}

.dashboard-page-nav {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1rem;
}
.dashboard-page-nav__pill {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: var(--color-surface, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    color: var(--color-text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dashboard-page-nav__pill:hover {
    background: var(--gagp-primary, #1e5aa5);
    color: #fff;
    border-color: var(--gagp-primary, #1e5aa5);
    text-decoration: none;
}

.dashboard-alert-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-alert-card__head .dashboard-subtitle {
    margin: 0;
}

.dashboard-alert-card__summary {
    margin: 0 0 14px;
    color: var(--gagp-muted);
    line-height: 1.6;
}

.quote-lines-tools--conditions {
    margin-top: 18px;
    align-items: center;
}

.tenant-table--quote-conditions th,
.tenant-table--quote-conditions td {
    vertical-align: middle;
}

.tenant-table--quote-conditions input,
.tenant-table--quote-conditions select {
    min-width: 130px;
}

.tenant-table--quote-conditions input[type="text"] {
    min-width: 180px;
}

.tenant-table--quote-conditions select.js-quote-condition-type {
    min-width: 140px;
}

.tenant-table--quote-conditions select[name="condicion_forma_pago_id[]"] {
    min-width: 210px;
}

.tenant-table--quote-conditions select[name="condicion_banco_id[]"] {
    min-width: 180px;
}

.portal-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    margin: 0 0 18px;
    border-bottom: 2px solid #e2e8f0;
}

.portal-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 10px 10px 0 0;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.portal-tab:hover {
    color: #0f3d6e;
    background: #f1f5f9;
}

.portal-tab.is-active {
    color: #0f3d6e;
    border-bottom-color: #0f3d6e;
}

.portal-tab-panel[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .portal-tabs {
        gap: 4px;
    }

    .portal-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 9px 4px;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
        border-radius: 8px 8px 0 0;
    }
}

@media (max-width: 360px) {
    .portal-tab {
        font-size: 12px;
        letter-spacing: -0.2px;
    }
}

.crm-cal-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 0 12px;
}

.crm-cal-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 0 14px;
    font-size: 13px;
    color: #475569;
}

.crm-cal-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 4px;
}

.crm-cal-dot--future { background: #2563eb; }
.crm-cal-dot--late { background: #dc2626; }
.crm-cal-dot--done { background: #16a34a; }

.crm-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    margin-bottom: 4px;
}

.crm-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.crm-cal-day {
    min-height: 86px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    background: #fff;
    overflow: hidden;
}

.crm-cal-day--empty {
    background: #f8fafc;
    border-style: dashed;
}

.crm-cal-day--today {
    border-color: #0f3d6e;
    box-shadow: 0 0 0 2px rgba(15, 61, 110, 0.15);
}

.crm-cal-daynum {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 3px;
}

.crm-cal-task {
    font-size: 11px;
    line-height: 1.3;
    padding: 2px 5px;
    border-radius: 5px;
    margin-bottom: 3px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.crm-cal-task--future { background: #2563eb; }
.crm-cal-task--late { background: #dc2626; }
.crm-cal-task--done { background: #16a34a; }

.erp-translate-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1180px;
    margin: 12px auto 0;
    padding: 12px 16px;
    border: 1px solid #c7dcf5;
    border-left: 4px solid #0f3d6e;
    border-radius: 12px;
    background: #eef4fb;
    color: #1f2d3d;
    font-size: 14px;
}

.erp-translate-hint__icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: #0f3d6e;
}

.erp-translate-hint__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.erp-translate-hint__text {
    flex: 1 1 auto;
    line-height: 1.4;
}

.erp-translate-hint__close {
    flex: 0 0 auto;
    border: 1px solid #0f3d6e;
    background: #0f3d6e;
    color: #ffffff;
    border-radius: 999px;
    padding: 7px 16px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.erp-translate-hint__close:hover {
    background: #0b2e54;
}

@media (max-width: 640px) {
    .erp-translate-hint {
        flex-wrap: wrap;
        margin: 12px 12px 0;
    }
}

.topbar-lang {
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 36px;
    padding: 0 32px 0 34px;
    cursor: pointer;
    flex: 0 0 auto;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image:
        url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22/%3E%3Cline%20x1%3D%223%22%20y1%3D%2212%22%20x2%3D%2221%22%20y2%3D%2212%22/%3E%3Cpath%20d%3D%22M12%203a15%2015%200%200%201%200%2018%2015%2015%200%200%201%200-18%22/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%20stroke-width%3D%222.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 9px center, right 10px center;
    background-size: 17px 17px, 13px 13px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-lang:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.topbar-lang:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.topbar-lang option {
    color: #1f2937;
    background: #ffffff;
    font-weight: 500;
}

.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    flex: 0 0 auto;
}

.topbar-bell:hover {
    background: rgba(255, 255, 255, 0.16);
}

.topbar-bell__icon {
    display: inline-flex;
}

.topbar-bell__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-bell__badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

@media (max-width: 600px) {
    .crm-cal-day { min-height: 58px; }
    .crm-cal-task { font-size: 10px; padding: 1px 4px; }
    .crm-cal-weekdays { font-size: 10px; }
}

.detail-grid {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-grid div {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(206, 216, 230, 0.7);
}

.detail-grid div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-grid dt {
    color: var(--gagp-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-grid dd {
    margin: 0;
    color: var(--gagp-text);
    font-weight: 600;
    line-height: 1.5;
}

.module-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kpi--compact {
    margin-top: 0;
}

.setup-panel {
    padding-top: 28px;
}

.tenant-create-form--compact {
    margin-top: 18px;
}

.setup-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 8px;
}

.setup-shortcuts-card__header p {
    margin: 8px 0 0;
    color: var(--gagp-muted);
}

.setup-shortcuts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.setup-shortcut {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--color-surface, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    color: var(--gagp-muted);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.setup-shortcut:hover,
.setup-shortcut:focus {
    background: var(--gagp-primary, #1e5aa5);
    color: #fff;
    border-color: var(--gagp-primary, #1e5aa5);
    text-decoration: none;
    outline: none;
}

.setup-shortcut strong {
    display: inline;
    color: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0;
}

.setup-shortcut span {
    display: none;
}

.card--wide {
    grid-column: 1 / -1;
}

.tenant-table-wrap--compact {
    margin-top: 16px;
}

.tenant-table-wrap--scroll-20 {
    max-height: 1180px;
    overflow-y: auto;
}

.tenant-table-wrap--scroll-20 .tenant-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.hero__panel,
.card {
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 28px;
    box-shadow: var(--theme-shadow);
}

.hero__panel {
    padding: 36px;
}

.hero__panel--tenant-access-header {
    background: linear-gradient(135deg, var(--gagp-deep) 0%, var(--gagp-navy) 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(11, 31, 58, 0.24);
}

.hero__panel--tenant-access-header .hero__eyebrow {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.hero__panel--tenant-access-header h1 {
    margin: 0 0 12px;
}

.hero__panel--tenant-access-header p {
    margin: 0;
}

.hero__panel--tenant-access-header h1,
.hero__panel--tenant-access-header p,
.hero__panel--tenant-access-header .hero__list,
.hero__panel--tenant-access-header .hero__list li,
.hero__panel--tenant-access-header .actions,
.hero__panel--tenant-access-header .welcome-chip {
    color: rgba(255, 255, 255, 0.92);
}

.hero__panel--tenant-access-header .hero__list li:before {
    background: rgba(255, 255, 255, 0.82);
}

.hero__panel--tenant-access-header .button--secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.hero__panel--tenant-access-header .button--secondary:hover,
.hero__panel--tenant-access-header .button--secondary:focus {
    border-color: rgba(255, 255, 255, 0.34);
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--gagp-accent-soft);
    color: var(--gagp-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: 42px;
    line-height: 1.08;
    color: var(--gagp-deep);
}

.hero__panel--tenant-access-header h1 {
    margin: 8px 0 12px;
    color: rgba(255, 255, 255, 0.92);
}

.hero p {
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--gagp-muted);
}

.hero__list,
.info-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
}

.hero__list li,
.info-list li {
    position: relative;
    padding: 0 0 0 20px;
    margin: 0 0 14px;
    line-height: 1.55;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero__list li:before,
.info-list li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gagp-primary);
}

.grid {
    display: grid;
    gap: 18px;
}

.card {
    padding: 24px;
}

.card h2,
.card h3 {
    margin: 0 0 12px;
    color: var(--gagp-deep);
}

.setup-inline-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--theme-surface-soft);
    border: 1px solid var(--theme-border);
    color: var(--gagp-muted);
    font-size: 14px;
    line-height: 1.5;
}

.kpi {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.kpi.kpi--triple {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi__item {
    padding: 18px;
    border-radius: 20px;
    background: var(--theme-surface-strong);
    border: 1px solid var(--theme-border);
    min-width: 0;
}

.kpi__item--highlight {
    background: var(--theme-accent);
    border-color: var(--theme-border-strong);
    box-shadow: var(--theme-shadow);
}

.kpi__item--highlight .kpi__label,
.kpi__item--highlight .kpi__note {
    color: var(--gagp-muted);
}

.kpi__item--highlight .kpi__value {
    color: var(--gagp-navy);
}

.hero__panel--dashboard-summary .button--primary,
.qr-modal[data-dashboard-summary-modal="1"] .button--primary {
    background: var(--dashboard-pastel-accent);
    border-color: var(--dashboard-pastel-accent-border);
    color: var(--dashboard-pastel-text);
    box-shadow: var(--dashboard-pastel-shadow);
}

.hero__panel--dashboard-summary .button--secondary,
.qr-modal[data-dashboard-summary-modal="1"] .button--secondary {
    background: var(--dashboard-pastel-warm);
    border-color: var(--dashboard-pastel-warm-border);
    color: var(--dashboard-pastel-text);
}

.hero__panel--dashboard-summary .button:hover,
.qr-modal[data-dashboard-summary-modal="1"] .button:hover {
    border-color: var(--dashboard-pastel-border-strong);
    box-shadow: var(--dashboard-pastel-shadow-hover);
}

.kpi__label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gagp-muted);
    overflow-wrap: anywhere;
}

.kpi__value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: var(--gagp-navy);
    overflow-wrap: anywhere;
}

.kpi__value--positive {
    color: #1f7a3d;
}

.kpi__value--negative {
    color: #b42318;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: var(--theme-accent);
    border-color: var(--theme-border-strong);
    color: var(--gagp-navy);
    box-shadow: var(--theme-shadow);
}

.button--secondary {
    background: var(--theme-warm);
    border-color: var(--theme-border);
    color: var(--gagp-navy);
}

.button--table {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    background: var(--theme-surface-soft);
    border-color: var(--theme-border);
    color: var(--gagp-navy);
    box-shadow: none;
}

.button--cta {
    background: #d6f0e0;
    border-color: #8ecba8;
    color: #1a5c35;
    box-shadow: 0 2px 6px rgba(22, 101, 52, 0.10);
}

.button--cta:hover,
.button--cta:focus {
    background: #c2e8d0;
    border-color: #6db88a;
    box-shadow: 0 4px 10px rgba(22, 101, 52, 0.16);
}

.button--primary:hover,
.button--primary:focus,
.button--secondary:hover,
.button--secondary:focus,
.button--table:hover,
.button--table:focus {
    border-color: var(--theme-border-strong);
    box-shadow: var(--theme-shadow-hover);
}

.button--icon {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
}

.button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.button__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button__label-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.button__loading-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    flex: 0 0 auto;
    animation: pos-action-spin 0.72s linear infinite;
}

.button--loading {
    pointer-events: none;
    opacity: 0.84;
}

.button--loading .button__loading-spinner {
    display: inline-block;
}

.button--loading .button__icon {
    display: none;
}

.client-submit-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.client-submit-button__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    flex: 0 0 auto;
}

.client-submit-button.is-submitting {
    pointer-events: none;
    opacity: 0.84;
}

.client-submit-button.is-submitting .client-submit-button__spinner {
    display: inline-block;
    animation: pos-action-spin 0.72s linear infinite;
}

.button--danger {
    background: #fbe4e8;
    border-color: #f1b7c1;
    color: #8c2336;
}

.pos-webserial-toolbar-button {
    gap: 8px;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.pos-webserial-toolbar-button .button__icon {
    width: 14px;
    height: 14px;
}

.pos-webserial-toolbar-button--inactive {
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
    border-color: rgba(248, 113, 113, 0.3);
    color: #ffffff;
}

.pos-webserial-toolbar-button--inactive:hover,
.pos-webserial-toolbar-button--inactive:focus-visible {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    color: #ffffff;
}

.pos-webserial-toolbar-button--active {
    background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
    border-color: rgba(34, 197, 94, 0.36);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.16);
}

.pos-webserial-toolbar-button--active:hover,
.pos-webserial-toolbar-button--active:focus-visible {
    background: linear-gradient(135deg, #14532d 0%, #15803d 100%);
    color: #ffffff;
}

.pos-page .button.pos-action-pending,
.pos-page .pos-family-card.pos-action-pending,
.pos-page .pos-subfamily-chip.pos-action-pending {
    position: relative;
    pointer-events: none;
}

.pos-page .button.pos-action-pending:hover,
.pos-page .pos-family-card.pos-action-pending:hover,
.pos-page .pos-subfamily-chip.pos-action-pending:hover {
    transform: none;
}

.pos-page .pos-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pos-page .pos-submit-button__spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: pos-action-spin 0.72s linear infinite;
    flex: 0 0 auto;
}

.pos-page .pos-submit-button--loading {
    pointer-events: none;
    opacity: 0.82;
}

.pos-page .pos-submit-button--loading .pos-submit-button__spinner {
    display: inline-block;
}

.pos-page .pos-submit-button--loading .button__icon {
    display: none;
}

.pos-page .pos-family-card.pos-action-pending > *,
.pos-page .pos-subfamily-chip.pos-action-pending > * {
    opacity: 0;
}

.pos-page .pos-family-card.pos-action-pending::after,
.pos-page .pos-subfamily-chip.pos-action-pending::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(11, 31, 58, 0.18);
    border-top-color: var(--gagp-navy);
    border-radius: 50%;
    animation: pos-action-spin 0.72s linear infinite;
}

.pos-page .button--primary.pos-action-pending::after {
    border-color: rgba(255, 255, 255, 0.26);
    border-top-color: #ffffff;
}

.pos-page .pos-family-card.pos-action-pending::after,
.pos-page .pos-subfamily-chip.pos-action-pending::after,
.pos-page .button--danger.pos-action-pending::after {
    border-color: rgba(140, 35, 54, 0.22);
    border-top-color: #8c2336;
}

@keyframes pos-action-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.logout-form {
    margin: 0;
}

.logout-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
}

.logout-link:hover,
.logout-link:focus {
    color: #ffffff;
    text-decoration: underline;
}

.access-link-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    background: var(--theme-surface-soft);
}

.form-grid--access {
    align-items: end;
}

.access-link-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.hero--auth {
    align-items: start;
}

.hero--auth-single {
    grid-template-columns: minmax(0, 1fr);
    width: min(720px, calc(100% - 32px));
}

.hero--portal-orders {
    width: min(1320px, calc(100% - 20px));
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.hero--portal-orders .grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
    align-items: start;
}

.hero--portal-orders .grid > .card:first-child,
.hero--portal-orders .grid > .card:last-child {
    grid-column: 1 / -1;
}

.hero--portal-orders .card,
.hero--portal-orders .tenant-table-wrap,
.hero--portal-orders .tenant-table,
.hero--portal-orders .detail-grid,
.hero--portal-orders .detail-grid div {
    min-width: 0;
}

.hero--portal-orders .tenant-table-wrap {
    -webkit-overflow-scrolling: touch;
}

.hero--portal-orders .tenant-table {
    min-width: 700px;
}

.hero--portal-orders .card--portal-cart {
    background: linear-gradient(180deg, #f6f3ea 0%, #efe7d8 100%);
    border: 1px solid #ddd1bb;
    box-shadow: 0 14px 30px rgba(94, 78, 52, 0.08);
}

.hero--portal-orders .card--portal-cart .tenant-table-wrap {
    background: rgba(255, 251, 244, 0.7);
    border-color: rgba(157, 135, 98, 0.28);
}

.hero--portal-orders .card--portal-cart .tenant-table th {
    background: rgba(228, 215, 191, 0.72);
    color: #5c4930;
}

.hero--portal-orders .card--portal-cart .quick-links a {
    background: rgba(230, 217, 193, 0.62);
    border: 1px solid rgba(157, 135, 98, 0.24);
    color: #4f402c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero--portal-orders .card--portal-cart .quick-links a span {
    color: #7a6850;
}

.hero--portal-orders .card--portal-cart .button--primary {
    background: #dcc6a0;
    border-color: #c2a67a;
    color: #4f3d26;
    box-shadow: 0 8px 18px rgba(133, 104, 63, 0.14);
}

.hero--portal-orders .card--portal-cart .button--secondary {
    background: #eadcc3;
    border-color: #d1b890;
    color: #5b462d;
}

.hero--portal-orders .card--portal-cart .button--danger {
    background: #fbe4e8;
    border-color: #f1b7c1;
    color: #8c2336;
    box-shadow: none;
}

.hero--portal-orders .card--portal-cart .button--icon {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
}

.hero--portal-orders .card--portal-cart .button--icon .button__icon,
.hero--portal-orders .card--portal-cart .button--icon .button__icon svg {
    width: 16px;
    height: 16px;
}

.hero--portal-orders .card--portal-cart .button--primary:hover,
.hero--portal-orders .card--portal-cart .button--primary:focus,
.hero--portal-orders .card--portal-cart .button--secondary:hover,
.hero--portal-orders .card--portal-cart .button--secondary:focus {
    border-color: #aa8a5d;
    box-shadow: 0 10px 20px rgba(110, 84, 49, 0.18);
}

.hero--portal-orders .card--portal-cart .button--danger:hover,
.hero--portal-orders .card--portal-cart .button--danger:focus {
    border-color: #e59aa8;
    box-shadow: 0 8px 18px rgba(140, 35, 54, 0.14);
}

.hero--portal-orders .card--portal-cart .auth-message {
    background: rgba(230, 217, 193, 0.62);
    border: 1px solid rgba(157, 135, 98, 0.24);
    color: #5b462d;
}

.portal-card-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.portal-card-title__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(120, 96, 58, 0.10);
    color: #7a5f35;
    flex: 0 0 auto;
}

.portal-card-title__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero--portal-orders .tenant-table--portal-catalog,
.hero--portal-orders .tenant-table--portal-cart {
    min-width: 0;
    table-layout: fixed;
}

.hero--portal-orders .tenant-table--portal-catalog th,
.hero--portal-orders .tenant-table--portal-catalog td,
.hero--portal-orders .tenant-table--portal-cart th,
.hero--portal-orders .tenant-table--portal-cart td {
    padding: 12px 10px;
}

.tenant-table--portal-catalog th:first-child,
.tenant-table--portal-catalog td:first-child,
.tenant-table--portal-cart th:first-child,
.tenant-table--portal-cart td:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
}

.tenant-table--portal-catalog th:nth-child(2),
.tenant-table--portal-catalog td:nth-child(3),
.tenant-table--portal-catalog th:nth-child(3),
.tenant-table--portal-catalog td:nth-child(3) {
    width: 92px;
}

.portal-catalog-filters {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    align-items: end;
}

.portal-catalog-filters .filters__group:first-of-type {
    grid-column: 1 / -1;
}

.portal-catalog-filters .filters__actions {
    justify-content: flex-end;
}

.tenant-table--portal-cart th:nth-child(2),
.tenant-table--portal-cart td:nth-child(2) {
    width: 96px;
}

.tenant-table--portal-cart th:nth-child(3),
.tenant-table--portal-cart td:nth-child(3),
.tenant-table--portal-cart th:nth-child(4),
.tenant-table--portal-cart td:nth-child(4) {
    width: 96px;
}

.tenant-table--portal-catalog th:last-child,
.tenant-table--portal-catalog td:last-child {
    width: 56px;
}

.tenant-table--portal-cart th:last-child,
.tenant-table--portal-cart td:last-child {
    width: 64px;
}

.portal-cart-qty-input {
    max-width: 44px;
    min-width: 44px;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
}

.row-actions__form--portal-cart {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.row-actions__form--portal-remove {
    display: flex;
    justify-content: center;
}

body.portal-modal-open {
    overflow: hidden;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.auth-card-logo-wrap {
    display: flex;
    justify-content: center;
    margin: 0 0 12px;
}

.auth-card-logo {
    display: block;
    max-width: 180px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-card-client-name {
    margin: 0 0 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--gagp-deep);
}

.card > h2 + p,
.card > h2 + .auth-card-logo-wrap + .auth-card-client-name + p {
    margin-top: 0;
}

.auth-otp-hint {
    margin: 0 0 14px;
    text-align: center;
    font-size: 14px;
    color: var(--gagp-muted);
}

.auth-message,
.auth-error {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-message {
    background: var(--theme-surface-soft);
    border: 1px solid var(--theme-border);
    color: var(--gagp-navy);
}

.auth-error {
    background: #f7d9de;
    color: #8c2336;
}

.welcome-chip {
    display: inline-flex;
    align-items: center;
    padding: 0;
    min-height: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 700;
}

.welcome-chip--link {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.welcome-chip--link:hover,
.welcome-chip--link:focus {
    color: #ffffff;
    text-decoration: underline;
}

.topbar--portal-client {
    gap: 16px;
}

.topbar--portal-client .brand-lockup {
    flex: 0 1 auto;
    min-width: 0;
}

.topbar--portal-client .topbar__center-title {
    position: static;
    left: auto;
    transform: none;
    pointer-events: auto;
    max-width: none;
    margin-left: auto;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-align: right;
    gap: 2px;
}

.topbar--portal-client .topbar__actions {
    margin-left: 0;
}

.topbar--portal-client .welcome-chip--link {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar--portal-client .topbar__center-title-subtitle {
    color: rgba(255, 255, 255, 0.76);
}

.quick-links {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.quick-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--gagp-surface-alt);
    color: var(--gagp-navy);
    text-decoration: none;
    font-weight: 600;
}

.quick-links a span {
    color: var(--gagp-muted);
    font-weight: 400;
}

.panel-section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(206, 216, 230, 0.9);
}

.panel-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-section__head h2 {
    margin: 0;
    color: var(--gagp-deep);
}

.panel-section__head span {
    color: var(--gagp-muted);
    font-size: 13px;
}

.panel-section__head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.panel-section__head--compact {
    align-items: center;
    margin-bottom: 12px;
}

.panel-section__head--pos-terminal {
    padding: 16px 20px;
    border: 1px solid var(--theme-border);
    border-radius: 24px;
    background: var(--theme-surface);
    box-shadow: var(--theme-shadow);
}

.panel-section__head--pos-terminal h2 {
    color: var(--gagp-deep);
}

.panel-section__head--pos-terminal span {
    color: var(--gagp-muted);
}

.filters {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) auto;
    gap: 14px;
    margin-bottom: 18px;
}

.filters--clients {
    grid-template-columns: minmax(280px, 1.7fr) minmax(160px, 0.55fr) minmax(180px, 0.7fr) auto;
    align-items: end;
}

.filters--fiscal-reports {
    grid-template-columns: 1fr;
}

.filters--fiscal-reports .filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.fiscal-report-insights-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.fiscal-report-trend-scroll {
    min-width: 0;
}

.fiscal-report-trend-list {
    min-width: 0;
}

.filters__group--search {
    min-width: 0;
}

.filters__group {
    display: grid;
    gap: 8px;
}

.filters__group label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gagp-muted);
}

.qr-modal[hidden] {
    display: none;
}

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
}

.qr-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 38, 0.58);
    backdrop-filter: blur(4px);
}

.qr-modal__panel {
    position: relative;
    width: min(460px, calc(100% - 24px));
    margin: 16px auto;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(206, 216, 230, 0.9);
    box-shadow: var(--gagp-shadow);
}

.modal-relocated-feedback {
    margin: 12px 0;
    scroll-margin-top: 24px;
}

.qr-modal__panel > * {
    min-width: 0;
}

.qr-modal__panel--wide {
    width: min(720px, calc(100% - 24px));
}

.qr-modal__panel--lookup {
    width: min(1120px, calc(100% - 24px));
}

.qr-modal__panel--xwide {
    width: min(1180px, calc(100% - 24px));
}

@media (min-width: 900px) {
    #customer-orders-detail-modal .dashboard-card-grid--setup,
    #customer-orders-new-modal .dashboard-card-grid--setup {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

#customer-orders-detail-modal .kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#customer-orders-detail-modal .kpi-grid .kpi__item {
    flex: 0 0 auto;
    padding: 10px 16px;
}

.stock-inventory-summary {
    display: grid;
    gap: 8px;
}

.stock-inventory-summary__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.stock-inventory-list-table,
.stock-inventory-detail-table {
    overflow-x: auto;
}

#stock-inventory-detail-modal .tenant-table {
    min-width: 980px;
}

#stock-inventory-detail-modal .tenant-table input[type="number"],
#stock-inventory-detail-modal .tenant-table input[type="text"] {
    min-width: 132px;
}

.stock-inventory-detail-filters-wrap {
    padding: 16px;
    border: 1px solid rgba(206, 216, 230, 0.9);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(246, 249, 252, 0.96) 0%, rgba(238, 244, 249, 0.92) 100%);
}

.stock-inventory-scanner {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(166, 181, 199, 0.45);
    border-radius: 18px;
    background: rgba(12, 25, 42, 0.04);
}

.stock-inventory-scanner[hidden] {
    display: none !important;
}

.stock-inventory-scanner-actions [hidden] {
    display: none !important;
}

.stock-inventory-scanner video {
    width: 100%;
    max-height: 280px;
    border-radius: 14px;
    object-fit: cover;
    background: #091321;
}

.qr-modal__panel h3 {
    margin: 0 0 10px;
    color: var(--gagp-deep);
}

.qr-modal__panel p {
    margin: 0 0 18px;
    color: var(--gagp-muted);
}

.master-lookup-filter-group input {
    min-height: 52px;
    padding: 0 18px;
    font-size: 16px;
}

.detail-grid--modal {
    margin-top: 0;
}

.detail-grid dd.pos-cash-summary-state,
.pos-cash-summary-state {
    font-weight: 700;
}

.detail-grid dd.pos-cash-summary-state--ok,
.pos-cash-summary-state--ok {
    color: #166534;
}

.detail-grid dd.pos-cash-summary-state--negative,
.pos-cash-summary-state--negative {
    color: #b91c1c;
}

.detail-grid dd.pos-cash-summary-state--positive,
.pos-cash-summary-state--positive {
    color: #92400e;
}

.qr-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-strong);
    color: var(--gagp-navy);
    font-weight: 700;
    cursor: pointer;
}

.qr-modal__image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 20px;
    background: var(--theme-surface-soft);
    border: 1px solid var(--theme-border);
}

.qr-modal__image-wrap img {
    width: 280px;
    max-width: 100%;
    height: auto;
}

.field-help {
    margin: 0;
    color: var(--gagp-muted);
    font-size: 12px;
    line-height: 1.5;
}

.portal-address-current {
    margin-bottom: 16px;
}

.portal-address-box {
    margin: 16px 0 18px;
    padding: 18px;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    background: var(--theme-surface-soft);
}

.portal-address-box[hidden] {
    display: none !important;
}

.portal-address-box h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--gagp-deep);
}

.portal-address-box .field-help {
    margin-bottom: 14px;
}

.portal-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.portal-address-grid__full,
.portal-address-grid__wide {
    grid-column: 1 / -1;
}

.button:disabled,
.button[disabled] {
    opacity: 0.58;
    cursor: not-allowed;
    box-shadow: none;
}

.hero--portal-orders .card > *,
.hero--portal-orders .auth-form,
.hero--portal-orders .filters__group,
.hero--portal-orders .filters__actions,
.hero--portal-orders .row-actions__form,
.hero--portal-orders .button,
.hero--portal-orders input,
.hero--portal-orders select,
.hero--portal-orders textarea,
.qr-modal__panel .button,
.qr-modal__panel input,
.qr-modal__panel select,
.qr-modal__panel textarea,
.qr-modal__panel .filters__actions,
.qr-modal__panel .detail-grid dd {
    min-width: 0;
    max-width: 100%;
}

.filters select,
.filters input,
.filters textarea,
.tenant-create-form select,
.tenant-create-form input,
.tenant-create-form textarea,
.auth-form input,
.auth-form textarea,
.auth-form select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background-color: var(--theme-surface-strong);
    color: var(--gagp-text);
    font: inherit;
    box-shadow: 0 1px 2px rgba(15, 61, 110, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Foco con halo de color (moderno) y hover sutil, en todos los campos del proyecto. */
.filters select:hover,
.filters input:hover,
.filters textarea:hover,
.tenant-create-form select:hover,
.tenant-create-form input:hover,
.tenant-create-form textarea:hover,
.auth-form input:hover,
.auth-form textarea:hover,
.auth-form select:hover {
    border-color: var(--theme-border-strong);
}
.filters select:focus,
.filters input:focus,
.filters textarea:focus,
.tenant-create-form select:focus,
.tenant-create-form input:focus,
.tenant-create-form textarea:focus,
.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus {
    outline: none;
    border-color: var(--theme-accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

/* Flecha propia en los desplegables (sustituye la del navegador). */
.filters select,
.tenant-create-form select,
.auth-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}

/* Filtro de Pedidos clientes: aspecto moderno (redondeado, suave, foco con halo). */
#pedidos-clientes-tenant .filters__group { gap: 5px; }
#pedidos-clientes-tenant .filters__group label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gagp-muted);
}
#pedidos-clientes-tenant .filters__group input,
#pedidos-clientes-tenant .filters__group select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface, #fff);
    color: var(--gagp-text);
    font: inherit;
    box-shadow: 0 1px 2px rgba(15, 61, 110, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}
#pedidos-clientes-tenant .filters__group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
#pedidos-clientes-tenant .filters__group input:hover,
#pedidos-clientes-tenant .filters__group select:hover {
    border-color: var(--theme-border-strong);
}
#pedidos-clientes-tenant .filters__group input:focus,
#pedidos-clientes-tenant .filters__group select:focus {
    outline: none;
    border-color: var(--theme-accent, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
    background: #fff;
}
#pedidos-clientes-tenant .filters__group input::placeholder { color: #9aa6b6; }

.hero--portal-orders .auth-form select,
.qr-modal__panel .auth-form select {
    min-height: 52px;
    padding-left: 16px;
    padding-right: 16px;
}

.filters textarea,
.tenant-create-form textarea,
.auth-form textarea {
    min-height: 110px;
    padding: 12px 14px;
    resize: vertical;
}

.tenant-create-form input[type="file"] {
    padding: 10px 12px;
}

.filters__actions {
    display: flex;
    align-items: end;
    gap: 12px;
}

.filters__actions--stack {
    align-items: stretch;
}

.filters__actions--invoice {
    flex-wrap: wrap;
}

.filters__actions--inline-end {
    justify-content: flex-end;
}

.filters__actions--delivery-note {
    flex-wrap: nowrap;
}

.filters__actions--delivery-note .button {
    white-space: nowrap;
}

.setup-verifactu-certificate-submit-status {
    margin: 0;
    flex: 1 1 320px;
}

.setup-verifactu-certificate-submit-status--pending {
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--theme-surface-soft);
    color: var(--gagp-navy);
}

.tenant-readonly-field {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-strong);
    color: var(--gagp-text);
    line-height: 1.4;
}

.invoice-global-payments__panel {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px solid var(--theme-border);
    border-radius: 22px;
    background: var(--theme-surface-soft);
}

.invoice-global-payments__panel-head {
    display: grid;
    gap: 4px;
}

.invoice-global-payments__panel-head h3 {
    margin: 0;
    color: var(--gagp-deep);
    font-size: 18px;
}

.invoice-global-payments__panel-head .panel-inline-note {
    margin: 0;
}

.invoice-global-payments__selection-table th:first-child,
.invoice-global-payments__selection-table td:first-child {
    width: 42px;
    text-align: center;
}

.invoice-global-payments__checkbox-cell {
    text-align: center;
}

.invoice-global-payments__checkbox {
    width: 1em;
    height: 1em;
    margin: 0;
    vertical-align: middle;
}

.delivery-note-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 14px;
    width: 100%;
    margin-bottom: 18px;
}

.delivery-note-filters__group {
    display: grid;
    gap: 8px;
    min-width: 0;
    align-items: stretch;
}

.delivery-note-filters__group--search {
    flex: 1 1 360px;
}

.delivery-note-filters__group label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gagp-muted);
    white-space: nowrap;
}

.delivery-note-filters__group input,
.delivery-note-filters__group select {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-strong);
    color: var(--gagp-text);
    font: inherit;
}

.delivery-note-filters__group--search input {
    flex: 1 1 auto;
    width: 100%;
}

.delivery-note-filters__actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    align-self: flex-end;
}

.delivery-note-filters__actions .button {
    white-space: nowrap;
}

.tenant-create-form {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.quote-lines-tools {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.lookup-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.button--lookup {
    min-height: 46px;
    white-space: nowrap;
}

.lookup-field--auto {
    margin-top: 6px;
}

.quote-line-actions {
    justify-content: flex-end;
}

.quote-line-total {
    white-space: nowrap;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--one {
    grid-template-columns: minmax(0, 1fr);
}

.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel-inline-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: #eef3fa;
    color: var(--gagp-navy);
    font-size: 14px;
    line-height: 1.5;
}

.panel-inline-note--warning {
    background: #fff7e8;
    color: #8a5200;
    border: 1px solid #ead0a2;
}

.setup-warning-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #ead0a2;
    background: #fff7e8;
    color: #8a5200;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
}

.work-order-contract-note {
    display: block;
    margin-top: 6px;
    line-height: 1.45;
    line-height: 1.5; 
    overflow-wrap: anywhere;
}

.work-order-contract-note span {
    display: block;
}

.work-order-contract-note--compact {
    max-width: 220px;
    margin-top: 4px;
    padding: 0;
    background: transparent;
    color: #6d5940;
    font-size: 11px;
    line-height: 1.35;
}

.work-order-contract-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 8px;
    border: 1px solid #ead0a2;
    border-radius: 8px;
    background: #fff7e8;
    color: #8a5200;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

.panel-section--nested {
    margin-top: 6px;
    padding: 18px;
    border: 1px solid rgba(206, 216, 230, 0.9);
    border-radius: 18px;
    background: rgba(247, 250, 253, 0.92);
}

.tenant-upload-note {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(230, 238, 248, 0.9);
    color: var(--gagp-navy);
    font-size: 14px;
    line-height: 1.55;
}

.tenant-upload-note p {
    margin: 0;
}

.tenant-logo-current {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(206, 216, 230, 0.9);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
}

.tenant-logo-current span {
    color: var(--gagp-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tenant-logo-current img {
    display: block;
    max-width: 220px;
    max-height: 70px;
    width: auto;
    height: auto;
}

.tenant-logo-remove {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    color: var(--gagp-text);
    font-size: 14px;
    font-weight: 600;
}

.tenant-logo-remove input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.catalog-image-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: 1px solid rgba(206, 216, 230, 0.9);
    background: rgba(255, 255, 255, 0.96);
    object-fit: cover;
    overflow: hidden;
}

.catalog-image-thumb--empty {
    color: var(--gagp-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    padding: 6px;
}

.catalog-image-thumb--placeholder {
    color: #1f3a5f;
    background: linear-gradient(145deg, rgba(238, 245, 252, 0.98), rgba(223, 235, 248, 0.96));
    border-color: rgba(177, 198, 222, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.catalog-image-thumb__icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
}

.catalog-image-thumb__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pos-shell {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

body.pos-fullscreen-active {
    background: #edf3fb;
}

body.pos-fullscreen-active .tenant-menu-bar {
    display: none;
}

body.pos-fullscreen-active .hero--tenant-dashboard {
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
}

body.pos-fullscreen-active .erp-workspace__content {
    gap: 0;
}

body.pos-fullscreen-active #pos-terminal-tenant {
    min-height: 100vh;
    padding: 16px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

body.pos-fullscreen-active #pos-terminal-tenant .pos-shell {
    margin-top: 0;
}

.pos-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border-radius: 24px;
    border: 1px solid var(--theme-border);
    background: var(--gagp-navy);
    color: #f8fbff;
    box-shadow: 0 24px 60px rgba(11, 31, 58, 0.22);
}

.pos-toolbar__summary,
.pos-toolbar__actions {
    display: flex;
    gap: 6px;
}

.pos-toolbar__summary {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    position: relative;
}

.pos-toolbar__actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    width: 100%;
    margin-left: 0;
    position: relative;
    z-index: 2;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.pos-toolbar__actions .button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
    border-radius: 12px;
    box-shadow: none;
    white-space: nowrap;
    width: auto;
    flex: 0 0 auto;
}

.pos-toolbar-button {
    border-color: rgba(191, 211, 235, 0.92);
    color: var(--gagp-navy);
    font-weight: 700;
}

.pos-toolbar-button--icon {
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
}

.pos-toolbar-button--icon .button__icon {
    width: 18px;
    height: 18px;
}

.pos-toolbar-button:hover,
.pos-toolbar-button:focus-visible {
    color: var(--gagp-navy);
    filter: brightness(1.05);
}

.pos-toolbar-button--client {
    background: #edf3fb;
    border-color: #d3e0ef;
}

.pos-toolbar-button--cash {
    background: #e7eff9;
    border-color: #cad9ec;
}

.pos-toolbar-button--reports {
    background: #e3edf9;
    border-color: #c6d7eb;
}

.pos-toolbar-button--peripherals {
    background: #dde9f8;
    border-color: #bdd1ea;
}

.pos-tickets-toolbar-button {
    background: #e8eef8;
    border-color: #ccd8ea;
}

.pos-toolbar__actions .button--primary.pos-toolbar-button {
    background: #d6e5f7;
    border-color: #adc7e7;
    color: var(--gagp-navy);
}

.pos-report-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.pos-report-card {
    padding: 18px;
    border: 1px solid #d9e3ef;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pos-report-card h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.pos-report-card p {
    margin: 0 0 14px;
    color: #526273;
}

.pos-report-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.pos-report-card__actions .button--icon {
    min-width: 44px;
    min-height: 44px;
}

.pos-report-card__actions .button--icon .button__icon {
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.pos-report-card__actions .button--icon:active .button__icon,
.pos-report-card__actions .button--icon.pos-action-pending .button__icon {
    transform: scale(0.86);
    opacity: 0.2;
}

@media (max-width: 1180px) {
    .pos-report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pos-report-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body.superadmin-page,
    body.superadmin-page .app-shell {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .qr-modal {
        overflow-y: auto;
        padding: 0;
    }

    .topbar--superadmin.topbar--tenant-brand {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .topbar--superadmin.topbar--tenant-brand .topbar__center-title {
        display: none;
    }

    .topbar--superadmin.topbar--tenant-brand.topbar--portal-client {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .topbar--superadmin.topbar--tenant-brand.topbar--portal-client .topbar__center-title {
        display: flex;
        position: static;
        left: auto;
        transform: none;
        grid-column: 1;
        justify-self: start;
        align-items: flex-start;
        text-align: left;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        font-size: 14px;
        line-height: 1.2;
        pointer-events: auto;
    }

    .topbar--superadmin.topbar--tenant-brand .brand-lockup {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: 16px;
        width: 100%;
        flex: initial;
        min-width: 0;
    }

    .topbar--superadmin.topbar--tenant-brand .brand-lockup > div,
    .topbar--superadmin.topbar--tenant-brand .brand-lockup strong,
    .topbar--superadmin.topbar--tenant-brand .brand-lockup span {
        min-width: 0;
    }

    .topbar--superadmin.topbar--tenant-brand .brand-lockup span {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .topbar--superadmin.topbar--tenant-brand .topbar__actions {
        display: flex;
        width: auto;
        min-width: 0;
        margin-left: 0;
        flex: initial;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        grid-column: 2;
        justify-self: start;
        gap: 8px;
        font-size: 12px;
        line-height: 1.2;
    }

    .topbar--superadmin.topbar--tenant-brand.topbar--portal-client .topbar__actions {
        grid-column: 2;
        justify-self: end;
        align-self: center;
    }

    .topbar--superadmin.topbar--tenant-brand.topbar--portal-client .topbar__center-title-subtitle {
        display: none;
    }

    .topbar--superadmin.topbar--tenant-brand.topbar--portal-client .welcome-chip--link {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar--superadmin.topbar--tenant-brand .welcome-chip,
    .topbar--superadmin.topbar--tenant-brand .logout-link {
        display: inline-flex;
        white-space: nowrap;
        font-size: inherit;
        line-height: inherit;
    }

    .hero--superadmin {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .hero--superadmin .hero__panel,
    .hero--superadmin .panel-section,
    .hero--superadmin .panel-section__head > div,
    .hero--superadmin .kpi,
    .hero--superadmin .kpi__item,
    .hero--superadmin .filters,
    .hero--superadmin .tenant-table-wrap,
    .qr-modal__panel,
    .qr-modal__panel .panel-section,
    .qr-modal__panel .filters,
    .qr-modal__panel .tenant-table-wrap {
        min-width: 0;
        max-width: 100%;
    }

    .hero--superadmin .filters,
    .qr-modal .filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero--superadmin .dashboard-card-grid,
    .hero--superadmin .dashboard-card-grid--setup,
    .hero--superadmin .dashboard-module-grid,
    .hero--superadmin .dashboard-support-grid,
    .hero--superadmin .kpi,
    .qr-modal .dashboard-card-grid,
    .qr-modal .dashboard-card-grid--setup,
    .qr-modal .dashboard-module-grid,
    .qr-modal .dashboard-support-grid,
    .qr-modal .kpi {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .hero--superadmin .panel-section__head,
    .qr-modal__panel .panel-section__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero--portal-orders {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        gap: 16px;
    }

    .hero--portal-orders .grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-catalog-filters {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero--portal-orders .card {
        padding: 18px;
    }

    .hero--portal-orders .row-actions__form {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
    }

    .row-actions__form--portal-cart {
        flex-wrap: nowrap;
    }

    .hero--portal-orders .row-actions__form .button {
        max-width: 100%;
    }

    .hero--portal-orders .filters__actions--stack .button,
    .qr-modal__panel .filters__actions--stack .button {
        width: 100%;
    }

    .qr-modal__panel {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        padding: 18px 16px;
    }

    .qr-modal__panel .detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero--portal-orders .tenant-table-wrap {
        overflow-x: auto;
    }

    .hero--portal-orders .tenant-table {
        min-width: 620px;
    }

    .hero--portal-orders .quick-links a {
        gap: 12px;
        align-items: flex-start;
    }

    .hero--portal-orders .quick-links a span {
        text-align: right;
    }

    .portal-address-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portal-address-box {
        padding: 16px;
    }

    .hero--superadmin .panel-section__head-actions,
    .qr-modal__panel .panel-section__head-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    #dashboard-top-customers .dashboard-split-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #dashboard-top-customers .data-list__row {
        grid-template-columns: minmax(0, 1fr);
    }

    #dashboard-top-customers .data-list__meta {
        justify-self: start;
        width: 100%;
        text-align: left;
    }

    .hero__panel--dashboard-summary .dashboard-chart-scroll--canvas,
    .qr-modal[data-dashboard-summary-modal="1"] .dashboard-chart-scroll--canvas {
        overflow-x: auto;
        overflow-y: hidden;
        margin: 0 -4px;
        padding: 0 4px 8px;
        -webkit-overflow-scrolling: touch;
    }

    .hero__panel--dashboard-summary .dashboard-chart-canvas--monthly,
    .qr-modal[data-dashboard-summary-modal="1"] .dashboard-chart-canvas--monthly {
        min-width: 700px;
        height: 360px;
    }

    .hero__panel--dashboard-summary .dashboard-chart-canvas--annual,
    .qr-modal[data-dashboard-summary-modal="1"] .dashboard-chart-canvas--annual {
        min-width: 620px;
        height: 320px;
    }

    .hero__panel--dashboard-summary .kpi.kpi--summary-first,
    .hero__panel--dashboard-summary .kpi.kpi--triple,
    .qr-modal[data-dashboard-summary-modal="1"] .kpi.kpi--summary-first,
    .qr-modal[data-dashboard-summary-modal="1"] .kpi.kpi--triple {
        grid-template-columns: minmax(0, 1fr);
    }

    .qr-modal__panel {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin: 8px auto;
        max-height: calc(100vh - 16px);
        padding: 16px;
        border-radius: 20px;
        box-sizing: border-box;
    }

    .qr-modal__panel--lookup,
    .qr-modal__panel--xwide {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }

    .qr-modal .dashboard-card-grid,
    .qr-modal .dashboard-card-grid--setup,
    .qr-modal .dashboard-module-grid,
    .qr-modal .dashboard-split-grid,
    .qr-modal .dashboard-alert-grid,
    .qr-modal .dashboard-alert-grid--quad,
    .qr-modal .dashboard-follow-up-card__body,
    .qr-modal .dashboard-executive-card__body,
    .qr-modal .filters__grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .qr-modal .panel-section__head-actions,
    .qr-modal .filters__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .qr-modal .button {
        width: 100%;
    }

    #work-order-form-modal .qr-modal__panel {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin: 0 0 auto;
        min-height: 100vh;
        max-height: none;
        padding: 14px;
        border-radius: 0;
    }

    #work-order-form-modal .kpi {
        grid-template-columns: 1fr;
    }

    #work-order-form-modal > .qr-modal__panel > .row-actions,
    #work-order-form-modal .filters__group > .row-actions,
    #work-order-form-modal .work-order-document-preview-toolbar,
    #work-order-form-modal .work-order-document-preview-toolbar .row-actions {
        flex-wrap: wrap;
        align-items: stretch;
        white-space: normal;
    }

    #work-order-form-modal > .qr-modal__panel > .row-actions > *,
    #work-order-form-modal .filters__group > .row-actions > *,
    #work-order-form-modal .work-order-document-preview-toolbar > *,
    #work-order-form-modal .work-order-document-preview-toolbar .row-actions > * {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    #work-order-form-modal .panel-inline-note,
    #work-order-form-modal .form-help,
    #work-order-form-modal .checkbox-row span,
    #work-order-form-modal .tenant-table td,
    #work-order-form-modal .tenant-table th {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #work-order-form-modal .tenant-table-wrap {
        margin-left: -4px;
        margin-right: -4px;
    }

    #work-order-history-table-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #work-order-history-table-wrap .tenant-table {
        width: max-content;
        min-width: 860px;
    }

    #work-order-parts-table-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #work-order-parts-table-wrap .tenant-table {
        width: 100%;
        min-width: 1100px;
    }

    #work-order-parts-table-wrap .tenant-table th,
    #work-order-parts-table-wrap .tenant-table td {
        overflow-wrap: normal;
        word-break: normal;
        white-space: normal;
    }

    #work-order-form-modal .work-order-document-preview-frame {
        min-height: 320px;
        height: 60vh;
    }

    #work-order-form-modal .work-order-document-preview-image {
        max-height: 60vh;
    }

    #communications-detail-modal {
        overflow-x: hidden;
        overflow-y: auto;
        padding: 0;
    }

    #communications-detail-modal .qr-modal__panel {
        position: fixed;
        top: var(--communications-detail-top, 8px);
        left: var(--communications-detail-left, 8px);
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin: 0;
        max-height: calc(100vh - 16px);
        padding: 14px;
        box-sizing: border-box;
    }

    #communications-detail-modal .dashboard-card-grid,
    #communications-detail-modal .dashboard-card-grid--setup {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #communications-detail-modal .data-card,
    #communications-detail-modal .panel-inline-note,
    #communications-detail-modal label {
        overflow-wrap: normal;
        word-break: normal;
    }

    #communications-detail-modal .communications-detail-preview {
        width: 100%;
        min-width: 0;
        height: 42vh;
    }
}

.pos-tickets-toolbar-button {
    position: relative;
    padding-right: 0;
}

.pos-supervisor-toolbar-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pos-supervisor-toolbar-button--inactive {
    background: #edf2f9;
    border-color: #d2deed;
    color: #5c6b80;
}

.pos-supervisor-toolbar-button--active {
    background: #dff5e8;
    border-color: #b8e2c8;
    color: #1f6b42;
    box-shadow: 0 10px 22px rgba(34, 139, 94, 0.14);
}

.pos-supervisor-toolbar-button--active:hover,
.pos-supervisor-toolbar-button--active:focus-visible {
    background: #d3efdf;
    border-color: #a9d9bc;
    color: #195636;
}

.pos-supervisor-toolbar-button--inactive:hover,
.pos-supervisor-toolbar-button--inactive:focus-visible {
    background: #e2ebf6;
    border-color: #c4d3e6;
    color: #44556b;
}

.pos-cash-session-methods {
    display: grid;
    gap: 6px;
    min-width: 220px;
}

.pos-cash-session-method {
    display: grid;
    gap: 2px;
    font-size: 12px;
    color: var(--gagp-text);
}

.pos-cash-session-method span {
    color: var(--gagp-muted);
}

.pos-fullscreen-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pos-fullscreen-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pos-fullscreen-button__hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-fullscreen-button--prompt {
    border-color: rgba(255, 255, 255, 0.26);
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
}

.pos-fullscreen-button--prompt:hover,
.pos-fullscreen-button--prompt:focus-visible {
    background: linear-gradient(135deg, #172554 0%, #2563eb 100%);
    color: #ffffff;
}

.pos-fullscreen-button--prompt .pos-fullscreen-button__icon {
    animation: pos-fullscreen-button-icon-pulse 1.1s ease-in-out infinite;
}

.pos-fullscreen-button--prompt .pos-fullscreen-button__hint {
    animation: pos-fullscreen-button-hint-pulse 1.1s ease-in-out infinite;
}

@keyframes pos-fullscreen-button-icon-pulse {
    0%,
    100% {
        transform: translateX(0) scale(1);
    }

    40% {
        transform: translateX(3px) scale(1.1);
    }

    70% {
        transform: translateX(-1px) scale(1.03);
    }
}

@keyframes pos-fullscreen-button-hint-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }

    50% {
        transform: scale(1.07);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
    }
}

.pos-tickets-toolbar-button__badge {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.32);
    border: 2px solid rgba(18, 50, 74, 0.88);
}

.pos-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    min-width: 96px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(4px);
}

.pos-chip strong {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 249, 255, 0.76);
}

.pos-chip span {
    font-size: 12px;
    font-weight: 700;
    color: #f8fbff;
}

.pos-chip--accent {
    background: var(--gagp-primary);
    border-color: rgba(255, 255, 255, 0.14);
}

.pos-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.pos-lock-panel {
    padding: 24px;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
    border: 1px solid #fed7aa;
}

.pos-section-head,
.pos-filter-group__head,
.pos-items-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.pos-section-head h2,
.pos-filter-group__head h3,
.pos-items-head h3 {
    margin: 0;
}

.pos-section-head span,
.pos-filter-group__head span,
.pos-items-head span {
    color: var(--gagp-muted);
    font-size: 13px;
}

.pos-section-head--ticket {
    align-items: flex-start;
}

.pos-ticket-head {
    display: grid;
    gap: 10px;
}

.pos-ticket-head__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.pos-ticket-head__content {
    display: grid;
    gap: 4px;
}

.pos-ticket-head__actions {
    margin: 0;
}

.pos-ticket-total-summary {
    display: inline-grid;
    gap: 2px;
    margin-top: 6px;
}

.pos-ticket-total-summary span {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gagp-muted);
}

.pos-ticket-total-summary strong {
    font-size: 24px;
    line-height: 1;
    color: var(--gagp-navy);
}

.pos-catalog-panel {
    display: grid;
    gap: 18px;
    min-height: 620px;
}

.pos-search-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid #d7e1ee;
    border-radius: 18px;
    background: #f8fbfd;
}

.pos-search-bar[hidden] {
    display: none;
}

.pos-filter-group {
    display: grid;
    gap: 12px;
}

.pos-family-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.pos-family-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #d8e2ee;
    border-radius: 18px;
    background: #ffffff;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.pos-family-card:hover,
.pos-family-card:focus-visible {
    transform: translateY(-1px);
    border-color: #9db7d3;
    box-shadow: 0 12px 26px rgba(22, 50, 78, 0.08);
}

.pos-family-card--active {
    border-color: #2d6f8f;
    background: linear-gradient(135deg, #eef7fb 0%, #f7fbff 100%);
    box-shadow: 0 16px 30px rgba(30, 79, 115, 0.12);
}

.pos-family-card__thumb .catalog-image-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.pos-family-card__text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pos-family-card__text strong,
.pos-family-card__text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-family-card__text small {
    color: var(--gagp-muted);
}

.pos-subfamily-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pos-subfamily-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 14px;
    border: 1px solid #d6deea;
    border-radius: 999px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.pos-subfamily-chip small {
    color: var(--gagp-muted);
}

.pos-subfamily-chip--active {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #0f5132;
}

.pos-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.pos-item-card {
    display: grid;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dae3ee;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    min-width: 0;
    overflow: hidden;
}

.pos-item-card--out-of-stock {
    border-color: #fecaca;
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.08);
}

.pos-item-card__media {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.pos-item-card__media-meta {
    display: grid;
    gap: 6px;
    justify-items: end;
    min-width: 0;
    max-width: 100%;
}

.pos-item-card__media .catalog-image-thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.pos-item-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    max-width: 100%;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

.pos-item-card__stock-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.pos-item-card__stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.pos-item-card__body {
    display: grid;
    gap: 4px;
    min-height: 82px;
}

.pos-item-card__body strong,
.pos-item-card__body span,
.pos-item-card__body small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-item-card__body strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.25;
}

.pos-item-card__body span,
.pos-item-card__body small {
    color: var(--gagp-muted);
}

.pos-item-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pos-item-card__footer > * {
    min-width: 0;
}

.pos-item-card__footer small {
    display: block;
    margin-top: 2px;
    color: var(--gagp-muted);
}

.pos-item-card__price {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.pos-item-card__footer .pos-submit-button {
    flex: 0 1 116px;
    min-width: 0;
    max-width: 100%;
}

.pos-item-card__footer .pos-submit-button__text {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
}

.pos-cart-panel {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 16px;
}

.pos-cart-list {
    display: grid;
    gap: 12px;
    max-height: 540px;
    overflow: auto;
    padding-right: 4px;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid #dce4ed;
    border-radius: 16px;
    background: #f9fbfc;
}

.pos-cart-line__media .catalog-image-thumb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.pos-cart-line__content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pos-cart-line__content strong,
.pos-cart-line__content span,
.pos-cart-line__content small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-cart-line__content span,
.pos-cart-line__content small {
    color: var(--gagp-muted);
}

.pos-cart-line__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.pos-qty-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pos-qty-form input[type="number"] {
    width: 72px;
}

.pos-scale-button {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    background: #ecfccb;
    border-color: #84cc16;
    color: #365314;
    font-weight: 700;
}

.pos-peripherals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.pos-peripheral-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #d9e3ef;
    border-radius: 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
}

.pos-peripheral-card h4 {
    margin: 0;
    font-size: 18px;
}

.pos-peripheral-card p,
.pos-peripheral-card strong,
.pos-peripheral-card__note {
    margin: 0;
}

.pos-peripheral-card p,
.pos-peripheral-card__note {
    color: var(--gagp-muted);
}

.pos-peripheral-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-cart-line__price {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: right;
}

.pos-cart-line__price small {
    color: var(--gagp-muted);
}

.pos-scan-lookup-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #d7e1ee;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbfd 0%, #ffffff 100%);
}

.pos-scan-lookup-card__media .catalog-image-thumb {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.pos-scan-lookup-card__content {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pos-scan-lookup-card__content strong,
.pos-scan-lookup-card__content span,
.pos-scan-lookup-card__content small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-scan-lookup-card__content span,
.pos-scan-lookup-card__content small {
    color: var(--gagp-muted);
}

.pos-scan-lookup-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pos-cart-totals {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #dbe3ec;
}

.pos-cart-totals div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.pos-cart-totals__grand {
    font-size: 18px;
    font-weight: 800;
}

.pos-payment-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background: #f8fbfd;
}

.pos-payment-form__rows {
    display: grid;
    gap: 10px;
}

.pos-payment-form__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
    align-items: end;
}

.pos-payment-form__method {
    display: grid;
    gap: 4px;
}

.pos-payment-form__method label {
    font-weight: 700;
}

.pos-payment-form__method span {
    color: var(--gagp-muted);
    font-size: 12px;
}

.pos-payment-form__cash {
    display: grid;
    gap: 8px;
}

.pos-payment-form__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #dbe3ec;
}

.pos-payment-form__summary div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
}

.pos-payment-form__summary span {
    color: var(--gagp-muted);
    font-size: 12px;
}

.pos-payment-form__summary strong {
    font-size: 16px;
}

.pos-cart-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pos-touch-keyboard {
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 2300;
    width: min(960px, calc(100vw - 24px));
    transform: translateX(-50%);
}

.pos-touch-keyboard__panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(18, 50, 74, 0.18);
    border-radius: 24px;
    background: rgba(248, 251, 255, 0.98);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(12px);
}

.pos-touch-keyboard__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pos-touch-keyboard__head strong,
.pos-touch-keyboard__head span {
    display: block;
}

.pos-touch-keyboard__head span {
    margin-top: 4px;
    color: var(--gagp-muted);
    font-size: 13px;
}

.pos-touch-keyboard__rows {
    display: grid;
    gap: 10px;
}

.pos-touch-keyboard__row {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
}

.pos-touch-keyboard__key {
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #c9d8ea;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    color: #12324a;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.08);
}

.pos-touch-keyboard__key:hover,
.pos-touch-keyboard__key:focus-visible {
    border-color: #5b8bb5;
    background: linear-gradient(180deg, #ffffff 0%, #dbeafe 100%);
}

.pos-touch-keyboard__key--wide {
    grid-column: span 2;
    font-size: 15px;
}

.pos-touch-keyboard[data-pos-touch-layout="pin"] {
    width: min(380px, calc(100vw - 24px));
}

.pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__panel {
    padding: 18px;
}

.pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__key {
    min-height: 70px;
    font-size: 24px;
}

@media (max-width: 1100px) {
    .pos-toolbar {
        padding: 16px;
    }

    .pos-toolbar__actions {
        align-items: center;
    }

    .pos-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-cart-panel {
        position: static;
    }

    .pos-touch-keyboard {
        width: calc(100vw - 20px);
        bottom: 10px;
    }

    .pos-touch-keyboard__row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .pos-touch-keyboard[data-pos-touch-layout="pin"] {
        width: min(360px, calc(100vw - 20px));
    }
}

@media (max-width: 720px) {
    .pos-toolbar__actions .button {
        width: auto;
        flex: 0 0 auto;
    }

    .pos-fullscreen-button {
        justify-content: center;
    }

    .pos-search-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-family-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .pos-item-grid {
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .pos-item-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .pos-item-card__footer .pos-submit-button {
        width: 100%;
        flex: 1 1 100%;
        justify-content: center;
    }

    .pos-cart-line {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .pos-cart-line__price {
        grid-column: 2;
        justify-items: start;
        text-align: left;
    }

    .pos-scan-lookup-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-cart-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-payment-form__row,
    .pos-payment-form__summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .pos-touch-keyboard__panel {
        padding: 14px;
        border-radius: 20px;
    }

    .pos-touch-keyboard__head {
        flex-direction: column;
        align-items: stretch;
    }

    .pos-touch-keyboard__row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .pos-touch-keyboard__key,
    .pos-touch-keyboard__key--wide {
        min-height: 50px;
        grid-column: span 2;
        font-size: 16px;
    }

    .pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__key,
    .pos-touch-keyboard[data-pos-touch-layout="pin"] .pos-touch-keyboard__key--wide {
        min-height: 64px;
        grid-column: span 1;
        font-size: 22px;
    }
}

.catalog-image-field {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.catalog-image-field__actions {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.catalog-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 18px;
    border: 1px solid rgba(206, 216, 230, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    overflow: hidden;
}

.catalog-image-preview--empty {
    color: var(--gagp-muted);
    font-size: 14px;
    font-weight: 600;
}

.catalog-image-preview img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

@media (max-width: 720px) {
    .catalog-image-field__actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .setup-role-permission-row {
        grid-template-columns: minmax(0, 1fr);
    }
    .setup-role-permission-row__levels {
        grid-template-columns: minmax(0, 1fr);
    }
}

.form-feedback {
    display: grid;
    gap: 10px;
}

.form-feedback .auth-message,
.form-feedback .auth-error {
    margin: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 14px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    background: var(--theme-surface-strong);
}

.checkbox-row input {
    width: auto;
    min-height: 0;
    margin: 0;
}

.checkbox-row span {
    color: var(--gagp-text);
    font-size: 14px;
    font-weight: 600;
}

.checkbox-row--radio {
    min-height: 46px;
}

.tenant-finance-editor {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    background: var(--theme-surface-soft);
}

.tenant-finance-editor__rows {
    display: grid;
    gap: 12px;
}

.tenant-finance-editor__row {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--theme-border);
    border-radius: 16px;
    background: var(--theme-surface-strong);
}

.row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.row-actions--work-order {
    flex-wrap: wrap;
    align-items: flex-start;
    white-space: normal;
}

.row-actions--invoice-list {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    justify-content: flex-start;
    align-items: start;
    white-space: normal;
}

.row-actions__form {
    margin: 0;
    flex: 0 0 auto;
}

.tenant-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--theme-border);
    border-radius: 20px;
    background: var(--theme-surface-strong);
}

.tenant-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.tenant-table--fiscal-third-parties {
    min-width: 0;
}

.tenant-table--compact-auto {
    min-width: 0;
    width: auto;
}

.tenant-table--fiscal-third-parties th:last-child,
.tenant-table--fiscal-third-parties td:last-child {
    width: 136px;
}

.tenant-table--fiscal-payment-forms {
    min-width: 0;
    table-layout: fixed;
}

.tenant-table--fiscal-payment-forms th,
.tenant-table--fiscal-payment-forms td {
    padding: 12px 10px;
}

#estadisticas-tenant .statistics-top-entity-wrap {
    overflow-x: hidden;
}

#estadisticas-tenant .statistics-top-entity-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

#estadisticas-tenant .statistics-top-entity-table th,
#estadisticas-tenant .statistics-top-entity-table td {
    min-width: 0;
}

/* Seccion plegable de correos por modulo en fichas de cliente/proveedor */
.module-emails-details {
    margin: 8px 0 4px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-surface-alt, #f9fafb);
}
.module-emails-details__toggle {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #6b7280);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.module-emails-details__toggle::-webkit-details-marker { display: none; }
.module-emails-details__toggle::before {
    content: '\25B6';
    font-size: 10px;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.module-emails-details[open] > .module-emails-details__toggle::before {
    transform: rotate(90deg);
}
.module-emails-details__hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-text-muted, #9ca3af);
}
.module-emails-details__body {
    padding: 4px 12px 12px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.client-docs-details {
    margin: 12px 0;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-surface-alt, #f9fafb);
}
.client-docs-details--has-docs {
    border-color: var(--color-primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
}
.client-docs-details__toggle {
    cursor: pointer;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.client-docs-details--has-docs > .client-docs-details__toggle {
    color: var(--color-primary, #2563eb);
}
.client-docs-details__toggle::-webkit-details-marker { display: none; }
.client-docs-details__toggle::after {
    content: '\25B6';
    font-size: 10px;
    transition: transform 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}
.client-docs-details[open] > .client-docs-details__toggle::after {
    transform: rotate(90deg);
}
.client-docs-details__icon {
    display: inline-flex;
    align-items: center;
}
.client-docs-details__icon svg { width: 16px; height: 16px; }
.client-docs-details__hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-text-muted, #9ca3af);
}
.client-docs-details__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.client-docs-details__body {
    padding: 8px 14px 14px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}
.client-docs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.client-docs-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    background: var(--color-surface, #fff);
}
.client-docs-item__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.client-docs-item__category {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-primary, #111827);
}
.client-docs-item__desc {
    font-size: 12px;
    color: var(--color-text-secondary, #6b7280);
}
.client-docs-item__file {
    font-size: 12px;
    color: var(--color-text-muted, #9ca3af);
    overflow-wrap: anywhere;
}
.client-docs-item__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.client-docs-item__delete {
    font-size: 12px;
}
.button--small {
    padding: 4px 10px;
    font-size: 12px;
}

#estadisticas-tenant .statistics-top-entity-name {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tenant-table--fiscal-payment-forms th {
    font-size: 11px;
}

.tenant-table--fiscal-payment-forms th:first-child,
.tenant-table--fiscal-payment-forms td:first-child {
    white-space: normal;
    overflow-wrap: anywhere;
}

.tenant-table--fiscal-payment-forms th:not(:first-child),
.tenant-table--fiscal-payment-forms td:not(:first-child) {
    text-align: right;
}

.tenant-table th,
.tenant-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(206, 216, 230, 0.8);
    vertical-align: top;
    text-align: left;
}

.tenant-table td:last-child,
.tenant-table th:last-child {
    white-space: nowrap;
}

.tenant-table th {
    background: var(--gagp-surface-alt);
    color: var(--gagp-navy);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tenant-table td span {
    color: var(--gagp-muted);
    font-size: 13px;
}

.invoice-fiscal-cell,
.invoice-queue-cell,
.invoice-response-cell {
    min-width: 0;
}

.invoice-fiscal-cell {
    min-width: 140px;
}

.invoice-queue-cell {
    min-width: 170px;
}

.invoice-response-cell {
    min-width: 170px;
    max-width: 210px;
}

.invoice-queue-cell__meta,
.invoice-response-cell__code,
.invoice-response-cell__message {
    display: block;
    margin-top: 6px;
    color: var(--gagp-muted);
    font-size: 13px;
    line-height: 1.45;
}

.invoice-response-cell__code {
    font-weight: 700;
    color: var(--gagp-deep);
}

.invoice-queue-cell__meta,
.invoice-response-cell__message {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.invoice-response-cell__message {
    display: -webkit-box;
    max-height: calc(1.45em * 2);
    overflow: hidden;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    cursor: help;
}

.procurement-document-filters {
    flex-wrap: wrap;
}

.procurement-lines-table .tenant-table {
    min-width: 0;
    table-layout: fixed;
}

.procurement-lines-table .tenant-table th,
.procurement-lines-table .tenant-table td {
    padding: 8px 8px;
}

.procurement-lines-table .tenant-table th {
    font-size: 11px;
}

.procurement-lines-table .tenant-table input,
.procurement-lines-table .tenant-table select {
    min-height: 38px;
    padding: 0 8px;
    font-size: 12px;
}

.procurement-lines-table .tenant-table td strong {
    display: inline-block;
    padding-top: 8px;
    font-size: 12px;
}

.table-sort-link {
    color: inherit;
    text-decoration: none;
}

.table-sort-link:hover {
    text-decoration: underline;
}

.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.table-pagination__summary {
    color: var(--gagp-muted);
    font-size: 13px;
    font-weight: 600;
}

.module-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    margin: 0 6px 6px 0;
    padding: 7px 10px;
    border-radius: 999px;
    background: #ebeff5;
    color: #67778d;
    font-size: 12px;
    font-weight: 700;
}

.module-chip--on {
    background: #dfe9f7;
    color: var(--gagp-navy);
}

.data-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.data-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--theme-surface-soft);
    border: 1px solid var(--theme-border);
}

.data-list__row > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.data-list__row strong,
.data-list__row span {
    display: block;
}

.data-list__row > div:first-child strong,
.data-list__row > div:first-child span {
    overflow-wrap: break-word;
    word-break: normal;
}

.data-list__row span {
    color: var(--gagp-muted);
    font-size: 13px;
}

.data-list__meta {
    min-width: 0;
    flex: 0 0 auto;
    text-align: right;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    margin-bottom: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-chip--activo {
    background: #dbf3e4;
    color: #16613b;
}

.status-chip--info {
    background: #dceeff;
    color: #0b4f8a;
}

.status-chip--bloqueado {
    background: #ffe5bf;
    color: #8a5200;
}

.status-chip--warning {
    background: #fde7cf;
    color: #8a4f12;
}

.status-chip--baja {
    background: #f7d9de;
    color: #8c2336;
}

.status-chip--default {
    background: #ebeff5;
    color: #526173;
}

.invoice-payment-cell__method {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.25;
}

.invoice-payment-cell__summary {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.25;
}

.footer-note {
    margin-top: auto;
    padding: 18px 32px 28px;
    font-size: 13px;
    color: var(--gagp-muted);
}

@media (max-width: 940px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero--tenant-dashboard {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 18px 20px;
    }

    .hero__panel,
    .card {
        padding: 24px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .detail-grid div {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .brand-full {
        width: 240px;
        max-width: 62vw;
    }
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar__center-title {
        position: static;
        transform: none;
        max-width: 100%;
        width: 100%;
        text-align: left;
        pointer-events: auto;
    }

    .topbar__actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar--tenant-brand .topbar__center-title {
        text-align: center;
    }

    .topbar--tenant-brand {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: center;
        gap: 8px 16px;
    }

    .topbar--tenant-brand .topbar__center-title {
        display: none;
    }

    .topbar--tenant-brand .brand-lockup {
        grid-column: 1 / -1;
        width: auto;
        flex: initial;
        min-width: 0;
    }

    .topbar--tenant-brand .brand-lockup__text {
        min-width: 0;
    }

    .topbar--tenant-brand .brand-lockup__text strong,
    .topbar--tenant-brand .brand-lockup__text span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar--tenant-brand .topbar__actions {
        width: auto;
        min-width: 0;
        grid-column: 2;
        justify-self: start;
        margin-left: 0;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        font-size: 12px;
        line-height: 1.2;
    }

    .topbar--tenant-brand .welcome-chip,
    .topbar--tenant-brand .welcome-chip--link,
    .topbar--tenant-brand .logout-link {
        white-space: nowrap;
        font-size: inherit;
        line-height: inherit;
    }


    .topbar--superadmin.topbar--tenant-brand {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .topbar--superadmin.topbar--tenant-brand .brand-lockup {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        column-gap: 16px;
        width: 100%;
        flex: initial;
        min-width: 0;
    }

    .topbar--superadmin.topbar--tenant-brand .topbar__actions {
        display: flex;
        width: auto;
        min-width: 0;
        grid-column: 2;
        justify-self: start;
        margin-left: 0;
        flex: initial;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }

    .topbar--superadmin.topbar--tenant-brand .brand-lockup span {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .topbar--tenant-brand .welcome-chip--link {
        display: inline-block;
        max-width: min(42vw, 220px);
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    .kpi,
    .kpi--triple {
        grid-template-columns: 1fr;
    }

    .hero {
        width: min(100% - 20px, 1180px);
        padding: 16px 0 28px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .actions {
        flex-direction: column;
    }

    .dashboard-card-grid--setup {
        grid-template-columns: 1fr;
    }

    .dashboard-card-grid--executive-pair {
        grid-template-columns: 1fr;
    }

    .dashboard-follow-up-card__body,
    .dashboard-executive-card__body {
        grid-template-columns: 1fr;
    }

    .dashboard-split-grid,
    .dashboard-alert-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart {
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .dashboard-chart--monthly {
        grid-template-columns: repeat(12, minmax(44px, 1fr));
        min-width: 640px;
    }

    .dashboard-chart--annual {
        min-width: 360px;
    }

    .qr-modal .dashboard-chart--annual,
    #dashboard-cashflow .dashboard-chart--annual {
        min-width: 280px;
    }

    .qr-modal .dashboard-chart--monthly,
    #dashboard-financial-monthly .dashboard-chart--monthly {
        grid-template-columns: repeat(12, 44px);
        gap: 8px;
        min-width: max-content;
    }

    .qr-modal .dashboard-chart--monthly .dashboard-chart__bars,
    #dashboard-financial-monthly .dashboard-chart__bars {
        gap: 4px;
        padding: 0 2px;
    }

    .qr-modal .dashboard-chart--monthly .dashboard-chart__bar,
    #dashboard-financial-monthly .dashboard-chart__bar {
        width: 10px;
    }

    .qr-modal .dashboard-chart--monthly .dashboard-chart__net,
    #dashboard-financial-monthly .dashboard-chart__net {
        width: 100%;
        font-size: 10px;
        line-height: 1.2;
        padding: 4px;
        text-align: center;
    }

    #dashboard-financial-monthly .dashboard-chart-scroll--monthly {
        overflow-x: auto;
        overflow-y: hidden;
        margin: 0 -4px;
        padding: 0 4px 8px;
    }

    #dashboard-financial-monthly .dashboard-chart-scroll--monthly .dashboard-chart--monthly {
        overflow: visible;
        padding-bottom: 0;
    }

    #dashboard-financial-annual .dashboard-chart--annual {
        grid-template-columns: repeat(6, 72px);
        gap: 12px;
        min-width: max-content;
    }

    #dashboard-financial-annual .dashboard-chart-scroll--annual {
        overflow-x: auto;
        overflow-y: hidden;
        margin: 0 -4px;
        padding: 0 4px 8px;
    }

    #dashboard-financial-annual .dashboard-chart-scroll--annual .dashboard-chart--annual {
        overflow: visible;
        padding-bottom: 0;
    }

    .qr-modal .dashboard-chart__legend,
    #dashboard-financial-monthly .dashboard-chart__legend,
    #dashboard-financial-annual .dashboard-chart__legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .qr-modal .dashboard-chart__legend-item,
    #dashboard-financial-monthly .dashboard-chart__legend-item,
    #dashboard-financial-annual .dashboard-chart__legend-item {
        width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #estadisticas-tenant .statistics-analytics-grid {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
    }

    #estadisticas-tenant .statistics-analytics-grid > * {
        width: 100%;
    }

    #estadisticas-tenant .statistics-comparison-card,
    #estadisticas-tenant .statistics-mix-card {
        padding: 14px 16px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #estadisticas-tenant .statistics-comparison-card > strong,
    #estadisticas-tenant .statistics-comparison-card > span,
    #estadisticas-tenant .statistics-comparison-card > div,
    #estadisticas-tenant .statistics-comparison-card > p,
    #estadisticas-tenant .statistics-mix-card > strong,
    #estadisticas-tenant .statistics-mix-card > span,
    #estadisticas-tenant .statistics-mix-card > div,
    #estadisticas-tenant .statistics-mix-card > p,
    #estadisticas-tenant .statistics-comparison-card *,
    #estadisticas-tenant .statistics-mix-card * {
        overflow-wrap: normal;
        word-break: normal;
    }

    #estadisticas-tenant .statistics-line-chart {
        padding: 10px !important;
        min-width: 520px;
    }

    #estadisticas-tenant .statistics-line-chart svg {
        height: 150px;
    }

    #estadisticas-tenant .statistics-series-list,
    #estadisticas-tenant .statistics-annual-list {
        min-width: 520px;
    }

    #estadisticas-tenant .statistics-series-row,
    #estadisticas-tenant .statistics-annual-row {
        grid-template-columns: 84px minmax(180px, 1fr) minmax(180px, 1fr) !important;
        gap: 12px !important;
        align-items: center !important;
    }

    #estadisticas-tenant .statistics-series-row > strong,
    #estadisticas-tenant .statistics-annual-row > strong {
        grid-column: 1;
        align-self: center;
    }

    #estadisticas-tenant .statistics-series-row > div,
    #estadisticas-tenant .statistics-annual-row > div {
        min-width: 0;
    }

    #estadisticas-tenant .statistics-mix-summary {
        grid-template-columns: 140px minmax(320px, 1fr) !important;
        gap: 14px !important;
        min-width: 520px;
    }

    #estadisticas-tenant .statistics-mix-pie {
        width: 112px !important;
        height: 112px !important;
        margin: 0 auto 0 0;
    }

    #estadisticas-tenant .statistics-mix-legend {
        min-width: 0;
    }

    #estadisticas-tenant .statistics-mix-legend > div {
        align-items: flex-start !important;
        font-size: 12px !important;
    }

    #estadisticas-tenant .statistics-top-entities-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
    }

    #estadisticas-tenant .statistics-top-entity-card {
        min-width: 0;
        overflow: hidden;
    }

    #estadisticas-tenant .statistics-top-entity-wrap {
        overflow-x: hidden !important;
    }

    #estadisticas-tenant .statistics-top-entity-table {
        table-layout: auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    #estadisticas-tenant .statistics-top-entity-table thead {
        display: none;
    }

    #estadisticas-tenant .statistics-top-entity-table,
    #estadisticas-tenant .statistics-top-entity-table tbody,
    #estadisticas-tenant .statistics-top-entity-table tr,
    #estadisticas-tenant .statistics-top-entity-table td {
        display: block;
        width: 100%;
    }

    #estadisticas-tenant .statistics-top-entity-table tr {
        padding: 12px 0;
        border-bottom: 1px solid #dbe3ef;
    }

    #estadisticas-tenant .statistics-top-entity-table tr:last-child {
        border-bottom: 0;
    }

    #estadisticas-tenant .statistics-top-entity-table td {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
        padding: 4px 0;
        border: 0;
        text-align: left;
    }

    #estadisticas-tenant .statistics-top-entity-name {
        font-weight: 600;
        color: #0f172a;
    }

    #estadisticas-tenant .statistics-top-entity-count::before {
        content: 'Docs.: ';
        font-weight: 600;
        color: #526176;
    }

    #estadisticas-tenant .statistics-top-entity-total::before {
        content: 'Total: ';
        font-weight: 600;
        color: #526176;
    }

    #estadisticas-tenant .statistics-fixed-costs-panel.is-collapsed {
        display: none !important;
    }

    .tenant-menu-bar {
        width: 100%;
    }

    .tenant-menu-bar__inner,
    .tenant-menu-panel__inner {
        padding: 14px 16px;
    }

    .tenant-menu-panel__inner {
        width: min(320px, calc(100vw - 20px));
        border-radius: 0 20px 20px 0;
    }

    .erp-nav-group__summary {
        padding: 12px 14px;
    }

    .erp-nav-link {
        padding: 10px;
    }

    .tenant-menu-toggle {
        align-items: flex-start;
    }

    .tenant-menu-toggle__text strong {
        font-size: 17px;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .lookup-field {
        display: flex;
        align-items: stretch;
        gap: 8px;
        min-width: 0;
    }

    .lookup-field > select,
    .lookup-field > input,
    .lookup-field > .choices,
    .lookup-field > .choices[data-type*="select-one"] {
        flex: 1 1 auto;
        min-width: 0;
    }

    .lookup-field > .button--lookup-touch,
    .lookup-field > .button--lookup,
    .lookup-field > .button.button--icon {
        width: 46px;
        min-width: 46px;
        padding: 0;
        flex: 0 0 46px;
    }

    .lookup-field > .button--lookup-touch .button__icon,
    .lookup-field > .button--lookup .button__icon,
    .lookup-field > .button.button--icon .button__icon {
        width: 16px;
        height: 16px;
    }

    .filters--clients {
        grid-template-columns: 1fr;
    }

    .filters--fiscal-reports .filters__grid {
        grid-template-columns: 1fr;
    }

    .fiscal-report-insights-grid {
        grid-template-columns: 1fr;
    }

    .fiscal-report-trend-scroll {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .fiscal-report-trend-list {
        min-width: 620px;
    }

    .fiscal-report-trend-row {
        min-width: 620px;
    }

    .tenant-table--fiscal-third-parties {
        min-width: 360px;
    }

    .form-grid--one,
    .form-grid--two,
    .form-grid--three,
    .form-grid--four,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .filters__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stock-inventory-summary__chips {
        align-items: flex-start;
    }

    .stock-inventory-detail-filters-wrap {
        padding: 14px;
    }

    .stock-inventory-scanner video {
        max-height: 220px;
    }

    .data-list__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-list__meta {
        text-align: left;
        width: 100%;
    }

    .table-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    #ordenes-trabajo-tenant .card--wide > .panel-section__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #ordenes-trabajo-tenant .card--wide > .panel-section__head .panel-section__head-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    #ordenes-trabajo-tenant .card--wide > .panel-section__head .panel-section__head-actions .button {
        width: 100%;
    }

    #work-orders-bulk-delivery-note-form {
        display: grid;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    #work-orders-bulk-delivery-note-form .button,
    #work-orders-bulk-delivery-note-form .panel-inline-note {
        display: block;
        width: 100%;
        min-width: 0;
    }

    #work-orders-list-wrap .row-actions {
        flex-wrap: nowrap;
        align-items: center;
        white-space: nowrap;
    }

    #work-orders-list-wrap .row-actions .panel-inline-note,
    #work-orders-list-wrap .row-actions .work-order-contract-note--compact {
        flex: 0 0 auto;
        width: auto;
        min-width: 220px;
        max-width: none;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .button {
        width: 100%;
    }

    .row-actions .button {
        width: auto;
    }

    .pos-toolbar__actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .pos-toolbar__actions .button {
        width: auto;
        flex: 0 0 auto;
    }
}
/* Norma de UI: spinner animado en el boton al enviar un formulario (ver media/js/button-loading.js). */
.button.is-loading {
    pointer-events: none;
    opacity: 0.85;
}
.button.is-loading .btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
/* === Ayuda interactiva (boton barra + modal) === */
.topbar-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    flex: 0 0 auto;
    padding: 0;
}
.topbar-help:hover {
    background: rgba(255, 255, 255, 0.16);
}
.topbar-help:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}
.topbar-help__icon {
    display: inline-flex;
}
.topbar-help__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.erp-help-open {
    overflow: hidden;
}
.erp-help-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 16px;
}
.erp-help-modal[hidden] {
    display: none;
}
.erp-help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 38, 0.55);
    backdrop-filter: blur(2px);
}
.erp-help-modal__panel {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--gagp-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(8, 20, 38, 0.35);
    overflow: hidden;
}
.erp-help-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--gagp-navy, #0b1f3a);
    color: #fff;
}
.erp-help-modal__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.erp-help-modal__title-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -4px;
}
.erp-help-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}
.erp-help-modal__close:hover {
    background: rgba(255, 255, 255, 0.26);
}
.erp-help-modal__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.erp-help-modal__search {
    position: relative;
    padding: 14px 18px 8px;
}
.erp-help-modal__search-icon {
    position: absolute;
    top: 50%;
    left: 30px;
    transform: translateY(-30%);
    color: var(--gagp-muted, #5c6b80);
    pointer-events: none;
}
.erp-help-modal__search-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.erp-help-modal__search-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 11px;
    padding: 0 14px 0 40px;
    font: inherit;
    font-size: 15px;
    color: var(--gagp-text, #1b2430);
    background: var(--gagp-surface-alt, #eef3fa);
}
.erp-help-modal__search-input:focus {
    outline: none;
    border-color: var(--gagp-primary, #1e5aa5);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 90, 165, 0.14);
}
.erp-help-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 18px 18px;
}
.erp-help-section-label {
    margin: 14px 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gagp-muted, #5c6b80);
}
.erp-help-card {
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 13px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}
.erp-help-card__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gagp-navy, #0b1f3a);
}
.erp-help-card__intro {
    margin: 0 0 10px;
    color: var(--gagp-text, #1b2430);
    line-height: 1.5;
}
.erp-help-card__block {
    margin-top: 10px;
}
.erp-help-card__block h4 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gagp-primary, #1e5aa5);
}
.erp-help-card__block--tips h4 {
    color: #b45309;
}
.erp-help-card__block ul {
    margin: 0;
    padding-left: 18px;
}
.erp-help-card__block li {
    margin: 4px 0;
    line-height: 1.45;
    color: var(--gagp-text, #1b2430);
}
.erp-help-card__link {
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
    color: var(--gagp-primary, #1e5aa5);
    text-decoration: none;
}
.erp-help-card__link:hover {
    text-decoration: underline;
}
.erp-help-list {
    display: grid;
    gap: 8px;
}
.erp-help-list__item {
    display: block;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 11px;
    padding: 10px 13px;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}
.erp-help-list__item:hover {
    border-color: var(--gagp-primary, #1e5aa5);
    background: var(--gagp-surface-alt, #eef3fa);
}
.erp-help-list__title {
    display: block;
    font-weight: 600;
    color: var(--gagp-navy, #0b1f3a);
}
.erp-help-list__intro {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--gagp-muted, #5c6b80);
    line-height: 1.4;
}
.erp-help-empty {
    padding: 24px 8px;
    text-align: center;
    color: var(--gagp-muted, #5c6b80);
}
.erp-help-modal__foot {
    padding: 10px 18px;
    border-top: 1px solid var(--gagp-line, #ced8e6);
    font-size: 12px;
    color: var(--gagp-muted, #5c6b80);
    background: var(--gagp-surface-alt, #eef3fa);
}
.erp-help-modal__foot kbd {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 11px;
    color: var(--gagp-text, #1b2430);
}
@media (max-width: 640px) {
    .erp-help-modal {
        padding: 0;
    }
    .erp-help-modal__panel {
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* === Pie legal (enlaces a paginas legales) === */
.legal-footer {
    margin-top: auto;
    padding: 8px 32px 26px;
    text-align: center;
}
.legal-footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
    font-size: 12.5px;
    margin-bottom: 4px;
}
.legal-footer-links a {
    color: var(--gagp-muted, #5c6b80);
    text-decoration: none;
}
.legal-footer-links a:hover {
    color: var(--gagp-primary, #1e5aa5);
    text-decoration: underline;
}
.legal-footer-sep {
    color: var(--gagp-line, #ced8e6);
}
.legal-footer .footer-note {
    margin-top: 0;
    padding: 2px 0 0;
    text-align: center;
}

/* === Control horario (fichaje) === */
.timeclock-subtitle {
    margin: 22px 0 10px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gagp-navy, #0b1f3a);
}
.timeclock-kiosk {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.timeclock-emp {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.timeclock-emp:hover {
    border-color: var(--gagp-primary, #1e5aa5);
    box-shadow: 0 6px 18px rgba(30, 90, 165, 0.12);
}
.timeclock-emp:active {
    transform: translateY(1px);
}
.timeclock-emp--in {
    border-color: #16a34a;
    background: #f0fdf4;
}
.timeclock-emp__photo {
    margin-bottom: 4px;
    line-height: 0;
}
.timeclock-emp__name {
    font-weight: 700;
    color: var(--gagp-navy, #0b1f3a);
}
.timeclock-emp__state {
    font-size: 12.5px;
    color: var(--gagp-muted, #5c6b80);
}
.timeclock-emp--in .timeclock-emp__state {
    color: #16a34a;
    font-weight: 600;
}
.timeclock-now {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.timeclock-now__item {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 11px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.timeclock-now__name {
    font-weight: 600;
    color: var(--gagp-navy, #0b1f3a);
}
.timeclock-now__time {
    font-size: 12.5px;
    color: #16a34a;
}
.timeclock-pin-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.timeclock-pin-modal[hidden] {
    display: none;
}
.timeclock-pin-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 38, 0.55);
}
.timeclock-pin-modal__panel {
    position: relative;
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 20px;
    box-shadow: 0 30px 80px rgba(8, 20, 38, 0.35);
    text-align: center;
}
.timeclock-pin-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: var(--gagp-surface-alt, #eef3fa);
    cursor: pointer;
}
.timeclock-pin-modal__close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
.timeclock-pin-modal__who {
    font-weight: 700;
    font-size: 16px;
    color: var(--gagp-navy, #0b1f3a);
    margin-bottom: 10px;
}
.timeclock-pin-modal__dots {
    font-size: 26px;
    letter-spacing: 6px;
    color: var(--gagp-primary, #1e5aa5);
    min-height: 30px;
}
.timeclock-pin-modal__msg {
    min-height: 20px;
    margin: 8px 0;
    font-size: 13px;
    color: var(--gagp-muted, #5c6b80);
}
.timeclock-pin-modal__msg--ok { color: #16a34a; font-weight: 600; }
.timeclock-pin-modal__msg--err { color: #dc2626; font-weight: 600; }
.timeclock-pin-keys {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}
.timeclock-pin-key {
    padding: 14px 0;
    font-size: 18px;
    font-weight: 700;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
}
.timeclock-pin-key:hover {
    background: var(--gagp-surface-alt, #eef3fa);
}
.timeclock-pin-key--ok {
    background: var(--gagp-primary, #1e5aa5);
    color: #fff;
    border-color: var(--gagp-primary, #1e5aa5);
}
.timeclock-row-actions summary {
    cursor: pointer;
}
.timeclock-correct-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-end;
    margin-top: 6px;
}
.timeclock-correct-form label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: var(--gagp-muted, #5c6b80);
}
.timeclock-correct-form input[type="datetime-local"],
.timeclock-correct-form input[type="text"] {
    font: inherit;
    font-size: 13px;
    padding: 5px 7px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 8px;
}

/* === Control horario fase 2 (autoservicio / NFC-QR / geo / jornada) === */
.topbar-fichar svg { stroke: currentColor; }
.topbar-fichar--in { background: rgba(34, 197, 94, 0.22); }
.topbar-fichar--in:hover { background: rgba(34, 197, 94, 0.32); }
.timeclock-self {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    margin: 6px 0 14px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 13px;
    background: var(--gagp-surface-alt, #eef3fa);
}
.timeclock-self__info { display: flex; flex-direction: column; gap: 2px; }
.timeclock-self__label { color: var(--gagp-navy, #0b1f3a); }
.timeclock-self__state { font-size: 13px; color: var(--gagp-muted, #5c6b80); }
.timeclock-self__state--in { color: #16a34a; font-weight: 600; }
.timeclock-scan {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 14px;
}
.timeclock-scan__input {
    flex: 1 1 320px;
    min-width: 220px;
    height: 40px;
    border: 1px dashed var(--gagp-primary, #1e5aa5);
    border-radius: 10px;
    padding: 0 12px;
    font: inherit;
    background: #fff;
}
.timeclock-scan__geo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gagp-muted, #5c6b80); }
.timeclock-geo-link {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--gagp-primary, #1e5aa5);
    border-radius: 5px;
    padding: 1px 4px;
    text-decoration: none;
    vertical-align: 1px;
}
.timeclock-geo-link:hover { filter: brightness(1.08); }
.timeclock-qr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeclock-qr-row code { background: var(--gagp-surface-alt, #eef3fa); padding: 3px 7px; border-radius: 6px; font-size: 12px; }
.timeclock-week-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.timeclock-week-day { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.timeclock-week-day span { font-size: 11px; font-weight: 700; color: var(--gagp-muted, #5c6b80); }
.timeclock-week-day input { width: 62px; text-align: center; padding: 5px; border: 1px solid var(--gagp-line, #ced8e6); border-radius: 8px; font: inherit; }

/* Control horario: camara QR (movil) */
.timeclock-cam {
    margin: 0 0 14px;
    max-width: 420px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.timeclock-cam__video {
    display: block;
    width: 100%;
    min-height: 220px;
    max-height: 320px;
    background: #000;
}
.timeclock-cam__video video {
    display: block;
    width: 100% !important;
    max-height: 320px;
    object-fit: cover;
}
.timeclock-cam__video img {
    display: none;
}
.timeclock-cam__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: var(--gagp-surface, #fff);
}
.timeclock-cam__msg { font-size: 13px; color: var(--gagp-muted, #5c6b80); }

/* Control horario: filtros homogeneos (campos uniformes, como el resto del ERP) */
#control-horario-tenant .filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 14px;
}
#control-horario-tenant .filters__group {
    display: grid;
    gap: 6px;
    flex: 1 1 170px;
    min-width: 150px;
}
#control-horario-tenant .filters__group--action {
    flex: 0 0 auto;
    min-width: 0;
}
#control-horario-tenant .filters__group label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gagp-muted, #5c6b80);
}
#control-horario-tenant .filters__group input,
#control-horario-tenant .filters__group select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--gagp-line, #ced8e6);
    border-radius: 10px;
    background: #fff;
    color: var(--gagp-text, #1b2430);
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}
#control-horario-tenant .filters__group input[type="checkbox"],
#control-horario-tenant .filters__group input[type="radio"] {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
    margin: 0 8px 0 0;
    border-radius: 4px;
    flex: 0 0 auto;
    -webkit-appearance: auto;
    appearance: auto;
}
#control-horario-tenant .filters__group .checkbox-row {
    display: flex;
    align-items: center;
    min-height: 42px;
}
#control-horario-tenant .filters__group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
#control-horario-tenant .filters__group input:focus,
#control-horario-tenant .filters__group select:focus {
    outline: none;
    border-color: var(--gagp-primary, #1e5aa5);
    box-shadow: 0 0 0 3px rgba(30, 90, 165, 0.14);
}
/* Modal generico del QR del terminal */
.timeclock-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.timeclock-qr-modal[hidden] { display: none; }
.timeclock-qr-modal__backdrop { position: absolute; inset: 0; background: rgba(8, 20, 38, 0.55); }
.timeclock-qr-modal__panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(8, 20, 38, 0.35);
}
.timeclock-qr-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: var(--gagp-surface-alt, #eef3fa);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.timeclock-qr-modal__frame { width: 100%; height: 460px; border: 0; display: block; }
/* Fichar plegable */
.timeclock-fichar > summary { list-style: none; }
.timeclock-fichar > summary::-webkit-details-marker { display: none; }

/* ===== Calendario visual (ERP + portal) — erp-calendar.js ===== */
.erp-cal { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.erp-cal *, .erp-cal *::before, .erp-cal *::after { box-sizing: border-box; }
.erp-cal__toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.erp-cal__toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.erp-cal__nav { display: inline-flex; gap: 6px; }
.erp-cal__title { font-size: 18px; font-weight: 800; color: var(--gagp-text, #0f172a); min-width: 160px; }
.erp-cal__btn { border: 1px solid var(--theme-border, #e2e8f0); background: var(--theme-surface-strong, #fff); color: var(--gagp-text, #0f172a); border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1; transition: background .15s, border-color .15s, color .15s; }
.erp-cal__btn:hover { border-color: var(--theme-border-strong, #cbd5e1); }
.erp-cal__btn--icon { font-size: 18px; padding: 6px 12px; }
.erp-cal__views { display: inline-flex; border: 1px solid var(--theme-border, #e2e8f0); border-radius: 10px; overflow: hidden; }
.erp-cal__btn--view { border: 0; border-radius: 0; border-left: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__btn--view:first-child { border-left: 0; }
.erp-cal__btn--view.is-active { background: var(--theme-accent, #2563eb); color: #fff; }
.erp-cal__employee { border: 1px solid var(--theme-border, #e2e8f0); border-radius: 10px; padding: 7px 12px; font: inherit; background: var(--theme-surface-strong, #fff); color: var(--gagp-text, #0f172a); max-width: 220px; }
.erp-cal__body { min-height: 280px; }
.erp-cal__loading { padding: 40px; text-align: center; color: var(--gagp-muted, #64748b); }

/* Leyenda */
.erp-cal__legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--gagp-muted, #64748b); }
.erp-cal__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.erp-cal__legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Vista mes */
.erp-cal__month { border: 1px solid var(--theme-border, #e2e8f0); border-radius: 12px; overflow: hidden; }
.erp-cal__month-head, .erp-cal__month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.erp-cal__dow { padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gagp-muted, #64748b); background: var(--theme-surface, #f8fafc); border-bottom: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__cell { min-height: 108px; border-right: 1px solid var(--theme-border, #eef2f7); border-bottom: 1px solid var(--theme-border, #eef2f7); padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--theme-surface-strong, #fff); }
.erp-cal__cell:nth-child(7n) { border-right: 0; }
.erp-cal__cell.is-muted { background: var(--theme-surface, #f8fafc); }
.erp-cal__cell.is-muted .erp-cal__cell-num { color: #cbd5e1; }
.erp-cal__cell.is-nonworking { background: #eceff3; }
.erp-cal__cell.is-nonworking .erp-cal__cell-num { color: #94a3b8; }
.erp-cal__cell.is-today { background: rgba(37, 99, 235, 0.06); }
.erp-cal__cell-num { font-size: 12px; font-weight: 700; color: var(--gagp-text, #0f172a); text-align: right; padding: 0 2px; }
.erp-cal__cell.is-today .erp-cal__cell-num { color: #fff; background: var(--theme-accent, #2563eb); border-radius: 999px; width: 22px; height: 22px; line-height: 22px; text-align: center; margin-left: auto; }

/* Chips de evento */
.erp-cal__chip { --chip: #2563eb; display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 3px 7px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: #fff; background: var(--chip); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; border-left: 3px solid rgba(0,0,0,0.18); }
.erp-cal__chip:hover { filter: brightness(0.94); }
.erp-cal__chip-time { font-weight: 800; margin-right: 4px; opacity: .9; }
.erp-cal__more { border: 0; background: transparent; color: var(--gagp-muted, #64748b); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; text-align: left; padding: 1px 4px; }
.erp-cal__more:hover { color: var(--theme-accent, #2563eb); }

/* Vista semana / dia */
.erp-cal__time { border: 1px solid var(--theme-border, #e2e8f0); border-radius: 12px; overflow: hidden; }
.erp-cal__time-head, .erp-cal__time-allday { display: grid; grid-template-columns: 60px repeat(var(--cols, 7), 1fr); }
.erp-cal__time--day .erp-cal__time-head, .erp-cal__time--day .erp-cal__time-allday { grid-template-columns: 60px 1fr; }
.erp-cal__time-gutter { padding: 6px; font-size: 10px; color: var(--gagp-muted, #64748b); display: flex; align-items: center; justify-content: center; text-align: center; background: var(--theme-surface, #f8fafc); border-right: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__time-dayhead { padding: 6px; text-align: center; border-left: 1px solid var(--theme-border, #eef2f7); background: var(--theme-surface, #f8fafc); border-bottom: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__time-dayhead.is-nonworking { background: #e2e7ee; }
.erp-cal__time-dayhead.is-today { background: rgba(37, 99, 235, 0.10); }
.erp-cal__time-dow { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--gagp-muted, #64748b); }
.erp-cal__time-date { display: block; font-size: 16px; font-weight: 800; color: var(--gagp-text, #0f172a); }
.erp-cal__time-allcell { padding: 3px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--theme-border, #eef2f7); border-bottom: 1px solid var(--theme-border, #e2e8f0); min-height: 26px; }
.erp-cal__time-scroll { max-height: 520px; overflow-y: auto; }
.erp-cal__time-grid { display: grid; grid-template-columns: 60px repeat(var(--cols, 7), 1fr); position: relative; }
.erp-cal__time--day .erp-cal__time-grid { grid-template-columns: 60px 1fr; }
.erp-cal__time-hours { border-right: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__time-hour { height: 48px; font-size: 10px; color: var(--gagp-muted, #64748b); text-align: right; padding: 2px 6px 0 0; }
.erp-cal__time-col { position: relative; border-left: 1px solid var(--theme-border, #eef2f7); }
.erp-cal__time-col.is-nonworking { background: #f1f5f9; }
.erp-cal__time-col.is-today { background: rgba(37, 99, 235, 0.04); }
.erp-cal__time-slot { height: 48px; border-bottom: 1px solid var(--theme-border, #f1f5f9); }
.erp-cal__time-event { --chip: #2563eb; position: absolute; left: 3px; right: 3px; min-height: 18px; border: 0; border-left: 3px solid rgba(0,0,0,0.2); border-radius: 6px; background: var(--chip); color: #fff; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 5px; overflow: hidden; text-align: left; line-height: 1.3; }
.erp-cal__time-event:hover { filter: brightness(0.94); }
.erp-cal__time-event-time { font-weight: 800; }

/* Modal de detalle */
.erp-cal__overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 4000; padding: 16px; }
.erp-cal__modal { background: var(--theme-surface-strong, #fff); border-radius: 16px; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3); }
.erp-cal__modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--theme-border, #e2e8f0); }
.erp-cal__modal-title { margin: 0; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--gagp-muted, #64748b); }
.erp-cal__modal-close { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--gagp-muted, #64748b); }
.erp-cal__detail, .erp-cal__daylist { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.erp-cal__detail-head { display: flex; align-items: center; gap: 8px; }
.erp-cal__detail-dot { width: 12px; height: 12px; border-radius: 4px; }
.erp-cal__detail-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gagp-muted, #64748b); }
.erp-cal__detail-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--gagp-text, #0f172a); }
.erp-cal__detail-when { margin: 0; font-size: 13px; color: var(--gagp-text, #334155); }
.erp-cal__detail-meta { display: flex; flex-direction: column; gap: 4px; }
.erp-cal__detail-row { display: flex; gap: 8px; font-size: 13px; }
.erp-cal__detail-k { font-weight: 700; color: var(--gagp-muted, #64748b); min-width: 96px; }
.erp-cal__detail-v { color: var(--gagp-text, #0f172a); }
.erp-cal__detail-link { margin-top: 4px; display: inline-block; text-align: center; background: var(--theme-accent, #2563eb); color: #fff; text-decoration: none; padding: 9px 14px; border-radius: 10px; font-weight: 700; }
.erp-cal__daylist .erp-cal__chip { font-size: 13px; padding: 7px 10px; }

/* Vista Agenda (lista por dia) */
.erp-cal__list { display: flex; flex-direction: column; border: 1px solid var(--theme-border, #e2e8f0); border-radius: 12px; overflow: hidden; }
.erp-cal__list-day { display: grid; grid-template-columns: 88px 1fr; border-bottom: 1px solid var(--theme-border, #eef2f7); }
.erp-cal__list-day:last-child { border-bottom: 0; }
.erp-cal__list-date { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 12px 8px; background: var(--theme-surface, #f8fafc); border-right: 1px solid var(--theme-border, #eef2f7); text-align: center; }
.erp-cal__list-date.is-today { background: rgba(37, 99, 235, 0.10); }
.erp-cal__list-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--gagp-muted, #64748b); }
.erp-cal__list-num { font-size: 22px; font-weight: 800; color: var(--gagp-text, #0f172a); line-height: 1.1; }
.erp-cal__list-date.is-today .erp-cal__list-num { color: var(--theme-accent, #2563eb); }
.erp-cal__list-month { font-size: 11px; color: var(--gagp-muted, #64748b); text-transform: uppercase; }
.erp-cal__list-items { display: flex; flex-direction: column; }
.erp-cal__list-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--theme-border, #f1f5f9); background: var(--theme-surface-strong, #fff); font: inherit; text-align: left; cursor: pointer; width: 100%; }
.erp-cal__list-item:last-child { border-bottom: 0; }
.erp-cal__list-item:hover { background: var(--theme-surface, #f8fafc); }
.erp-cal__list-bar { width: 4px; align-self: stretch; min-height: 28px; border-radius: 4px; flex: 0 0 auto; }
.erp-cal__list-time { flex: 0 0 92px; font-size: 12px; font-weight: 700; color: var(--gagp-muted, #64748b); }
.erp-cal__list-main { display: flex; flex-direction: column; min-width: 0; }
.erp-cal__list-title { font-size: 14px; font-weight: 600; color: var(--gagp-text, #0f172a); word-break: break-word; }
.erp-cal__list-type { font-size: 11px; color: var(--gagp-muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 640px) {
    .erp-cal__list-day { grid-template-columns: 62px 1fr; }
    .erp-cal__list-time { flex-basis: 68px; }
    .erp-cal__list-num { font-size: 18px; }
}

@media (max-width: 640px) {
    .erp-cal__cell { min-height: 74px; }
    .erp-cal__title { font-size: 16px; min-width: 0; }
    .erp-cal__toolbar-right { margin-left: 0; width: 100%; }
    .erp-cal__chip { font-size: 11px; padding: 2px 5px; }
    .erp-cal__dow { font-size: 9px; }
}
