html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
}

:root,
:root[data-theme="fincaos"] {
    --app-primary: #33b7aa;
    --app-primary-strong: #179287;
    --app-bg: #f3f9f8;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #e4f3f1;
    --app-border: #dfe8e6;
    --app-text: #243633;
    --app-muted: #60706d;
    --theme-band-start: #1f938a;
    --theme-band-end: #82d7cf;
    --theme-action-start: #17887f;
    --theme-action-end: #73ccc3;
    --theme-soft-action: rgba(255, 255, 255, .28);
    --theme-success: #37b96d;
    --theme-warning: #d69d2f;
    --theme-danger-start: #b34444;
    --theme-danger-end: #d66d6d;
}

:root[data-theme="corporate-blue"] {
    --app-primary: #2563eb;
    --app-primary-strong: #1d4ed8;
    --app-bg: #f4f7fb;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #e8f0ff;
    --app-border: #d9e2f1;
    --app-text: #1d2a3a;
    --app-muted: #5b6b82;
    --theme-band-start: #1d4ed8;
    --theme-band-end: #60a5fa;
    --theme-action-start: #1e40af;
    --theme-action-end: #3b82f6;
    --theme-soft-action: rgba(255, 255, 255, .25);
    --theme-success: #2563eb;
    --theme-warning: #d69d2f;
    --theme-danger-start: #b91c1c;
    --theme-danger-end: #ef4444;
}

:root[data-theme="petroleum-green"] {
    --app-primary: #0f766e;
    --app-primary-strong: #115e59;
    --app-bg: #f3f8f6;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #dff2ee;
    --app-border: #d6e7e2;
    --app-text: #203732;
    --app-muted: #5b706b;
    --theme-band-start: #115e59;
    --theme-band-end: #5eead4;
    --theme-action-start: #134e4a;
    --theme-action-end: #2dd4bf;
    --theme-soft-action: rgba(255, 255, 255, .24);
    --theme-success: #0f766e;
    --theme-warning: #d69d2f;
    --theme-danger-start: #9f3333;
    --theme-danger-end: #dc6868;
}

:root[data-theme="modern-graphite"] {
    --app-primary: #4b5563;
    --app-primary-strong: #374151;
    --app-bg: #f5f6f7;
    --app-surface: #ffffff;
    --app-sidebar: #fbfbfc;
    --app-sidebar-active: #e9ecef;
    --app-border: #d9dde2;
    --app-text: #20242a;
    --app-muted: #626b76;
    --theme-band-start: #303946;
    --theme-band-end: #8b95a1;
    --theme-action-start: #27313f;
    --theme-action-end: #748091;
    --theme-soft-action: rgba(255, 255, 255, .22);
    --theme-success: #4b5563;
    --theme-warning: #d69d2f;
    --theme-danger-start: #8d3434;
    --theme-danger-end: #bd5c5c;
}

:root[data-theme="cattle-pasture"] {
    --app-primary: #2f855a;
    --app-primary-strong: #276749;
    --app-bg: #f4faf5;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #e1f3e7;
    --app-border: #d7e8dc;
    --app-text: #20372b;
    --app-muted: #5d7264;
    --theme-band-start: #276749;
    --theme-band-end: #88d498;
    --theme-action-start: #22543d;
    --theme-action-end: #68d391;
    --theme-soft-action: rgba(255, 255, 255, .25);
    --theme-success: #2f855a;
    --theme-warning: #b7791f;
    --theme-danger-start: #9b2c2c;
    --theme-danger-end: #e57373;
}

:root[data-theme="rural-olive"] {
    --app-primary: #6b8e23;
    --app-primary-strong: #4d6f1f;
    --app-bg: #f8faf1;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #edf4d8;
    --app-border: #dfe8c8;
    --app-text: #313a25;
    --app-muted: #68745a;
    --theme-band-start: #4d6f1f;
    --theme-band-end: #a7c957;
    --theme-action-start: #3f6212;
    --theme-action-end: #84a93c;
    --theme-soft-action: rgba(255, 255, 255, .25);
    --theme-success: #6b8e23;
    --theme-warning: #b7791f;
    --theme-danger-start: #9b2c2c;
    --theme-danger-end: #d66d6d;
}

:root[data-theme="finca-aurora"] {
    --app-primary: #f59e0b;
    --app-primary-strong: #0f766e;
    --app-bg: #f8fbf3;
    --app-surface: #ffffff;
    --app-sidebar: #ffffff;
    --app-sidebar-active: #fff3c4;
    --app-border: #dbe7c9;
    --app-text: #203423;
    --app-muted: #63725a;
    --theme-band-start: #064e3b;
    --theme-band-end: #f59e0b;
    --theme-action-start: #0f766e;
    --theme-action-end: #fbbf24;
    --theme-soft-action: rgba(255, 255, 255, .28);
    --theme-success: #16a34a;
    --theme-warning: #f59e0b;
    --theme-danger-start: #991b1b;
    --theme-danger-end: #ef4444;
}

.mud-popover,
.mud-paper,
.mud-input,
.mud-input-control,
.mud-typography,
.mud-table,
.mud-list,
.mud-menu,
.mud-dialog {
    font-family: inherit;
}

.mud-paper,
.mud-popover {
    background-color: var(--app-surface);
    color: var(--app-text);
}

.mud-primary-text,
.mud-input-adornment,
.mud-input-label,
.mud-icon-root {
    color: var(--app-primary-strong);
}

.mud-input-root,
.mud-input-slot,
.mud-input > input,
.mud-input > textarea,
.mud-select,
.mud-select-input {
    color: var(--app-text);
}

.mud-input-underline::before,
.mud-input-underline:hover:not(.mud-disabled)::before,
.mud-input-underline::after,
.mud-input-outlined-border {
    border-color: var(--app-border);
}

.mud-input:focus-within ~ .mud-input-outlined-border,
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--app-primary);
}

.mud-button-root {
    border-radius: 999px;
    font-family: inherit;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.mud-button-filled-primary,
.mud-button-filled-success,
.mud-button-filled-info {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end));
    color: #fff;
}

.mud-button-text-primary,
.mud-button-text-info,
.mud-button-text-success {
    color: var(--app-primary-strong);
}

.mud-table-root .mud-table-head .mud-table-cell {
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
    font-weight: 800;
}

.mud-table-root .mud-table-row:hover {
    background-color: color-mix(in srgb, var(--app-primary) 8%, transparent);
}

.mud-list-item.active-role-item,
.mud-list-item.active-role-item:hover {
    background: var(--app-sidebar-active);
    color: var(--app-primary-strong);
}

.mud-alert-outlined-info,
.mud-alert-outlined-normal {
    border-color: color-mix(in srgb, var(--app-primary) 35%, transparent);
    color: var(--app-text);
}

.mud-alert-filled-normal,
.mud-alert-filled-info {
    background: color-mix(in srgb, var(--app-primary) 12%, #fff);
    color: var(--app-text);
}

.mud-switch-base.mud-checked + .mud-switch-track {
    background-color: color-mix(in srgb, var(--theme-success) 45%, transparent);
}

.mud-switch-base.mud-checked .mud-switch-thumb {
    background-color: var(--theme-success);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: var(--app-primary);
    border-color: var(--app-primary-strong);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding: 1.25rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    background: var(--app-sidebar);
    border-right: 1px solid var(--app-border);
    flex: 0 0 280px;
    min-height: 100vh;
    transition: margin-left .2s ease;
}

.sidebar:not(.sidebar-open) {
    margin-left: -280px;
}

.sidebar-backdrop {
    display: none;
}

.main-panel {
    flex: 1;
    min-width: 0;
}

.app-topbar {
    align-items: center;
    background: var(--app-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
    color: #fff;
    display: flex;
    gap: 1rem;
    min-height: 64px;
    padding: .6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.icon-button {
    background: rgba(255, 255, 255, .18);
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 1.25rem;
    height: 40px;
    width: 40px;
}

.sidebar-close {
    display: none;
}

.topbar-lock-button,
.topbar-theme-button {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.topbar-lock-button:hover,
.topbar-theme-button:hover {
    background: rgba(255, 255, 255, .28);
}

.app-icon {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    height: 1.25rem;
    justify-content: center;
    width: 1.25rem;
}

.app-icon svg {
    display: block;
    fill: currentColor;
    height: 100%;
    width: 100%;
}

.topbar-context {
    align-items: center;
    display: flex;
    flex: 0 1 auto;
    gap: .75rem;
    min-width: 0;
}

.topbar-context span {
    font-size: .95rem;
    opacity: .95;
}

.topbar-tenant-profile {
    display: grid;
    line-height: 1.15;
    min-width: 130px;
}

.topbar-tenant-profile strong {
    color: #fff;
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-tenant-profile small {
    color: rgba(255, 255, 255, .86);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tenant-topbar-logo {
    background: rgba(255, 255, 255, .95);
    border-radius: 8px;
    max-height: 42px;
    max-width: 150px;
    object-fit: contain;
    padding: .25rem .45rem;
}

.user-menu,
.theme-menu {
    position: relative;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-left: auto;
    min-width: max-content;
}

.session-timer {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    gap: .45rem;
    min-height: 36px;
    padding: .35rem .75rem;
    white-space: nowrap;
}

.session-timer .app-icon {
    height: 1.1rem;
    width: 1.1rem;
}

.session-timer-warning {
    background: rgba(255, 193, 7, .24);
    border-color: rgba(255, 255, 255, .38);
}

.active-farm-menu {
    flex: 1 1 360px;
    max-width: 620px;
    min-width: 220px;
    position: relative;
}

.active-farm-button {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 6px;
    color: #fff;
    display: grid;
    gap: .65rem;
    grid-template-columns: 22px minmax(0, 1fr) 22px;
    min-height: 46px;
    padding: .35rem .75rem;
    text-align: left;
    width: 100%;
}

.active-farm-button:disabled {
    cursor: default;
    opacity: 1;
}

.active-farm-button:not(:disabled):hover {
    background: rgba(255, 255, 255, .2);
}

.active-farm-copy {
    display: grid;
    line-height: 1.1;
    min-width: 0;
}

.active-farm-copy small {
    color: rgba(255, 255, 255, .76);
    font-size: .72rem;
}

.active-farm-copy strong {
    color: #fff;
    font-size: .95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-farm-dropdown {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
    color: var(--app-text);
    left: 0;
    min-width: 320px;
    padding: .4rem;
    position: absolute;
    top: 54px;
    width: 100%;
    z-index: 35;
}

.active-farm-dropdown-title,
.active-farm-option {
    align-items: center;
    display: grid;
    gap: .75rem;
    grid-template-columns: 26px minmax(0, 1fr);
}

.active-farm-dropdown-title {
    color: var(--app-muted);
    font-weight: 700;
    min-height: 40px;
    padding: .45rem .6rem;
}

.active-farm-option {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--app-text);
    min-height: 48px;
    padding: .55rem .6rem;
    text-align: left;
    width: 100%;
}

.active-farm-option:hover,
.active-farm-option.active {
    background: var(--app-sidebar-active);
}

.active-farm-option .app-icon {
    color: var(--app-primary-strong);
}

.active-farm-thumb {
    border-radius: 4px;
    height: 24px;
    object-fit: cover;
    width: 24px;
}

.active-farm-option span {
    display: grid;
    line-height: 1.15;
    min-width: 0;
}

.active-farm-option small {
    color: var(--app-muted);
    font-size: .78rem;
}

.active-farm-empty {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    gap: .45rem;
    min-height: 36px;
    padding: .35rem .75rem;
    white-space: nowrap;
}

.user-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: #fff;
    display: flex;
    gap: .6rem;
    text-align: left;
}

.user-summary {
    display: grid;
    line-height: 1.15;
}

.user-summary small {
    opacity: .85;
}

.user-dropdown {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, .18);
    color: var(--app-text);
    min-width: 280px;
    padding: .75rem;
    position: absolute;
    right: 0;
    top: 48px;
    z-index: 30;
}

.theme-dropdown {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 4px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
    color: var(--app-text);
    min-width: 260px;
    padding: .45rem 0;
    position: absolute;
    right: 0;
    top: 48px;
    z-index: 35;
}

.user-dropdown button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--app-text);
    display: grid;
    gap: .75rem;
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 42px;
    padding: .55rem .7rem;
    text-align: left;
    width: 100%;
}

.user-dropdown button .app-icon {
    color: var(--app-primary-strong);
    justify-self: center;
}

.user-dropdown button:hover,
.theme-menu-option:hover {
    background: var(--app-sidebar-active);
}

.user-dropdown-action span {
    align-self: center;
}

.logout-action {
    font-weight: 700;
}

.audit-record-id {
    display: inline-block;
    font-family: Consolas, Monaco, monospace;
    font-size: .8rem;
    max-width: 170px;
    overflow-wrap: anywhere;
}

.audit-values {
    background: color-mix(in srgb, var(--app-primary) 5%, var(--app-surface));
    border: 1px solid var(--app-border);
    border-radius: 6px;
    color: var(--app-text);
    font-family: Consolas, Monaco, monospace;
    font-size: .78rem;
    line-height: 1.35;
    margin: 0;
    max-height: 145px;
    max-width: 320px;
    overflow: auto;
    padding: .5rem;
    white-space: pre-wrap;
}

.theme-dropdown-label,
.theme-menu-option {
    align-items: center;
    display: grid;
    gap: .75rem;
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 44px;
    padding: .5rem 1rem;
    width: 100%;
}

.theme-dropdown-label {
    color: var(--app-muted);
    cursor: default;
}

.theme-dropdown-label .mud-icon-root,
.theme-menu-option .mud-icon-root {
    font-size: 1.25rem;
    justify-self: center;
}

.theme-menu-option {
    background: transparent;
    border: 0;
    color: var(--app-text);
    font-size: .98rem;
    line-height: 1.2;
    text-align: left;
}

.theme-menu-option.active {
    font-weight: 700;
}

.theme-menu-option .mud-icon-root {
    color: var(--app-primary-strong);
}

.dropdown-identity {
    display: grid;
    gap: .2rem;
    padding: .25rem .7rem .7rem;
}

.dropdown-identity span,
.dropdown-label,
.muted {
    color: var(--app-muted);
}

.dropdown-divider {
    border-top: 1px solid var(--app-border);
    margin: .4rem 0;
}

.theme-dot {
    border-radius: 50%;
    display: inline-block;
    height: 14px;
    width: 14px;
}

.theme-dot.fincaos { background: #33b7aa; }
.theme-dot.corporate-blue { background: #2563eb; }
.theme-dot.petroleum-green { background: #0f766e; }
.theme-dot.modern-graphite { background: #4b5563; }
.theme-dot.cattle-pasture { background: #2f855a; }
.theme-dot.rural-olive { background: #6b8e23; }
.theme-dot.finca-aurora { background: linear-gradient(135deg, #064e3b 0%, #f59e0b 100%); }

.brand-block {
    align-items: center;
    background:
        radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--theme-accent) 34%, transparent), transparent 34%),
        linear-gradient(145deg, color-mix(in srgb, var(--theme-band-start) 92%, #020617), color-mix(in srgb, var(--theme-band-end) 36%, #05251c));
    border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 24%, transparent);
    display: flex;
    gap: .45rem;
    height: 82px;
    justify-content: space-between;
    overflow: hidden;
    padding: 8px 9px;
    position: relative;
}

.brand-link {
    color: var(--app-primary-strong);
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
}

.brand-block > div {
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    min-width: 0;
}

.brand-logo-link {
    align-items: center;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, .16), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--theme-band-start) 82%, #041b12), color-mix(in srgb, var(--theme-band-end) 72%, #0b2d1b));
    border: 1px solid color-mix(in srgb, var(--theme-accent) 52%, white);
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        inset 0 -12px 20px rgba(0, 0, 0, .2),
        0 12px 28px rgba(0, 0, 0, .22),
        0 0 0 4px color-mix(in srgb, var(--theme-accent) 12%, transparent);
    display: flex;
    gap: .58rem;
    height: 66px;
    isolation: isolate;
    justify-content: flex-start;
    overflow: hidden;
    padding: 5px 13px 5px 6px;
    position: relative;
    text-decoration: none;
    width: 100%;
}

.brand-logo-link::after {
    animation: brand-shine 4.6s ease-in-out infinite;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, .24) 38%, transparent 58%);
    content: "";
    inset: 0;
    position: absolute;
    transform: translateX(-112%);
    z-index: 2;
}

.brand-logo {
    border-radius: 20px;
    box-sizing: border-box;
    display: block;
    filter: saturate(1.08) contrast(1.04);
    height: 100%;
    max-height: none;
    object-fit: contain;
    object-position: center;
    padding: 0;
    position: relative;
    transform: none;
    width: 100%;
    z-index: 1;
}

.brand-cow-frame {
    align-items: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .92), color-mix(in srgb, var(--theme-accent) 22%, #ffffff)),
        #ffffff;
    border: 2px solid rgba(255, 255, 255, .86);
    border-radius: 999px;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, .24),
        0 0 0 3px color-mix(in srgb, var(--theme-accent) 22%, transparent);
    display: inline-flex;
    flex: 0 0 56px;
    height: 56px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 3;
}

.brand-cow-photo {
    display: block;
    filter: saturate(1.08) contrast(1.04);
    height: 100%;
    object-fit: cover;
    object-position: center 36%;
    width: 100%;
}

.brand-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
    min-width: 0;
    position: relative;
    z-index: 3;
}

.brand-title {
    color: #ffffff;
    font-size: clamp(1.34rem, 1.8vw, 1.82rem);
    font-weight: 950;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .32);
    white-space: nowrap;
}

.brand-title span {
    color: #d7fb4f;
    font-size: inherit;
}

.brand-subtitle {
    color: rgba(236, 253, 245, .9);
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .045rem;
    margin-top: .22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.subscription-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.subscription-summary > div {
    border: 1px solid rgba(15, 130, 117, .18);
    border-radius: 8px;
    padding: .75rem;
    background: rgba(15, 130, 117, .06);
}

.subscription-summary span {
    display: block;
    color: var(--muted-text);
    font-size: .78rem;
}

.subscription-summary strong {
    display: block;
    margin-top: .25rem;
    color: var(--app-text);
}

.pricing-page {
    max-width: 1280px;
}

.pricing-card {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.pricing-title {
    color: var(--primary-dark);
    font-weight: 900;
}

.pricing-description {
    min-height: 2.8rem;
    color: var(--muted-text);
}

.pricing-price {
    margin: 1rem 0;
    padding: .85rem;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(14, 126, 111, .12), rgba(38, 205, 184, .18));
}

.pricing-price span {
    display: block;
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--primary-dark);
}

.pricing-price small {
    color: var(--muted-text);
    font-weight: 700;
}

.pricing-features {
    flex: 1;
    margin: 0;
    padding-left: 1.1rem;
    color: var(--app-text);
}

.pricing-features li {
    margin-bottom: .45rem;
}

.compact-validation-list {
    margin: 0;
    padding-left: 1.1rem;
}

.compact-validation-list li + li {
    margin-top: .18rem;
}

@keyframes brand-shine {
    0%, 58% {
        transform: translateX(-112%);
    }

    82%, 100% {
        transform: translateX(112%);
    }
}

.topbar-app-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.side-nav {
    display: grid;
    gap: .15rem;
    padding: .75rem;
}

.side-nav .nav-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--app-text);
    display: flex;
    gap: .65rem;
    min-height: 42px;
    padding: .55rem .75rem;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.side-nav .nav-link.active,
.side-nav .nav-link:hover {
    background: var(--app-sidebar-active);
    color: var(--app-primary-strong);
}

.side-nav .app-icon {
    align-items: center;
    background: color-mix(in srgb, var(--app-primary) 16%, transparent);
    border-radius: 7px;
    color: var(--app-primary-strong);
    display: inline-flex;
    font-size: .75rem;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.nav-node.level-1 { padding-left: 1rem; }
.nav-node.level-2 { padding-left: 2rem; }

.nav-container {
    font-weight: 800;
}

.nav-caret {
    color: var(--app-muted);
    margin-left: auto;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.admin-shell {
    margin: 0 auto;
    max-width: none;
    width: calc(100% - 10mm);
}

.admin-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    margin: 0;
}

.admin-header p {
    color: #5d665f;
    margin: .25rem 0 0;
}

.admin-panel {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: 1rem;
}

.form-panel {
    max-width: 440px;
}

.module-title {
    color: #495850;
    font-size: .9rem;
    margin-top: 1rem;
}

.permission-grid {
    display: grid;
    gap: .5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.user-photo {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    height: 36px;
    justify-content: center;
    object-fit: cover;
    width: 36px;
}

.user-photo-empty {
    background: #dfe8e2;
    color: #294137;
    font-size: .8rem;
    font-weight: 700;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-end;
}

.login-stage {
    background: #edf6f5;
    inset: 0;
    min-height: 100vh;
    overflow: auto;
    position: fixed;
    z-index: 100;
}

.login-backdrop {
    inset: 0;
    position: absolute;
}

.mock-topbar {
    align-items: center;
    background: linear-gradient(90deg, #38bbae, #7fd6cb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    color: #fff;
    display: flex;
    gap: 2.6rem;
    height: 74px;
    padding: 0 2rem;
}

.mock-brand {
    color: #219f95;
    font-weight: 800;
    width: 70px;
}

.mock-menu,
.mock-register .app-icon {
    color: #fff;
}

.mock-time,
.mock-profile,
.mock-register {
    font-size: 1.15rem;
    font-weight: 700;
}

.mock-register {
    align-items: center;
    display: flex;
    gap: .7rem;
    margin-left: auto;
}

.mock-register .app-icon {
    background: rgba(255,255,255,.16);
    border-radius: 50%;
    height: 3.5rem;
    padding: .9rem;
    width: 3.5rem;
}

.mock-sidebar {
    background: #fff;
    border-right: 1px solid #d4dddb;
    bottom: 0;
    display: grid;
    gap: 1.8rem;
    justify-items: center;
    left: 0;
    padding-top: 1rem;
    position: absolute;
    top: 74px;
    width: 116px;
}

.mock-sidebar .app-icon {
    color: var(--app-primary);
    height: 2rem;
    width: 2rem;
}

.mock-content {
    color: #202a2a;
    left: 116px;
    position: absolute;
    right: 0;
    top: 74px;
}

.mock-content p {
    font-size: 1.2rem;
    margin: 0;
    padding: .25rem .8rem;
}

.mock-content div {
    background: rgba(225, 243, 241, .62);
    height: 104px;
    margin-bottom: 104px;
}

.login-overlay {
    backdrop-filter: blur(3px);
    background: rgba(40, 43, 42, .58);
    inset: 0;
    position: absolute;
}

.login-card {
    background: #fff;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 24px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .25);
    left: 50%;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 508px;
}

.login-card-header {
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    padding: 1rem 1.55rem;
}

.login-card-body {
    padding: 2.4rem 2.35rem 2rem;
    text-align: center;
}

.login-modal-body {
    padding: 1.6rem 2rem 1.7rem;
}

.login-lock {
    color: var(--app-primary);
    margin: 0 auto .8rem;
}

.login-lock .app-icon,
.mud-login-lock {
    height: 3rem;
    width: 3rem;
}

.login-card h1 {
    color: var(--app-primary);
    font-size: 2rem;
    font-weight: 400;
    margin: 0;
}

.login-card p,
.login-subtitle {
    color: #158d86;
    font-size: 1.15rem;
    margin: .6rem 0 1rem;
}

.login-field {
    margin-bottom: 1rem;
    text-align: left;
}

.login-field .mud-input-control-input-container {
    min-height: 66px;
}

.login-separator {
    border-top: 1px solid #dde2e0;
    margin: 1rem 0 1.45rem;
}

.floating-field {
    border: 1px solid #c7ccca;
    border-radius: 6px;
    display: flex;
    height: 66px;
    margin-bottom: 1rem;
    position: relative;
    text-align: left;
}

.floating-field span {
    background: #fff;
    color: #333;
    font-size: 1rem;
    left: 1rem;
    line-height: 1;
    padding: 0 .4rem;
    position: absolute;
    top: -.55rem;
}

.floating-field .app-icon {
    color: #565656;
    height: 1.45rem;
    left: 1.25rem;
    position: absolute;
    top: 1.55rem;
    width: 1.45rem;
}

.floating-field input {
    border: 0;
    font-size: 1.05rem;
    height: 100%;
    outline: none;
    padding: 1rem 1rem .75rem 3.8rem;
    width: 100%;
}

.login-submit {
    align-items: center;
    background: linear-gradient(90deg, #35b9ad, #85d7ce);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 22px rgba(51, 183, 170, .28);
    color: #fff;
    display: inline-flex;
    font-size: 1.15rem;
    font-weight: 800;
    gap: .8rem;
    height: 56px;
    justify-content: center;
    margin-top: .1rem;
    width: 100%;
}

.login-submit.mud-button-root {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end));
    color: #fff;
}

.login-submit:disabled,
.login-cancel:disabled,
.login-links button:disabled {
    opacity: .65;
}

.login-submit .app-icon {
    height: 2rem;
    width: 2rem;
}

.login-cancel {
    background: transparent;
    border: 0;
    color: #138f87;
    display: block;
    font-size: 1rem;
    font-weight: 800;
    margin: 1.5rem auto 1.7rem;
}

.login-cancel.mud-button-root {
    color: var(--app-primary-strong);
}

.login-links {
    border-top: 1px solid #dde2e0;
    display: grid;
    gap: .5rem;
    padding-top: 1.35rem;
}

.login-links,
.login-links a,
.login-links button {
    color: #24b8ad;
    font-size: 1rem;
    text-decoration: none;
}

.login-links a {
    font-weight: 800;
}

.login-links button {
    background: transparent;
    border: 0;
}

.login-links .login-link-button {
    color: var(--app-primary);
    font-size: 1rem;
    font-weight: 800;
    padding: 0 .15rem;
    text-transform: none;
    vertical-align: baseline;
}

.auth-action-modal {
    display: grid;
    gap: 1rem;
    text-align: center;
}

.auth-action-icon {
    color: var(--app-primary);
    height: 3rem;
    justify-self: center;
    width: 3rem;
}

.compact-alert {
    font-size: .9rem;
    margin: .75rem 0;
    padding: .5rem .75rem;
    text-align: left;
}

.authorization-panel {
    align-items: center;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    display: grid;
    gap: .75rem;
    justify-items: center;
    margin: 2rem auto;
    max-width: 560px;
    padding: 2rem;
    text-align: center;
}

.authorization-panel .app-icon {
    color: var(--app-primary);
    height: 3rem;
    width: 3rem;
}

.authorization-panel h1 {
    margin: 0;
}

.authorization-panel p {
    color: var(--app-muted);
    margin: 0 0 .5rem;
}

.authorization-denied {
    box-shadow: 0 12px 30px rgba(0,0,0,.08);
}

.app-modal-backdrop {
    align-items: center;
    background: rgba(21, 29, 40, .58);
    display: flex;
    inset: 0;
    justify-content: center;
    overflow: auto;
    padding: 1.5rem;
    position: fixed;
    z-index: 1600;
}

.app-modal {
    background: #f7f9fb;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    width: min(100%, 860px);
}

.app-modal-sm {
    width: min(100%, 520px);
}

.app-modal-md {
    width: min(100%, 760px);
}

.app-modal-lg {
    width: min(100%, 960px);
}

.app-modal-login {
    width: min(100%, 520px);
}

.app-modal-header {
    align-items: center;
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 54px;
    padding: .65rem 1.25rem;
}

.app-modal-heading {
    display: grid;
    gap: .1rem;
}

.app-modal-header h2 {
    font-size: 1.28rem;
    font-weight: 800;
    margin: 0;
}

.app-modal-heading span {
    font-size: .88rem;
    font-weight: 600;
    opacity: .88;
}

.app-modal-close {
    background: transparent;
    border: 0;
    color: #fff;
    height: 36px;
    width: 36px;
}

.app-modal-close .app-icon {
    height: 1.55rem;
    width: 1.55rem;
}

.app-modal-body {
    max-height: calc(100vh - 240px);
    overflow: auto;
    padding: 1.55rem;
}

.app-modal-login .app-modal-body {
    padding: 0;
}

.app-modal-footer {
    align-items: center;
    background: #fff;
    border-top: 1px solid var(--app-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.25rem 1.75rem;
}

.swal2-popup {
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 16px;
    color: var(--app-text);
    font-family: inherit;
}

.swal2-title {
    color: var(--app-text);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.swal2-html-container,
.swal2-content {
    color: var(--app-muted);
}

.swal2-confirm {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end)) !important;
    border-radius: 999px !important;
    box-shadow: 0 10px 20px rgba(49, 64, 84, .18) !important;
    font-weight: 800 !important;
    padding: .7rem 1.45rem !important;
}

.swal2-cancel {
    background: #fff !important;
    border: 1px solid var(--app-border) !important;
    border-radius: 999px !important;
    color: var(--app-text) !important;
    font-weight: 800 !important;
    padding: .7rem 1.45rem !important;
}
/* ===================================================== */
/* SWEETALERT SOBRE MUDDIALOG                            */
/* ===================================================== */
.swal2-container {
    z-index: 10000 !important;
}

.confirm-message {
    color: var(--app-text);
    font-size: 1.05rem;
    margin: 0;
}

.idle-warning-content {
    align-items: center;
    display: grid;
    gap: .75rem;
    justify-items: center;
    text-align: center;
}

.idle-warning-content .app-icon {
    color: var(--app-primary);
    height: 3rem;
    width: 3rem;
}

.idle-warning-content p {
    margin: 0;
}

.menu-admin-page {
    margin: 0 auto;
    max-width: 100%;
}

.user-admin-page {
    margin: 0 auto;
    max-width: 100%;
}

.user-title-band {
    font-size: 1rem;
    text-align: center;
}

.user-filter-title {
    align-items: center;
    color: var(--app-text);
    display: flex;
    gap: .45rem;
    justify-content: center;
    padding: 1.8rem 1rem 1rem;
}

.reference-panel > .mud-icon-button-root {
    margin-left: .75rem;
}

.user-filter-grid {
    display: grid;
    gap: 1.25rem 1.5rem;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    padding: 1rem;
}

.user-filter-actions {
    justify-content: flex-start;
}

.user-admin-table {
    min-width: 1360px;
}

.user-admin-table td {
    font-size: .95rem;
}

.compact-switch {
    font-size: .88rem;
    gap: .35rem;
}

.compact-switch span {
    height: 16px;
    width: 42px;
}

.compact-switch span::after {
    height: 22px;
    left: 20px;
    top: -3px;
    width: 22px;
}

.compact-switch input:not(:checked) + span::after {
    left: 0;
}

.role-assignment-summary {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.role-assignment-summary > div {
    display: grid;
    gap: .15rem;
}

.reference-panel {
    background: #fff;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.16);
    overflow: hidden;
}

.reference-panel-header,
.section-title-band {
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
}

.reference-panel-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    min-height: 76px;
    padding: 1rem 1.5rem;
}

.reference-panel-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
}

.section-title-band {
    border-radius: 8px 8px 0 0;
    font-size: 1.55rem;
    font-weight: 800;
    margin-top: 1.25rem;
    padding: .35rem .75rem;
}

.menu-filter-grid {
    display: grid;
    gap: 1rem 1.25rem;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) minmax(150px, .9fr) minmax(150px, .9fr) minmax(180px, .9fr);
    padding: 1.6rem 1rem .8rem;
}

.line-field {
    color: #20242a;
    display: grid;
    gap: .25rem;
}

.line-field.full {
    grid-column: 1 / -1;
}

.line-field span {
    font-size: 1rem;
}

.line-field input,
.line-field select {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #c8ced6;
    color: #23272d;
    font-size: 1.25rem;
    min-height: 44px;
    outline: none;
    padding: .25rem 0;
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    padding: 0 1rem 1.35rem;
}

.pill-button {
    align-items: center;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    gap: .7rem;
    justify-content: center;
    min-height: 44px;
    padding: .65rem 1.55rem;
}

.pill-button .app-icon {
    height: 1.35rem;
    width: 1.35rem;
}

.pill-button-light {
    background: var(--theme-soft-action);
    color: #fff;
}

.pill-button-outline {
    background: #fff;
    border: 1px solid #708198;
    color: #405067;
}

.pill-button-muted,
.pill-button-primary {
    box-shadow: 0 10px 20px rgba(49, 64, 84, .18);
    color: #fff;
}

.pill-button-muted {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end));
}

.pill-button-primary {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end));
}

.pill-button-danger {
    background: linear-gradient(90deg, var(--theme-danger-start), var(--theme-danger-end));
    color: #fff;
}

.menu-grid-card {
    background: #fff;
    border: 1px solid #e1e6eb;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    padding: 1rem;
}

.grid-search {
    align-items: center;
    border-bottom: 1px solid #d4d8dd;
    display: flex;
    gap: .9rem;
    margin: .25rem .35rem 1rem;
    padding: .5rem 0 .75rem;
}

.grid-search .app-icon {
    color: #4c4f53;
    height: 2rem;
    width: 2rem;
}

.grid-search input {
    border: 0;
    color: var(--app-text);
    font-size: 1.35rem;
    outline: none;
    width: 100%;
}

.grid-search input::placeholder {
    color: #a4a7ab;
}

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

.menu-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1120px;
    width: 100%;
}

.menu-table th {
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
    font-size: 1.05rem;
    padding: 1rem;
    text-align: left;
}

.menu-table th:first-child {
    border-top-left-radius: 16px;
}

.menu-table th:last-child {
    border-top-right-radius: 16px;
}

.menu-table td {
    border-bottom: 1px solid #e2e5e8;
    border-right: 1px solid #e2e5e8;
    padding: .95rem 1rem;
    vertical-align: middle;
}

.menu-table tr:nth-child(even) td {
    background: #fbfbfc;
}

.app-data-grid {
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
}

.app-data-grid .mud-table-container {
    overflow-x: auto;
}

.app-data-grid .mud-table-head .mud-table-cell {
    background: linear-gradient(90deg, var(--theme-band-start), var(--theme-band-end));
    color: #fff;
    font-weight: 800;
}

.app-data-grid .mud-table-row:nth-child(even) .mud-table-cell {
    background: #fbfbfc;
}

.app-data-grid .mud-table-pagination-toolbar {
    border-top: 1px solid #e2e5e8;
}

.table-pager {
    align-items: center;
    border-top: 1px solid #e2e5e8;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .9rem .35rem 0;
}

.table-pager-summary {
    color: #52606d;
    font-size: .92rem;
}

.table-pager-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    justify-content: flex-end;
}

.table-pager-controls label {
    align-items: center;
    color: #52606d;
    display: inline-flex;
    gap: .45rem;
}

.table-pager-controls select {
    background: #fff;
    border: 1px solid #cdd6df;
    border-radius: 999px;
    color: var(--app-text);
    min-width: 72px;
    padding: .35rem .65rem;
}

.table-pager-button {
    background: #fff;
    border: 1px solid var(--theme-band-start);
    border-radius: 999px;
    color: var(--theme-band-start);
    font-weight: 700;
    min-height: 34px;
    padding: .35rem .8rem;
}

.table-pager-button:disabled {
    border-color: #c8d0d8;
    color: #98a2ad;
    cursor: not-allowed;
    opacity: .7;
}

.table-pager-page {
    color: #52606d;
    font-weight: 700;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    min-width: 190px;
}

.action-pill {
    align-items: center;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(49,64,84,.16);
    color: #fff;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    min-width: 74px;
}

.action-pill .app-icon {
    height: 1.35rem;
    width: 1.35rem;
}

.action-muted {
    background: linear-gradient(90deg, var(--theme-action-start), var(--theme-action-end));
}

.action-success {
    background: var(--theme-success);
}

.action-disabled {
    background: #9aa3ad;
}

.hierarchy-cell {
    font-weight: 600;
}

.status-chip {
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .85rem;
    font-weight: 800;
    padding: .35rem .8rem;
}

.status-active {
    background: var(--theme-success);
}

.status-inactive {
    background: #8d98a5;
}

.status-pending {
    background: var(--theme-warning);
}

.status-warning {
    background: #d68b2f;
}

.usage-chip {
    border: 1px solid rgba(13, 123, 111, .22);
    border-radius: 14px;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.35;
    max-width: 26rem;
    padding: .45rem .7rem;
    white-space: normal;
}

.usage-normal {
    background: rgba(32, 181, 164, .12);
    color: var(--theme-sidebar);
}

.usage-warning {
    background: rgba(214, 139, 47, .16);
    border-color: rgba(214, 139, 47, .36);
    color: #8a520f;
}

.usage-danger {
    background: rgba(190, 49, 68, .14);
    border-color: rgba(190, 49, 68, .36);
    color: #a32435;
}

.admin-data-table th {
    color: var(--theme-sidebar);
    font-weight: 800;
}

.compact-filter-actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}

.modal-form-grid {
    display: grid;
    gap: 1.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.menu-editor-form {
    padding-top: .25rem;
}

.logo-uploader {
    align-items: center;
    border: 1px solid rgba(63, 78, 96, .16);
    border-radius: 12px;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.logo-preview {
    align-items: center;
    background: rgba(63, 78, 96, .06);
    border: 1px dashed rgba(63, 78, 96, .28);
    border-radius: 12px;
    color: var(--app-muted);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    height: 128px;
    justify-content: center;
    min-width: 128px;
    overflow: hidden;
    width: 128px;
}

.logo-preview img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.logo-preview .mud-icon-root {
    color: var(--app-primary);
    font-size: 2.6rem;
}

.farm-photo-preview img {
    object-fit: cover;
}

.photo-form-thumb {
    border-radius: 8px;
    display: block;
    height: 120px;
    object-fit: cover;
    width: 120px;
}

.photo-thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.photo-thumb-wrap {
    position: relative;
}

.photo-thumb-remove {
    background: rgba(0,0,0,.55);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: .7rem;
    height: 20px;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 4px;
    top: 4px;
    width: 20px;
}

.photo-thumb-remove:hover {
    background: rgba(200,30,30,.8);
}

.farm-table-photo {
    align-items: center;
    background: rgba(63, 78, 96, .08);
    border-radius: 8px;
    color: var(--app-muted);
    display: inline-flex;
    height: 44px;
    justify-content: center;
    object-fit: cover;
    overflow: hidden;
    width: 58px;
}

.farm-table-photo-empty .mud-icon-root {
    color: var(--app-primary);
    font-size: 1.4rem;
}

.farm-map-page {
    max-width: 1280px;
}

.farm-map-title {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.farm-map-title-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.detail-info-grid {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.detail-info-item {
    background: rgba(18, 153, 139, .06);
    border: 1px solid rgba(18, 153, 139, .14);
    border-radius: 8px;
    display: grid;
    gap: .15rem;
    padding: .7rem 1rem;
}

.detail-info-item .muted {
    font-size: .78rem;
}

.farm-detail-hero {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(180px, 260px) 1fr;
}

.farm-detail-photo {
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    box-shadow: var(--app-shadow);
    height: 100%;
    max-height: 190px;
    object-fit: cover;
    width: 100%;
}

.farm-detail-photo-empty {
    align-items: center;
    background: rgba(18, 153, 139, .08);
    border: 1px dashed rgba(18, 153, 139, .35);
    color: var(--app-primary);
    display: flex;
    justify-content: center;
}

.farm-detail-photo-empty .mud-icon-root {
    font-size: 3rem;
}

.farm-detail-summary {
    align-content: center;
    display: grid;
    gap: .55rem;
}

.farm-detail-summary h2 {
    font-size: 1.8rem;
    margin: 0;
}

.farm-detail-summary p {
    margin: 0;
}

@media (max-width: 760px) {
    .farm-detail-hero {
        grid-template-columns: 1fr;
    }
}

.farm-map-summary {
    display: grid;
    gap: .8rem;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.farm-map-summary > div {
    background: rgba(18, 153, 139, .08);
    border: 1px solid rgba(18, 153, 139, .18);
    border-radius: 8px;
    display: grid;
    gap: .15rem;
    padding: .8rem 1rem;
}

.farm-map-summary strong {
    color: var(--app-text);
    font-size: 1.05rem;
}

.farm-map-shell {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
    margin-top: 1rem;
    overflow: hidden;
    position: relative;   /* necesario para posicionar el banner flotante */
}

/* ── Banner flotante de guardar/cancelar edición del mapa ── */
.map-edit-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(18, 153, 139, 0.97);
    backdrop-filter: blur(4px);
    color: #fff;
    border-top: 2px solid rgba(255,255,255,.25);
    box-shadow: 0 -4px 16px rgba(0,0,0,.18);
}
.map-edit-banner-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}
.map-edit-banner-icon { opacity: .85; font-size: 18px !important; }
.map-edit-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.map-edit-banner .pill-button-muted {
    background: rgba(255,255,255,.15) !important;
    border-color: rgba(255,255,255,.4) !important;
    color: #fff !important;
}
.map-edit-banner .pill-button-muted:hover { background: rgba(255,255,255,.25) !important; }
.map-edit-banner .pill-button-primary {
    background: #fff !important;
    border-color: #fff !important;
    color: #12998b !important;
    font-weight: 700;
}
.map-edit-banner .pill-button-primary:hover { background: #f0faf9 !important; }

.farm-map-canvas {
    height: min(74vh, 820px);
    min-height: 560px;
    width: 100%;
}

.farm-map-tools-grid {
    display: grid;
    gap: .85rem;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    margin-top: .9rem;
}

.farm-map-tool-card {
    background: rgba(255,255,255,.8);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    padding: .9rem 1rem;
}

.farm-map-tool-card h3 {
    color: var(--app-text);
    font-size: 1rem;
    font-weight: 900;
    margin: 0 0 .65rem;
}

.farm-map-modal-tools {
    margin-top: 0;
}

.farm-map-inline-form {
    align-items: center;
    display: grid;
    gap: .6rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

.coordinate-editor summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
}

.coordinate-editor-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.coordinate-editor-heading span {
    color: var(--app-text);
    font-weight: 900;
}

.coordinate-editor-heading small {
    color: var(--app-muted);
    font-size: .78rem;
}

.coordinate-editor summary::-webkit-details-marker {
    display: none;
}

.coordinate-editor summary span {
    color: var(--app-text);
    font-weight: 900;
}

.coordinate-editor summary small {
    color: var(--app-muted);
    font-size: .78rem;
}

.coordinate-grid {
    display: grid;
    gap: .35rem;
    margin-top: .7rem;
    max-height: 260px;
    overflow: auto;
    padding-right: .25rem;
}

.coordinate-row {
    align-items: center;
    display: grid;
    gap: .55rem;
    grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 40px;
}

.coordinate-row > span {
    align-items: center;
    background: rgba(18, 153, 139, .12);
    border-radius: 999px;
    color: var(--app-primary);
    display: flex;
    font-weight: 900;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-draw-toolbar a {
    color: var(--app-primary);
}

.map-toolbar {
    align-items: center;
    margin-top: .9rem;
}

.map-layer-select {
    min-width: 220px;
}

.map-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1rem;
    margin-top: .85rem;
}

.map-legend span {
    align-items: center;
    color: var(--app-muted);
    display: inline-flex;
    font-size: .9rem;
    gap: .4rem;
}

.map-legend i {
    border-radius: 999px;
    display: inline-block;
    height: 12px;
    width: 12px;
}

.farm-animal-marker span {
    align-items: center;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0,0,0,.28);
    color: #fff;
    display: flex;
    font-size: .78rem;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.farm-animal-cluster-fallback span {
    align-items: center;
    background: linear-gradient(135deg, var(--app-primary), var(--app-accent));
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 5px 14px rgba(0,0,0,.32);
    color: #fff;
    display: flex;
    font-size: .92rem;
    font-weight: 900;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.farm-reference-marker span {
    background: #e53935;
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(229, 57, 53, .22), 0 4px 12px rgba(0,0,0,.3);
    display: block;
    height: 24px;
    width: 24px;
}
/* Indicador visual de que el marcador es arrastrable */
.farm-reference-marker-draggable { cursor: grab !important; }
.farm-reference-marker-draggable:active { cursor: grabbing !important; }

.farm-paddock-point-marker { cursor: grab !important; }
.farm-paddock-point-marker:active { cursor: grabbing !important; }
.farm-paddock-point-marker span {
    background: #1976d2;
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 5px rgba(25, 118, 210, .18), 0 4px 12px rgba(0,0,0,.26);
    display: block;
    height: 24px;
    width: 24px;
}

.farm-map-popup-list {
    margin: .35rem 0 0;
    max-height: 180px;
    overflow: auto;
    padding-left: 1rem;
}

.farm-map-popup-actions {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-top: .5rem;
}

.farm-map-animal-link {
    color: var(--app-primary-strong, #129989);
    font-size: .82rem;
    text-decoration: underline;
    cursor: pointer;
}

.farm-map-move-link {
    color: #e67e00;
}

.movement-modal-grid {
    display: grid;
    gap: .75rem 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-animal-picker {
    background: rgba(18, 153, 139, .06);
    border: 1px solid rgba(18, 153, 139, .18);
    border-radius: 8px;
    display: grid;
    gap: .75rem;
    margin-top: .9rem;
    padding: .85rem;
}

.batch-animal-picker-header {
    align-items: center;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
}

.batch-animal-picker-header > div:first-child {
    display: grid;
    gap: .15rem;
}

.batch-animal-picker-header strong {
    color: var(--app-text);
    font-size: .98rem;
    font-weight: 900;
}

.batch-animal-picker-header span {
    color: var(--app-muted);
    font-size: .84rem;
}

.batch-animal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.batch-animal-action {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(18, 153, 139, .35);
    border-radius: 999px;
    color: var(--app-primary-strong, #0f766e);
    cursor: pointer;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    gap: .35rem;
    min-height: 34px;
    padding: .35rem .75rem;
}

.batch-animal-list {
    display: grid;
    gap: .5rem;
    max-height: 310px;
    overflow: auto;
    padding-right: .25rem;
}

.batch-animal-row {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(64, 80, 103, .12);
    border-radius: 8px;
    cursor: pointer;
    display: grid;
    gap: .55rem;
    grid-template-columns: auto 42px minmax(0, 1fr) minmax(120px, auto);
    padding: .55rem .7rem;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.batch-animal-row.selected {
    border-color: rgba(18, 153, 139, .55);
    box-shadow: 0 8px 18px rgba(18, 153, 139, .12);
}

.batch-animal-avatar {
    align-items: center;
    background: linear-gradient(135deg, var(--theme-action-start), var(--theme-action-end));
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: .78rem;
    font-weight: 900;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.batch-animal-main {
    display: grid;
    gap: .1rem;
    min-width: 0;
}

.batch-animal-main strong {
    color: var(--app-text);
    font-size: .92rem;
    font-weight: 900;
}

.batch-animal-main span,
.batch-animal-details {
    color: var(--app-muted);
    font-size: .82rem;
}

.batch-animal-details {
    text-align: right;
}

.map-paddock-save-strip {
    align-items: center;
    background: rgba(18, 153, 139, .08);
    border: 1px solid rgba(18, 153, 139, .18);
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: .85rem 0 1rem;
    padding: .8rem 1rem;
}

.map-paddock-save-strip > div {
    display: grid;
    gap: .2rem;
}

.map-paddock-save-strip strong {
    color: var(--app-text);
    font-weight: 900;
}

.map-paddock-save-strip span {
    color: var(--app-muted);
    font-size: .88rem;
}

.file-pill {
    align-items: center;
    background: var(--app-primary);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: .55rem;
    min-height: 42px;
    padding: .55rem 1rem;
}

.file-pill input[type="file"] {
    display: none;
}

.pill-button input[type="file"] {
    display: none;
}

.summary-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.summary-card {
    background: color-mix(in srgb, var(--app-primary) 10%, #fff 90%);
    border: 1px solid color-mix(in srgb, var(--app-primary) 24%, transparent);
    border-radius: 8px;
    display: grid;
    gap: .2rem;
    padding: .8rem 1rem;
}

.summary-card span {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 700;
}

.summary-card strong {
    color: var(--app-text);
    font-size: 1.1rem;
}

.switch-field {
    align-items: center;
    color: #303a48;
    display: flex;
    font-size: 1.2rem;
    gap: .7rem;
}

.switch-field input {
    display: none;
}

.switch-field span {
    background: #93d4ab;
    border-radius: 999px;
    display: inline-block;
    height: 24px;
    position: relative;
    width: 58px;
}

.switch-field span::after {
    background: #18a956;
    border-radius: 50%;
    box-shadow: 0 5px 10px rgba(0,0,0,.18);
    content: "";
    height: 32px;
    left: 26px;
    position: absolute;
    top: -4px;
    transition: left .16s ease;
    width: 32px;
}

.switch-field input:not(:checked) + span {
    background: #c4cbd3;
}

.switch-field input:not(:checked) + span::after {
    background: #778391;
    left: 0;
}

.switch-button {
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.switch-button[aria-pressed="false"] span {
    background: #c4cbd3;
}

.switch-button[aria-pressed="false"] span::after {
    background: #778391;
    left: 0;
}

.app-data-grid .inactive-data-row td {
    background: #f4f6f7 !important;
    color: #74808b;
}

.app-data-grid .inactive-data-row .action-pill,
.app-data-grid .inactive-data-row .switch-button,
.app-data-grid .inactive-data-row .status-chip {
    filter: grayscale(.25);
    opacity: .72;
}

.pill-button-compact {
    font-size: .8rem;
    padding: .2rem .7rem;
}

.modal-panel-sm {
    max-width: 400px;
}

.animal-search-selected-icon {
    color: green;
    font-size: 14px;
    margin-left: 4px;
}

.user-agent-cell {
    max-width: 280px;
}

.alert-dismissed-toggle {
    font-size: .72rem;
    padding: 2px 10px;
}

.alert-card-icon-symbol {
    font-size: 22px;
}

.menu-indent-level-0 { padding-left: 0; }
.menu-indent-level-1 { padding-left: 28px; }
.menu-indent-level-2 { padding-left: 56px; }
.menu-indent-level-3 { padding-left: 84px; }
.menu-indent-level-4 { padding-left: 112px; }
.menu-indent-level-5 { padding-left: 140px; }
.menu-indent-level-6 { padding-left: 168px; }

.map-color-farm { background: #e53935; }
.map-color-available { background: #2a9d8f; }
.map-color-in-use { background: #fb8500; }
.map-color-high-occupancy { background: #ffb703; }
.map-color-overloaded { background: #d90429; }
.map-color-resting { background: #8d99ae; }
.map-color-maintenance { background: #6c757d; }
.map-color-animal-approx { background: #ffb300; }

.rfid-overlay {
    align-items: center;
    background: rgba(0,0,0,.45);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 16px;
    position: fixed;
    z-index: 1400;
}

.rfid-modal {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 12px;
    max-width: 540px;
    overflow: hidden;
    width: 100%;
}

.rfid-header {
    align-items: center;
    background: var(--mud-palette-background-grey);
    border-bottom: 1px solid var(--mud-palette-table-lines);
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
}

.rfid-header-left {
    align-items: center;
    color: var(--mud-palette-text-primary);
    display: flex;
    font-size: .9rem;
    font-weight: 600;
    gap: 10px;
}

.rfid-close {
    align-items: center;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    display: flex;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.rfid-close:hover {
    background: var(--mud-palette-background-grey);
}

.rfid-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.rfid-search-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.rfid-input-wrap {
    align-items: center;
    background: var(--mud-palette-background-grey);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 8px;
    display: flex;
    flex: 1;
    gap: 8px;
    padding: 9px 12px;
}

.rfid-input-wrap:focus-within {
    border-color: var(--mud-palette-primary);
}

.rfid-input {
    background: transparent;
    border: none;
    color: var(--mud-palette-text-primary);
    flex: 1;
    font-size: .9rem;
    outline: none;
}

.rfid-clear {
    background: none;
    border: none;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
    display: flex;
    padding: 0;
}

.rfid-result {
    align-items: center;
    background: var(--mud-palette-background-grey);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 8px;
    display: flex;
    gap: 14px;
    padding: 14px;
}

.rfid-result-avatar {
    align-items: center;
    background: var(--mud-palette-primary);
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 700;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.rfid-result-body {
    flex: 1;
    min-width: 0;
}

.rfid-result-code {
    color: var(--mud-palette-text-primary);
    font-size: .95rem;
    font-weight: 600;
}

.rfid-result-name {
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

.rfid-result-meta {
    color: var(--mud-palette-text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: .78rem;
    gap: 6px;
    margin-top: 3px;
}

.rfid-result-meta span::after {
    content: '·';
    margin-left: 6px;
}

.rfid-result-meta span:last-child::after {
    content: '';
}

.rfid-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rfid-open-btn {
    align-items: center;
    background: var(--mud-palette-primary);
    border-radius: 8px;
    color: #fff;
    display: flex;
    flex-shrink: 0;
    font-size: .82rem;
    font-weight: 600;
    gap: 5px;
    padding: 8px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.rfid-open-btn:hover {
    opacity: .9;
}

.rfid-hint {
    align-items: center;
    color: var(--mud-palette-text-secondary);
    display: flex;
    font-size: .75rem;
    gap: 6px;
}

.rfid-icon-primary {
    color: var(--mud-palette-primary);
    font-size: 20px;
}

.rfid-icon-close,
.rfid-icon-muted {
    color: var(--mud-palette-text-secondary);
    font-size: 18px;
}

.rfid-icon-small,
.rfid-icon-hint {
    color: var(--mud-palette-text-secondary);
    font-size: 14px;
}

.rfid-icon-open {
    font-size: 16px;
}

kbd {
    background: var(--mud-palette-table-lines);
    border-radius: 3px;
    font-family: monospace;
    font-size: .78rem;
    padding: 1px 5px;
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        bottom: 0;
        flex: none;
        left: 0;
        margin-left: 0;
        max-width: calc(100vw - 64px);
        min-height: 100dvh;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-100%);
        transition: transform .22s ease;
        width: 280px;
        z-index: 1000;
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar:not(.sidebar-open) {
        margin-left: 0;
    }

    .sidebar-backdrop {
        background: rgba(15, 23, 42, .42);
        bottom: 0;
        display: block;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 990;
    }

    .sidebar-close {
        align-items: center;
        background: rgba(0,0,0,.35);
        border: 0;
        border-radius: 50%;
        color: #fff;
        display: inline-flex;
        height: 32px;
        justify-content: center;
        position: absolute;
        right: 6px;
        top: 6px;
        width: 32px;
        z-index: 2;
    }

    .brand-block {
        overflow: hidden;
    }

    .main-panel {
        min-height: 100vh;
        width: 100%;
    }

    .app-topbar {
        gap: .5rem;
        padding: .5rem .65rem;
        z-index: 60;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .topbar-context span {
        display: none;
    }

    .user-summary {
        display: none;
    }

    .session-timer {
        font-size: .85rem;
        min-height: 32px;
        padding: .25rem .55rem;
    }

    .menu-filter-grid,
    .user-filter-grid,
    .modal-form-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions,
    .app-modal-footer,
    .logo-uploader {
        align-items: stretch;
        flex-direction: column;
    }

    .logo-preview {
        width: 100%;
    }

    .farm-map-title {
        align-items: stretch;
        flex-direction: column;
    }

    .farm-map-summary {
        grid-template-columns: 1fr;
    }

    .farm-map-tools-grid,
    .farm-map-inline-form,
    .movement-modal-grid,
    .coordinate-row {
        grid-template-columns: 1fr;
    }

    .map-paddock-save-strip {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-animal-picker-header,
    .batch-animal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .batch-animal-row {
        grid-template-columns: auto 38px minmax(0, 1fr);
    }

    .batch-animal-details {
        grid-column: 3;
        text-align: left;
    }

    .coordinate-editor summary {
        align-items: flex-start;
        flex-direction: column;
        gap: .2rem;
    }

    .farm-map-canvas {
        height: 66vh;
        min-height: 430px;
    }

    .pill-button {
        width: 100%;
    }

    .app-modal-backdrop {
        align-items: flex-start;
        padding: .75rem;
    }

    .app-modal {
        max-height: calc(100vh - 1.5rem);
    }

    .app-modal-body {
        max-height: calc(100vh - 250px);
        padding: 1.25rem;
    }
}

.mud-snackbar-container {
    z-index: 10050 !important;
}

.mud-snackbar-info {
    background-color: #32b4a8 !important;
    color: white !important;
}

.mud-snackbar-success {
    background-color: #2aa894 !important;
    color: white !important;
}

.mud-snackbar-warning {
    background-color: #f4b942 !important;
    color: black !important;
}

.mud-snackbar-error {
    background-color: #e45757 !important;
    color: white !important;
}

/* Farm map group badge (fallback clustering) */
.farm-map-group-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1976d2;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    cursor: pointer;
}

.farm-map-group-badge-unknown {
    background: #9e9e9e;
}

.onboarding-shell {
    margin: 0 auto;
    max-width: 1120px;
    padding: 1.25rem;
}

.onboarding-hero {
    align-items: center;
    background: linear-gradient(120deg, var(--app-primary), var(--app-accent, #32c9b6));
    border-radius: 8px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    padding: 1.4rem 1.6rem;
}

.onboarding-hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 .35rem;
}

.onboarding-hero p {
    margin: 0;
    opacity: .92;
}

.onboarding-eyebrow {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: .35rem;
    text-transform: uppercase;
}

.onboarding-hero-icon {
    font-size: 4rem !important;
    opacity: .9;
}

.onboarding-progress {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin: 1rem 0;
}

.onboarding-progress span {
    align-items: center;
    background: #dbe8e5;
    border-radius: 50%;
    color: #46625c;
    display: inline-flex;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.onboarding-progress span.active {
    background: var(--app-primary);
    color: #fff;
}

.onboarding-card {
    padding: 1.2rem;
}

.onboarding-card h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 1rem;
}

.onboarding-choice-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.onboarding-choice {
    background: #fff;
    border: 1px solid rgba(14, 117, 101, .22);
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-height: 170px;
    padding: 1rem;
    text-align: left;
}

.onboarding-choice:hover {
    border-color: var(--app-primary);
    box-shadow: 0 10px 28px rgba(15, 118, 110, .12);
    transform: translateY(-1px);
}

.onboarding-choice .mud-icon-root {
    color: var(--app-primary);
    font-size: 2rem;
}

.onboarding-choice span {
    color: var(--mud-palette-text-secondary);
    font-size: .9rem;
}

.onboarding-actions {
    align-items: center;
    border-top: 1px solid rgba(15, 23, 42, .1);
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
}

.onboarding-summary {
    background: rgba(42, 180, 168, .08);
    border: 1px solid rgba(42, 180, 168, .22);
    border-radius: 8px;
    display: grid;
    gap: .6rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

@media (max-width: 860px) {
    .onboarding-choice-grid {
        grid-template-columns: 1fr;
    }

    .onboarding-hero {
        align-items: flex-start;
        flex-direction: column;
        gap: .75rem;
    }

    .onboarding-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Extracted Razor component styles */

/* Extracted from FincaOS.Web\Pages\Admin\Roles.razor */
.roles-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}
@media (max-width: 900px) {
    .roles-layout { grid-template-columns: 1fr; }
}

/* -- Sidebar -- */
.roles-sidebar {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-table-lines);
    border-radius: 10px;
    overflow: hidden;
    position: sticky;
    top: 12px;
}
.roles-sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mud-palette-table-lines);
    background: var(--mud-palette-background-grey);
}
.roles-sidebar-title { font-size: .78rem; font-weight: 600; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.roles-sidebar-count { font-size: .72rem; background: var(--mud-palette-table-lines); color: var(--mud-palette-text-secondary); padding: 2px 8px; border-radius: 20px; font-weight: 600; }

.roles-list { overflow-y: auto; max-height: calc(100vh - 280px); }
.role-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--mud-palette-table-lines); transition: background .1s; }
.role-item:last-child { border-bottom: none; }
.role-item:hover { background: var(--mud-palette-background-grey); }
.role-item-active { background: var(--mud-palette-background-grey) !important; border-left: 3px solid var(--mud-palette-primary); }
.role-item-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--mud-palette-table-lines); color: var(--mud-palette-text-secondary); display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; flex-shrink: 0; }
.role-avatar-active { background: var(--mud-palette-primary) !important; color: #fff !important; }
.role-item-body { flex: 1; min-width: 0; }
.role-item-name { font-size: .88rem; font-weight: 600; color: var(--mud-palette-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-item-desc { font-size: .75rem; color: var(--mud-palette-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.role-item-badge { display: inline-block; margin-top: 3px; background: #E1F5EE; color: #085041; font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 10px; }

/* -- Content -- */
.roles-content { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-table-lines); border-radius: 10px; overflow: hidden; }
.roles-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; color: var(--mud-palette-text-secondary); font-size: .9rem; text-align: center; }

.role-detail-header { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--mud-palette-table-lines); }
.role-detail-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--mud-palette-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; flex-shrink: 0; }
.role-detail-name { font-size: 1rem; font-weight: 600; color: var(--mud-palette-text-primary); }
.role-detail-desc { font-size: .8rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
.role-detail-stats { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.stat-pill { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.stat-pill-primary { background: #E1F5EE; color: #085041; }
.stat-pill-muted { background: var(--mud-palette-background-grey); color: var(--mud-palette-text-secondary); }

.roles-warning { display: flex; align-items: flex-start; gap: 8px; margin: 12px 20px 0; padding: 10px 12px; background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 6px; font-size: .82rem; color: #854F0B; }

/* -- Save bar -- */
.roles-save-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--mud-palette-table-lines); background: var(--mud-palette-background-grey); }
.save-hint { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--mud-palette-text-secondary); font-style: italic; }

/* -- Usuarios -- */
.role-users-section { padding: 16px 20px; border-top: 1px solid var(--mud-palette-table-lines); }
.role-users-title { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.role-users-count { background: var(--mud-palette-table-lines); color: var(--mud-palette-text-secondary); font-size: .7rem; padding: 1px 6px; border-radius: 10px; }
.role-users-list { display: flex; flex-direction: column; gap: 6px; }
.role-user-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--mud-palette-table-lines); border-radius: 8px; background: var(--mud-palette-background-grey); }
.role-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: #E1F5EE; color: #085041; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; flex-shrink: 0; }
.role-user-body { flex: 1; min-width: 0; }
.role-user-name { font-size: .85rem; font-weight: 600; color: var(--mud-palette-text-primary); }
.role-user-email { font-size: .75rem; color: var(--mud-palette-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-user-status { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.status-active { background: #EAF3DE; color: #3B6D11; }
.status-inactive { background: var(--mud-palette-background-grey); color: var(--mud-palette-text-secondary); }

/* -- Modales -- */
.roles-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1300; padding: 16px; }
.roles-modal { background: var(--mud-palette-surface); border-radius: 12px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--mud-palette-table-lines); }
.roles-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 16px; border-bottom: 1px solid var(--mud-palette-table-lines); }
.roles-modal-header-left { display: flex; align-items: center; gap: 12px; }
.roles-modal-icon { width: 34px; height: 34px; background: #E1F5EE; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.roles-modal-title { font-size: 15px; font-weight: 600; color: var(--mud-palette-text-primary); }
.roles-modal-sub { font-size: 12px; color: var(--mud-palette-text-secondary); margin-top: 1px; }
.roles-modal-close { width: 28px; height: 28px; border: none; background: none; cursor: pointer; border-radius: 6px; color: var(--mud-palette-text-secondary); display: flex; align-items: center; justify-content: center; }
.roles-modal-close:hover { background: var(--mud-palette-background-grey); }
.roles-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.roles-modal-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--mud-palette-table-lines); background: var(--mud-palette-background-grey); }
.roles-btn-cancel { padding: 8px 16px; border: 1px solid var(--mud-palette-table-lines); border-radius: 8px; background: var(--mud-palette-surface); font-size: 13px; color: var(--mud-palette-text-secondary); cursor: pointer; }
.roles-btn-cancel:hover { background: var(--mud-palette-background-grey); }

.roles-form-group { display: flex; flex-direction: column; gap: 5px; }
.roles-form-label { font-size: 11px; font-weight: 600; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.roles-form-input { padding: 9px 11px; border: 1px solid var(--mud-palette-table-lines); border-radius: 8px; font-size: 13px; color: var(--mud-palette-text-primary); background: var(--mud-palette-surface); outline: none; }
.roles-form-input:focus { border-color: var(--mud-palette-primary); }

/* -- Secci�n de men�s inline -- */
.menu-section { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--mud-palette-table-lines); }
.menu-hint { font-size: .85rem; color: var(--mud-palette-text-secondary); padding: 8px 0; }

/* -- Pasos de men�s -- */
.menu-step { display: flex; flex-direction: column; gap: 10px; }
.menu-step-label { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .07em; }
.menu-step-num { width: 22px; height: 22px; border-radius: 50%; background: var(--mud-palette-primary); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
/* -- Selector de tipo de aplicación (Web / Móvil) en pantalla de Roles -- */
.app-type-selector { display: flex; gap: 6px; padding-bottom: 4px; }
.app-type-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 20px; border: 1.5px solid var(--mud-palette-table-lines); background: var(--mud-palette-surface); font-size: 13px; font-weight: 500; color: var(--mud-palette-text-secondary); cursor: pointer; transition: all .12s; }
.app-type-btn:hover { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.app-type-btn-active { background: var(--mud-palette-primary) !important; border-color: var(--mud-palette-primary) !important; color: #fff !important; font-weight: 700; }
.app-type-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 12px; background: #e3f2fd; color: #1565c0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-left: 4px; }

.menu-parent-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.menu-parent-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--mud-palette-table-lines); background: var(--mud-palette-surface); font-size: 13px; color: var(--mud-palette-text-secondary); cursor: pointer; transition: all .12s; white-space: nowrap; }
.menu-parent-pill:hover { border-color: var(--mud-palette-primary); color: var(--mud-palette-primary); }
.menu-parent-pill-active { background: var(--mud-palette-primary) !important; border-color: var(--mud-palette-primary) !important; color: #fff !important; font-weight: 600; }
.menu-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mud-palette-table-lines); flex-shrink: 0; }
.menu-parent-pill-active .menu-pill-dot { background: rgba(255,255,255,.55); }
.menu-pill-badge { background: rgba(255,255,255,.25); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: 2px; }
.menu-parent-pill:not(.menu-parent-pill-active) .menu-pill-badge { background: var(--mud-palette-primary); color: #fff; }
.menu-divider { height: 1px; background: var(--mud-palette-table-lines); margin: 4px 0; }
.menu-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .menu-two-col { grid-template-columns: 1fr; } }
.menu-col-box { border: 1px solid var(--mud-palette-table-lines); border-radius: 8px; overflow: hidden; }
.menu-col-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; background: var(--mud-palette-background-grey); border-bottom: 1px solid var(--mud-palette-table-lines); }
.menu-col-title { font-size: 11px; font-weight: 700; color: var(--mud-palette-text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.menu-col-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; min-width: 24px; text-align: center; }
.menu-badge-avail { background: var(--mud-palette-background-grey); color: var(--mud-palette-text-secondary); border: 1px solid var(--mud-palette-table-lines); }
.menu-badge-sel { background: var(--mud-palette-primary); color: #fff; border: none; }
.menu-list-body { min-height: 180px; max-height: 240px; overflow-y: auto; }
.menu-list-body::-webkit-scrollbar { width: 4px; }
.menu-list-body::-webkit-scrollbar-thumb { background: var(--mud-palette-table-lines); border-radius: 4px; }
.menu-list-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; border-bottom: 1px solid var(--mud-palette-table-lines); transition: background .1s; }
.menu-list-item:last-child { border-bottom: none; }
.menu-list-item:hover { background: var(--mud-palette-background-grey); }
.menu-list-item-assigned { background: var(--mud-palette-surface); }
.menu-item-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mud-palette-text-primary); }
.menu-add-btn { width: 27px; height: 27px; border-radius: 7px; border: 1px solid var(--mud-palette-table-lines); background: var(--mud-palette-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--mud-palette-primary); flex-shrink: 0; transition: all .12s; }
.menu-add-btn:hover { background: var(--mud-palette-primary); border-color: var(--mud-palette-primary); color: #fff; }
.menu-rem-btn { width: 27px; height: 27px; border-radius: 7px; border: 1px solid var(--mud-palette-table-lines); background: var(--mud-palette-surface); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--mud-palette-text-secondary); flex-shrink: 0; transition: all .12s; }
.menu-rem-btn:hover { background: #FCEBEB; border-color: #F09595; color: #A32D2D; }
.menu-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; color: var(--mud-palette-text-secondary); font-size: 12px; min-height: 180px; }
.menu-summary-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--mud-palette-background-grey); border: 1px solid var(--mud-palette-table-lines); border-radius: 8px; font-size: 13px; color: var(--mud-palette-primary); }
.menu-footer-hint { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--mud-palette-text-secondary); }

/* Extracted from FincaOS.Web\Pages\Home.razor */
.dashboard-kpi-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .kpi-card {
        background: var(--mud-palette-surface);
        border-radius: 10px;
        padding: 16px 12px;
        text-align: center;
        border-left: 4px solid transparent;
        box-shadow: 0 1px 4px rgba(0,0,0,.08);
        transition: transform .15s;
    }

    .kpi-card:hover { transform: translateY(-2px); }

    .kpi-primary  { border-left-color: var(--mud-palette-primary); }
    .kpi-success  { border-left-color: var(--mud-palette-success); }
    .kpi-info     { border-left-color: var(--mud-palette-info); }
    .kpi-secondary { border-left-color: var(--mud-palette-secondary); }
    .kpi-warning  { border-left-color: var(--mud-palette-warning); }
    .kpi-danger   { border-left-color: var(--mud-palette-error); }
    .kpi-neutral  { border-left-color: #ccc; }

    .kpi-icon { font-size: 1.4rem; margin-bottom: 6px; opacity: .7; }
    .kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
    .kpi-label { font-size: .75rem; color: var(--mud-palette-text-secondary); margin-top: 4px; }

    .dashboard-two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .dashboard-three-col {
        display: grid;
        grid-template-columns: 1.25fr 1fr 1fr;
        gap: 12px;
    }

    @media (max-width: 768px) {
        .dashboard-two-col { grid-template-columns: 1fr; }
        .dashboard-three-col { grid-template-columns: 1fr; }
        .dashboard-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    }

    .dashboard-chart {
        display: block;
        width: 100%;
        height: 260px;
        min-height: 260px;
    }

    .dashboard-bar-list { display: flex; flex-direction: column; gap: 8px; }

    .bar-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
    .bar-label { width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
    .bar-track { flex: 1; height: 10px; background: #e9ecef; border-radius: 5px; overflow: hidden; }
    .bar-fill { height: 100%; background: var(--mud-palette-primary); border-radius: 5px; transition: width .4s ease; min-width: 4px; }
    .bar-fill-green { background: var(--mud-palette-success); }
    .bar-count { width: 32px; text-align: right; font-weight: 600; flex-shrink: 0; }

    .row-warning td { background: rgba(255,193,7,.08); }
    .row-danger  td { background: rgba(220,53,69,.08); }

    /* -- Alertas operativas -- */
    .alert-grid { display: flex; flex-direction: column; gap: 8px; }
    .alert-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 8px; border-left: 4px solid; }
    .alert-card-critical { background: rgba(244,67,54,.07); border-left-color: #f44336; color: var(--mud-palette-text-primary); }
    .alert-card-warning  { background: rgba(255,152,0,.07);  border-left-color: #ff9800; color: var(--mud-palette-text-primary); }
    .alert-card-info     { background: rgba(33,150,243,.07); border-left-color: #2196f3; color: var(--mud-palette-text-primary); }
    .alert-card-icon { flex-shrink: 0; }
    .alert-card-critical .alert-card-icon { color: #f44336; }
    .alert-card-warning  .alert-card-icon { color: #ff9800; }
    .alert-card-info     .alert-card-icon { color: #2196f3; }
    .alert-card-body { flex: 1; min-width: 0; }
    .alert-card-title { font-size: .87rem; font-weight: 600; }
    .alert-card-msg { font-size: .78rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
    .alert-card-link { padding: 6px 12px; border-radius: 6px; font-size: .78rem; font-weight: 600; background: var(--mud-palette-background-grey); color: var(--mud-palette-text-secondary); text-decoration: none; white-space: nowrap; flex-shrink: 0; border: 1px solid var(--mud-palette-table-lines); }
    .alert-card-link:hover { background: var(--mud-palette-table-lines); }
    .alert-counter { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: 6px; }
    .alert-counter-critical { background: #f44336; color: #fff; }
    .alert-counter-warning  { background: #ff9800; color: #fff; }
    .alert-card-dismissed { opacity: .45; }
    .alert-card-dismiss { margin-left: 4px; background: none; border: none; cursor: pointer; color: var(--mud-palette-text-secondary); font-size: 1rem; line-height: 1; padding: 4px 8px; border-radius: 4px; flex-shrink: 0; }
    .alert-card-dismiss:hover { background: rgba(0,0,0,.07); }
    .alert-card-dismiss-menu { flex-shrink: 0; }

/* Extracted from FincaOS.Web\Pages\Sales\Sales.razor */
.modal-backdrop-custom {
        position: fixed; inset: 0;
        background: rgba(0,0,0,.45);
        display: flex; align-items: center; justify-content: center;
        z-index: 1000;
    }
    .modal-panel-custom {
        background: var(--mud-palette-surface);
        border-radius: var(--border-radius-lg);
        max-width: 680px; width: 95%;
        max-height: 90vh; overflow-y: auto;
        box-shadow: 0 8px 32px rgba(0,0,0,.2);
    }
    .modal-header-custom {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 0.5px solid var(--mud-palette-divider);
        font-size: 1rem;
    }
    .modal-body-custom { padding: 16px; }
    .modal-footer-custom {
        display: flex; justify-content: flex-end; gap: 8px;
        padding: 12px 16px;
        border-top: 0.5px solid var(--mud-palette-divider);
    }
    .animal-search-results {
        border: 0.5px solid var(--mud-palette-divider);
        border-radius: var(--border-radius-md);
        max-height: 180px; overflow-y: auto;
        margin-top: 4px;
    }
    .animal-search-item {
        padding: 6px 10px; cursor: pointer; font-size: .85rem;
        border-bottom: 0.5px solid var(--mud-palette-divider);
    }
    .animal-search-item:hover { background: var(--mud-palette-action-hover); }
    .animal-search-item.selected { background: var(--mud-palette-primary-lighten); }
    .selected-animal-row {
        display: flex; align-items: center; gap: 8px;
        padding: 4px 0; font-size: .85rem;
    }
    .price-input { max-width: 100px; }

/* Extracted from FincaOS.Web\Components\AppBreadcrumb.razor */
.app-breadcrumb {
        align-items: center;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin: 4px 0 10px;
        color: var(--mud-palette-text-secondary);
        font-size: .8rem;
    }

    .app-breadcrumb a {
        color: var(--mud-palette-primary);
        font-weight: 700;
        text-decoration: none;
    }

    .app-breadcrumb .current {
        color: var(--mud-palette-text-primary);
        font-weight: 800;
    }

/* Extracted from FincaOS.Web\Pages\Animals\AnimalDetail.razor */
.quick-actions-bar {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        background: var(--mud-palette-surface);
        border-radius: 8px;
        padding: 10px 14px;
        box-shadow: 0 1px 3px rgba(0,0,0,.06);
    }

    .animal-detail-header {
        display: flex;
        gap: 16px;
        align-items: flex-start;
        background: var(--mud-palette-surface);
        border-radius: 10px;
        padding: 16px;
        box-shadow: 0 1px 4px rgba(0,0,0,.08);
        margin-top: 12px;
    }

    .animal-thumb-lg {
        width: 90px;
        height: 90px;
        border-radius: 50%;
        object-fit: cover;
        border: 3px solid var(--mud-palette-primary);
        flex-shrink: 0;
    }

    .animal-thumb-placeholder-lg {
        width: 90px;
        height: 90px;
        border-radius: 50%;
        background: #f0f0f0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .animal-detail-info { flex: 1; }
    .animal-detail-actions { flex-shrink: 0; }

    .animal-badges { display: flex; flex-wrap: wrap; gap: 6px; }

    .badge-tag {
        background: var(--mud-palette-primary-lighten);
        color: var(--mud-palette-primary-darken);
        border-radius: 12px;
        padding: 2px 10px;
        font-size: .75rem;
        font-weight: 500;
    }

    .badge-success { background: #d1fae5; color: #065f46; }
    .badge-info    { background: #dbeafe; color: #1e40af; }
    .badge-warning { background: #fef3c7; color: #92400e; }
    .badge-danger  { background: #fee2e2; color: #991b1b; }
    .badge-secondary { background: #f3f4f6; color: #374151; }

    .animal-detail-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        font-size: .85rem;
    }

    .detail-section-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    .detail-field {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .detail-field label {
        font-size: .72rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--mud-palette-text-secondary);
    }

    .detail-field span { font-size: .9rem; }
    .detail-field-full { grid-column: 1 / -1; }

    .detail-pager {
        align-items: center;
        border-top: 1px solid var(--mud-palette-table-lines);
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 6px 2px;
        font-size: .78rem;
        color: var(--mud-palette-text-secondary);
    }

    .detail-pager > div {
        display: flex;
        gap: 8px;
    }

    @media (max-width: 600px) {
        .animal-detail-header { flex-direction: column; }
        .detail-section-grid { grid-template-columns: 1fr 1fr; }
        .detail-pager {
            align-items: flex-start;
            flex-direction: column;
        }
    }

    /* -- Fotos -- */
    .animal-photo-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
    .animal-photo-card {
        position: relative;
        border-radius: 8px;
        overflow: hidden;
        border: 2px solid var(--mud-palette-table-lines);
        background: var(--mud-palette-background-grey);
    }
    .animal-photo-card.photo-main { border-color: var(--mud-palette-primary); }
    .animal-photo-thumb {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        display: block;
    }
    .photo-main-badge {
        position: absolute;
        top: 6px;
        left: 6px;
        background: var(--mud-palette-primary);
        color: #fff;
        font-size: .65rem;
        font-weight: 700;
        padding: 2px 7px;
        border-radius: 10px;
        text-transform: uppercase;
    }
    .photo-desc {
        padding: 6px 8px;
        font-size: .75rem;
        color: var(--mud-palette-text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .offspring-card-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }

    .offspring-card {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
        padding: 10px;
        border: 1px solid var(--mud-palette-table-lines);
        border-radius: 8px;
        background: var(--mud-palette-surface);
    }

    .offspring-card-photo {
        width: 92px;
        height: 92px;
        border-radius: 8px;
        object-fit: cover;
        background: var(--mud-palette-background-grey);
        border: 1px solid var(--mud-palette-table-lines);
    }

    .offspring-card-photo-empty {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--mud-palette-primary);
    }

    .offspring-card-body {
        min-width: 0;
        display: grid;
        gap: 5px;
    }

    .offspring-card-title {
        font-size: .95rem;
        font-weight: 800;
    }

    .offspring-card-title a {
        color: var(--mud-palette-primary);
        text-decoration: none;
    }

    .offspring-card-name {
        font-size: .82rem;
        color: var(--mud-palette-text-secondary);
    }

    .offspring-card-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 10px;
        font-size: .76rem;
        color: var(--mud-palette-text-secondary);
    }

    .offspring-photo-strip {
        display: flex;
        gap: 6px;
        overflow: hidden;
    }

    .offspring-photo-strip img {
        width: 42px;
        height: 42px;
        border-radius: 6px;
        object-fit: cover;
        border: 1px solid var(--mud-palette-table-lines);
        flex: 0 0 auto;
    }

    .offspring-card-empty-text {
        font-size: .74rem;
        color: var(--mud-palette-text-secondary);
    }

    /* -- Timeline -- */
    .timeline-wrap { padding: 0 4px; }
    .timeline-list { display: flex; flex-direction: column; gap: 0; }
    .timeline-item {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        position: relative;
        padding-bottom: 18px;
    }
    .timeline-item::before {
        content: '';
        position: absolute;
        left: 17px;
        top: 32px;
        bottom: 0;
        width: 2px;
        background: var(--mud-palette-table-lines);
    }
    .timeline-item:last-child::before { display: none; }
    .timeline-dot {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,.15);
    }
    .timeline-body {
        background: var(--mud-palette-surface);
        border: 1px solid var(--mud-palette-table-lines);
        border-radius: 8px;
        padding: 10px 14px;
        flex: 1;
    }
    .timeline-title { font-size: .88rem; font-weight: 600; color: var(--mud-palette-text-primary); }
    .timeline-detail { font-size: .8rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
    .timeline-date { font-size: .72rem; color: var(--mud-palette-text-secondary); margin-top: 4px; font-style: italic; }


/* Shared classes for Razor style cleanup */
.animal-photo-list-thumb {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 56px;
    object-fit: cover;
    width: 72px;
}

.animal-photo-preview {
    border-radius: 8px;
    max-height: 220px;
    max-width: 100%;
    object-fit: contain;
}

.action-icon-sm {
    font-size: 1rem;
}

.page-size-select {
    width: 120px;
}

.quick-lookup-search {
    flex: 1;
}

.animal-detail-empty-icon {
    font-size: 3rem;
    opacity: .35;
}

.dashboard-kpi-grid-compact {
    margin-bottom: 18px;
}

.badge-xs {
    font-size: .7rem;
    padding: 2px 8px;
}

.timeline-dot-icon {
    color: #fff;
    font-size: 1.1rem;
}

.timeline-dot-birth { background: #4caf50; }
.timeline-dot-purchase { background: #2196f3; }
.timeline-dot-sale { background: #ff9800; }
.timeline-dot-death { background: #f44336; }
.timeline-dot-movement { background: #9c27b0; }
.timeline-dot-treatment { background: #e91e63; }
.timeline-dot-weight { background: #607d8b; }
.timeline-dot-milk { background: #00bcd4; }
.timeline-dot-breeding { background: #c2185b; }
.timeline-dot-birth-event { background: #388e3c; }

.bar-w-0 { width: 0%; }
.bar-w-5 { width: 5%; }
.bar-w-10 { width: 10%; }
.bar-w-15 { width: 15%; }
.bar-w-20 { width: 20%; }
.bar-w-25 { width: 25%; }
.bar-w-30 { width: 30%; }
.bar-w-35 { width: 35%; }
.bar-w-40 { width: 40%; }
.bar-w-45 { width: 45%; }
.bar-w-50 { width: 50%; }
.bar-w-55 { width: 55%; }
.bar-w-60 { width: 60%; }
.bar-w-65 { width: 65%; }
.bar-w-70 { width: 70%; }
.bar-w-75 { width: 75%; }
.bar-w-80 { width: 80%; }
.bar-w-85 { width: 85%; }
.bar-w-90 { width: 90%; }
.bar-w-95 { width: 95%; }
.bar-w-100 { width: 100%; }
