﻿:root {
    --brand: #0b6338;
    --brand-dark: #064c2b;
    --brand-soft: #e8f4ee;
    --brand-hover: #084f2d;
    --accent: #8fc7a3;
    --accent-soft: #e8f4ee;
    --text: #132033;
    --muted: #667085;
    --bg: #f4f8f5;
    --surface: #ffffff;
    --surface-soft: #f8fbf9;
    --border: #dce8df;
    --danger: #dc2626;
    --danger-soft: #fff4f4;
    --warning: #d97706;
    --warning-soft: #fff7ed;
    --success: #15803d;
    --success-soft: #e8f4ee;
    --secondary: #9ca3af;
    --secondary-soft: #f2f4f7;
    --shadow: 0 14px 34px rgba(15, 23, 42, .10);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, .07);
    --topbar-height: 56px;
    --sidebar-width: 210px;
    --radius: 16px;
    --radius-lg: 22px;
    --scroll-thumb: rgba(11, 99, 56, .45);
    --scroll-thumb-hover: rgba(11, 99, 56, .75);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: .75rem 1rem;
    background: var(--brand);
    color: white;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(11, 99, 56, .16);
}

    .btn:hover {
        background: var(--brand-dark);
    }

.btn-secondary,
.secondary-btn {
    background: #fff;
    color: var(--brand-dark);
    border: 1px solid var(--border);
    box-shadow: none;
    font-weight: 600;
}

    .btn-secondary:hover,
    .secondary-btn:hover {
        background: var(--surface-soft);
    }

.danger-btn {
    background: var(--danger);
    box-shadow: 0 8px 18px rgba(220, 38, 38, .16);
}

    .danger-btn:hover {
        background: #b91c1c;
    }

.link-btn {
    border: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem;
    background: #fff;
    color: var(--text);
    outline: none;
}

    .input:focus {
        border-color: var(--brand);
        box-shadow: 0 0 0 3px rgba(11, 99, 56, .14);
    }

.muted {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    border-radius: 999px;
    padding: .25rem .65rem;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 600;
    font-size: .8rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

    .table th,
    .table td {
        padding: .85rem;
        border-bottom: 1px solid var(--border);
        text-align: left;
    }

    .table th {
        background: var(--surface-soft);
        color: #42526e;
        font-size: .82rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .table td {
        font-weight: 400;
    }

.alert {
    border-radius: 14px;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.alert-success,
.success-alert {
    background: var(--success-soft);
    color: var(--brand-dark);
    border: 1px solid rgba(6, 76, 43, .12);
}

.warning-alert {
    background: var(--warning-soft);
    color: #9a3412;
    border: 1px solid rgba(154, 52, 18, .14);
}

.validation-message {
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(220, 38, 38, .15);
    background: var(--danger-soft);
    color: #b42318;
    font-size: .95rem;
    font-weight: 400;
}

    .validation-message ul {
        margin: .25rem 0 0 1rem;
        padding: 0;
    }

.field-error {
    display: block;
    margin-top: .4rem;
    color: #b42318;
    font-size: .88rem;
    font-weight: 400;
}

    .field-error.field-validation-valid {
        display: none;
        margin-top: 0;
    }

    .field-error.field-validation-error {
        display: block;
    }

/*---------------------*/
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--scroll-thumb-hover);
    }
/*Para Firefox*/
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 99, 56, .55) transparent;
}
/* Mejoras de tablas y listados */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-head h1 {
    margin: 0;
    color: var(--brand-dark);
    font-size: clamp(1.45rem, 2vw, 2rem);
    line-height: 1.1;
}

.page-head p { margin: .35rem 0 0; }
.page-actions { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: flex-end; }

.filters,
.admin-toolbar {
    margin: 1rem 0 1rem 0;
}

.filter-row,
.admin-toolbar {
    display: flex;
    gap: .65rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-row .input,
.admin-toolbar .input {
    flex: 1 1 260px;
}

.compact-input {
    max-width: 110px;
}

.section-tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .15rem 0 .8rem;
    margin-bottom: .85rem;
    scrollbar-width: thin;
}

.section-tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

    .section-tabs a.active {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

    .section-tabs a:hover {
        background: #2f8f5b;
        color: #fff;
        border-color: #2f8f5b;
    }

    .section-tabs a.active:hover {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

.nav-filter-check {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.section-tabs .filter-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 38px;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.section-tabs .filter-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand);
    cursor: pointer;
}

.section-tabs .filter-check:hover {
    background: #f3fbf6;
    border-color: #9fd4b5;
    color: #236b44;
}

.section-tabs .filter-check.active {
    background: #eaf7ef;
    border-color: #2f8f5b;
    color: #236b44;
}

.section-tabs .filter-check.active:hover {
    background: #dff2e7;
    border-color: #2f8f5b;
    color: #236b44;
}

.table-card,
.user-list-card {
    padding: 0;
    overflow: hidden;
}

.list-summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: .85rem 1rem;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.desktop-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 760px;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.interactive-table tbody tr,
.admin-users-table tbody tr {
    transition: background .16s;
}

.interactive-table tbody tr:hover,
.admin-users-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--surface-soft);
}

.row-link {
    color: var(--brand-dark);
    font-weight: 800;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-muted {
    background: var(--secondary-soft);
    color: #667085;
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .25rem .6rem;
    font-weight: 700;
    font-size: .82rem;
    background: var(--secondary-soft);
    color: var(--muted);
}

.dot {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: var(--secondary);
}

.dot-success, .success .dot, .status-chip.success { background: var(--success-soft); color: var(--success); }
.dot-warning, .warning .dot, .status-chip.warning { background: var(--warning); }
.dot-danger, .danger .dot, .status-chip.danger { background: var(--danger); }
.dot-secondary, .secondary .dot, .status-chip.secondary { background: var(--secondary); }
.status-chip.success .dot, .dot-success { background: var(--success); }
.status-chip.warning .dot { background: var(--warning); }
.status-chip.danger .dot { background: var(--danger); }
.status-chip.secondary .dot { background: var(--secondary); }

.pager {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}

.btn.disabled,
.btn[aria-disabled="true"] {
    pointer-events: none;
    opacity: .45;
}

.mobile-cards {
    display: none;
    padding: 1rem;
    gap: .85rem;
}

.mobile-list-card,
.mobile-user-card {
    display: grid;
    gap: .35rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: .95rem;
    box-shadow: var(--shadow-soft);
}

.mobile-card-head {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
}

.mobile-card-head h3,
.mobile-list-card h3 {
    margin: 0;
    font-size: 1.08rem;
    color: var(--brand-dark);
}

.mobile-card-head h3 a,
.mobile-list-card h3 a {
    color: inherit;
}

.mobile-card-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem .75rem;
    color: var(--text);
    font-size: .94rem;
}

.mobile-card-fields span {
    min-width: 0;
}

.mobile-card-actions {
    margin-top: .45rem;
}

.mobile-card-actions .icon-btn {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-cards > .card:not(.mobile-list-card) {
    display: grid;
    gap: .4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: .95rem;
    box-shadow: var(--shadow-soft);
}

.mobile-cards > .card:not(.mobile-list-card) h3 {
    margin: 0;
    font-size: 1.08rem;
    color: var(--brand-dark);
}

.row-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.row-actions form { margin: 0; }

.btn-icon {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .42rem .65rem;
    background: #fff;
    color: var(--brand-dark);
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.btn-icon:hover { background: var(--brand-soft); }
.btn-icon.danger { color: var(--danger); }
.btn-icon.danger:hover { background: var(--danger-soft); }

.admin-create-card {
    margin-bottom: 1rem;
}

.admin-create-card h2 {
    margin: 0 0 .25rem;
    color: var(--brand-dark);
    font-size: 1.22rem;
}

.user-create-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: .9rem;
    margin-top: 1rem;
    align-items: end;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--text);
    font-weight: 700;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
}

.auth-label {
    display: inline-flex;
    margin-bottom: .35rem;
    color: var(--muted);
    font-weight: 700;
}

.count-text {
    font-size: 1rem;
    font-weight: 600;
}

@media (max-width: 760px) {
    .page-head {
        display: grid;
    }

    .page-actions,
    .pager {
        justify-content: stretch;
    }

    .page-actions .btn,
    .pager .btn,
    .filter-row .btn,
    .admin-toolbar .btn {
        flex: 1 1 auto;
    }

    .filter-row,
    .admin-toolbar {
        align-items: stretch;
    }

    .search-input-wrap,
    .filter-row .input,
    .admin-toolbar .input {
        flex-basis: 100%;
        min-width: 0;
        max-width: none;
    }

    .filter-row .btn,
    .admin-toolbar .btn,
    .pager .btn {
        min-height: 44px;
        justify-content: center;
    }

    .desktop-table { display: none; }
    .mobile-cards { display: grid; }
    .table-card { padding: 0; }
    .user-create-grid { grid-template-columns: 1fr; }
    .compact-input { max-width: none; }

    .mobile-card-head {
        align-items: flex-start;
    }

    .mobile-card-fields {
        grid-template-columns: 1fr;
    }

    .mobile-card-actions {
        width: auto;
    }

    .mobile-card-actions form {
        width: auto;
        margin: 0;
    }

    .mobile-card-actions .icon-btn {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}


/* Ajustes solicitados: leyendas, estados y vistas operativas */
.legend-card { display:flex; gap: .7rem 1rem; flex-wrap:wrap; align-items:center; padding:.75rem 1rem; box-shadow:var(--shadow-soft); }
.legend-item { display:inline-flex; align-items:center; gap:.35rem; color:var(--text); font-weight:600; white-space:nowrap; }
.status-chip { min-width: 118px; justify-content:center; }
.status-chip.success { background: #e8f4ee; color: #0b6338; }
.status-chip.warning { background: #fff7ed; color: #b45309; }
.status-chip.danger { background: #fff4f4; color: #dc2626; }
.status-chip.secondary { background: #f2f4f7; color: #667085; }
.status-chip.info { background: #eef4ff; color: #3563a7; }
.form-grid { display:grid; grid-template-columns: repeat(4, minmax(180px,1fr)); gap:.9rem; align-items:end; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-4 { grid-column: 1 / -1; }
.field label { display:block; font-weight:700; color:var(--muted); margin-bottom:.3rem; }
.calendar-card { padding: .75rem; }
#calendar { min-height: 720px; }
.fc-event { cursor:pointer; font-weight:700; }
.calendar-toolbar-note { margin-bottom:.75rem; display:flex; gap:.5rem; flex-wrap:wrap; }
.repo-shell { min-height: calc(100vh - 190px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow:hidden; background:white; }
.repo-placeholder { padding:1.25rem; color:var(--muted); }
.profile-edit { margin: 1rem 0; }
.horse-photo-box { display:grid; place-items:center; width:98px; height:98px; border-radius:24px; background:var(--brand-soft); color:var(--brand); font-size:2rem; }
@media (max-width: 900px) { .form-grid { grid-template-columns:1fr; } .form-grid .span-2,.form-grid .span-4 { grid-column:auto; } }

.repo-security-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.repo-upload-form {
    margin: 0;
    justify-content: flex-end;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.table-actions form {
    margin: 0;
}

.icon-btn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 780px) {
    .repo-security-card {
        align-items: stretch;
        flex-direction: column;
    }
    .repo-upload-form {
        justify-content: stretch;
    }
}

/* Repaso final UI/UX: claridad, lectura y acciones por rol */
:focus-visible {
    outline: 3px solid rgba(11, 99, 56, .28);
    outline-offset: 2px;
}

.btn, .secondary-btn, .danger-btn, .btn-icon, .icon-btn {
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease;
}

.btn:hover, .secondary-btn:hover, .btn-icon:hover, .icon-btn:hover {
    transform: translateY(-1px);
}

.btn:active, .secondary-btn:active, .btn-icon:active, .icon-btn:active {
    transform: translateY(0);
}

.page-head {
    align-items: center;
    padding-bottom: .35rem;
}

.page-head h1 {
    letter-spacing: -.02em;
}

.page-actions .btn, .filter-row .btn {
    min-height: 42px;
}

.help-text {
    display: block;
    margin-top: .28rem;
    color: var(--muted);
    font-size: .86rem;
}

.form-card {
    margin-bottom: 1rem;
}

.form-card-title {
    margin: 0 0 .85rem;
    color: var(--brand-dark);
    font-size: 1.1rem;
    font-weight: 800;
}

.form-actions {
    display: flex;
    gap: .65rem;
    align-items: center;
    justify-content: flex-end;
}

.read-only-note,
.ux-note {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin-bottom: 1rem;
    border-color: rgba(11, 99, 56, .14);
    background: linear-gradient(180deg, #ffffff, var(--brand-soft));
    color: var(--brand-dark);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.read-only-note i,
.ux-note i {
    margin-top: .12rem;
    color: var(--brand);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 2rem;
    color: var(--muted);
    text-align: center;
}

.empty-state i {
    color: var(--brand);
    font-size: 2rem;
    margin-bottom: .6rem;
}

.empty-state h3 {
    margin: 0 0 .25rem;
    color: var(--brand-dark);
}

.legend-card {
    border: 1px solid var(--border);
    background: rgba(255,255,255,.94);
}

.legend-item {
    min-height: 30px;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--surface-soft);
}

.dot-calendar-done { background: var(--success); }
.dot-calendar-incident { background: var(--danger); }
.dot-calendar-task { background: #6b7280; }
.dot-calendar-standby { background: var(--warning); }

.table td,
.table th {
    vertical-align: middle;
}

.table tbody tr {
    scroll-margin-top: calc(var(--topbar-height) + 12px);
}

.table-actions {
    justify-content: flex-end;
}

.status-chip {
    white-space: nowrap;
}

.filters .input::placeholder {
    color: #7b8794;
}

.swal2-popup {
    border-radius: 18px !important;
}

@media (max-width: 760px) {
    .form-actions {
        justify-content: stretch;
        flex-direction: column;
    }
    .form-actions .btn,
    .form-actions .secondary-btn {
        width: 100%;
    }
    .read-only-note,
    .ux-note {
        align-items: flex-start;
    }
}

/* UI/UX final: validación visual, formularios y selectores grandes */
.input.input-validation-error,
.input.is-invalid,
select.input.input-validation-error,
textarea.input.input-validation-error,
input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error {
    border-color: var(--danger) !important;
    background: var(--danger-soft) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12) !important;
}

.field:has(.input-validation-error) label,
.field:has(.is-invalid) label {
    color: var(--danger);
    font-weight: 700;
}

.input-action-row .select-search-input {
    margin-bottom: 0;
}


.select-search-input {
    margin-bottom: .45rem;
    background: var(--surface-soft);
}

.quick-create-box {
    margin-top: 1rem;
    border: 1px dashed var(--border);
    border-radius: 16px;
    padding: .85rem 1rem;
    background: var(--surface-soft);
}

.quick-create-box summary {
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 700;
}

.quick-create-grid { margin-top: .8rem; }
.born-fields[hidden] { display: none !important; }

.action-toggle-card { margin-bottom: 1rem; }
.action-toggle-card > summary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-weight: 800;
    color: var(--brand-dark);
}

.icon-btn { width: 38px; height: 38px; padding: 0; }
.table-actions { display: flex; gap: .4rem; align-items: center; }
.table-actions form { margin: 0; }

.horse-profile-card {
    display: grid;
    grid-template-columns: minmax(160px, 240px) 1fr;
    gap: 1.25rem;
    align-items: start;
}

.horse-photo-panel {
    display: grid;
    gap: .75rem;
    justify-items: center;
}

.horse-photo-large {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    object-fit: cover;
    background: var(--brand-soft);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    color: var(--brand-dark);
    font-size: 3rem;
    overflow: hidden;
}

.horse-photo-large img { width: 100%; height: 100%; object-fit: cover; }

.status-legend, .legend-card {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .8rem 1rem;
    box-shadow: var(--shadow-soft);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    padding: .35rem .7rem;
    font-weight: 700;
    font-size: .86rem;
}

.dot { width: .65rem; height: .65rem; border-radius: 999px; display: inline-block; }
.dot-success { background: var(--success); }
.dot-danger { background: var(--danger); }
.dot-warning { background: var(--warning); }
.dot-secondary { background: var(--secondary); }
.dot-info { background: var(--brand); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .9rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-soft);
}
.metric-card span { color: var(--muted); font-size: .86rem; font-weight: 700; }
.metric-card strong { display: block; margin-top: .25rem; font-size: 1.45rem; color: var(--brand-dark); }

.account-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
}
.account-avatar {
    width: 72px; height: 72px; border-radius: 24px;
    display: grid; place-items: center;
    background: var(--brand-soft); color: var(--brand-dark);
    font-size: 2rem;
}

.account-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

    .account-hero h1 {
        margin: 0;
        color: var(--brand-dark);
        font-size: 1.8rem;
        line-height: 1.1;
    }

    .account-hero p {
        margin: .45rem 0 0;
    }

.account-avatar {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 2rem;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.account-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
}

.account-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

    .account-card-header h2 {
        margin: 0;
        color: var(--brand-dark);
        font-size: 1.45rem;
        line-height: 1.15;
    }

    .account-card-header p {
        margin: .45rem 0 0;
    }

.account-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin: 0;
}

.account-detail-item {
    display: grid;
    gap: .25rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

    .account-detail-item dt {
        display: flex;
        align-items: center;
        gap: .45rem;
        color: var(--muted);
        font-size: .9rem;
        font-weight: 700;
    }

        .account-detail-item dt i {
            width: 1rem;
            color: var(--brand);
        }

    .account-detail-item dd {
        margin: 0;
        color: var(--text);
        font-size: 1.05rem;
        font-weight: 800;
        word-break: break-word;
    }

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    flex: 0 0 auto;
    border-radius: 999px;
    padding: .42rem .8rem;
    font-size: .86rem;
    font-weight: 800;
    white-space: nowrap;
}

    .status-badge.enabled {
        background: var(--success-soft);
        color: var(--success);
        border: 1px solid rgba(21, 128, 61, .18);
    }

    .status-badge.disabled {
        background: var(--secondary-soft);
        color: var(--muted);
        border: 1px solid var(--border);
    }

.two-factor-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.two-factor-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.45rem;
}

.two-factor-text h3 {
    margin: 0 0 .25rem;
    color: var(--brand-dark);
    font-size: 1.1rem;
}

.two-factor-text p {
    margin: 0;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: auto;
}

    .account-actions form {
        margin: 0;
    }

    .account-actions .btn {
        gap: .45rem;
        min-height: 42px;
    }

.account-warning {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 0;
}

.compact-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    white-space: nowrap;
}

    .compact-actions form {
        margin: 0;
    }

    .compact-actions .icon-btn {
        width: 2.15rem;
        height: 2.15rem;
        min-width: 2.15rem;
        padding: 0;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: #fff;
        color: var(--brand-dark);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: none;
        cursor: pointer;
    }

        .compact-actions .icon-btn:hover {
            background: var(--brand-soft);
            border-color: rgba(11, 99, 56, .25);
        }

        .compact-actions .icon-btn.danger {
            color: var(--danger);
        }

            .compact-actions .icon-btn.danger:hover {
                background: var(--danger-soft);
                border-color: rgba(220, 38, 38, .22);
            }

.admin-users-table th:last-child,
.admin-users-table td:last-child {
    width: 1%;
    text-align: right;
}

.margin-start-soft {
    margin-left: 0.5rem;
}

.form-layout {
    display: grid;
    gap: 1rem;
}

.form-section {
    padding: 1.25rem;
}

    .form-section h2 {
        margin: 0 0 1rem;
        color: var(--brand-dark);
        font-size: 1.15rem;
        font-weight: 800;
    }

.form-grid.two {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 1rem;
    align-items: end;
}

.field {
    min-width: 0;
}

    .field label {
        display: block;
        margin-bottom: .35rem;
        color: var(--muted);
        font-weight: 700;
    }

.switch-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.switch-row {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 700;
    color: var(--text);
}

textarea.input {
    min-height: 110px;
    resize: vertical;
}


.form-subtitle {
    margin: 1rem 0 .75rem;
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 800;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: .5rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow-soft);
}

.input-action-row {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 42px;
    gap: .5rem;
    align-items: center;
}

    .input-action-row .input {
        min-width: 0;
    }

    .input-action-row .btn-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0;
        border-radius: 12px;
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .input-action-row .btn-icon:hover {
            background: var(--brand-dark);
        }

.quick-add-btn {
    height: 42px;
    width: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    line-height: 1;
}

    .quick-add-btn i {
        line-height: 1;
    }
/*-----------------------------------------------------------------------*/

@media (max-width: 900px) {
    .account-grid {
        grid-template-columns: 1fr;
    }
    .form-grid.two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .horse-profile-card {
        grid-template-columns: 1fr;
    }

    .horse-photo-large {
        max-width: 260px;
    }
}

@media (max-width: 760px) {
    .input-action-row {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

        .input-action-row select.input {
            grid-column: 1 / -1;
        }
}

@media (max-width: 560px) {
    .account-card-header {
        flex-direction: column;
    }

    .status-badge {
        align-self: flex-start;
    }

    .two-factor-content {
        align-items: flex-start;
    }

    .account-actions {
        align-items: stretch;
        flex-direction: column;
    }

        .account-actions form,
        .account-actions .btn {
            width: 100%;
        }
}
/* SweetAlert integrado con la UI */
.app-swal {
    border-radius: 22px !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    padding: 1.35rem !important;
}

.app-swal-title {
    color: var(--brand-dark) !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
}

.app-swal-text {
    color: var(--muted) !important;
    font-weight: 600 !important;
}

.app-swal-actions {
    gap: .65rem !important;
}

.app-swal-confirm,
.app-swal-cancel {
    min-width: 120px;
    box-shadow: none !important;
}

.app-swal .swal2-icon.swal2-warning {
    border-color: rgba(217, 119, 6, .45) !important;
    color: var(--warning) !important;
}

.app-toast {
    border-radius: 16px !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-soft) !important;
}

/* Ajustes fase 3/4: listados, existencias, calendario y configuración */
.text-right { text-align: right; }
.existence-summary-card { max-width: 520px; margin-bottom: 1rem; }
.existence-date-filter { display: flex; align-items: end; gap: .65rem; margin-bottom: 1rem; }
    .existence-date-filter button.btn {
        min-height: 50px;
    }
.existence-summary-table .table { min-width: 0; }
.prefactura-generate-form { margin-top: .75rem; }
.calendar-day-modal { width: min(760px, 100%); }
.calendar-day-search { margin-bottom: 1rem; }
.calendar-day-list { display: grid; gap: .6rem; max-height: min(60vh, 520px); overflow-y: auto; padding-right: .25rem; }
.calendar-day-item { width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface-soft); border-radius: 14px; padding: .75rem .9rem; cursor: pointer; display: grid; gap: .2rem; }
.calendar-day-item:hover { background: var(--brand-soft); border-color: rgba(11, 99, 56, .22); }
/*.calendar-day-item strong { color: var(--brand-dark); }*/
.calendar-day-item span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.calendar-day-item small { color: var(--text); }
@media (max-width: 760px) {
    .existence-summary-card { max-width: none; }
    .existence-date-filter { align-items: stretch; flex-direction: column; }
}

.repo-security-card-compact {
    justify-content: flex-start;
    padding: .85rem 1rem;
    font-size: .92rem;
}

.repo-security-card-compact i {
    color: var(--brand);
}

.actions-col {
    width: 1%;
    white-space: nowrap;
}

/* Parte 1: acciones compactas y consistentes en tablas */
.table-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    white-space: nowrap;
    width: 100%;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.table th.actions-col,
.table td.table-actions,
.actions-col {
    width: 1%;
    min-width: 92px;
    white-space: nowrap;
    text-align: right;
}

.icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(11, 99, 56, .18);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
    text-decoration: none;
    line-height: 1;
}

.icon-btn:hover,
.icon-btn:focus-visible {
    border-color: rgba(11, 99, 56, .35);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.icon-btn.danger,
.icon-btn.danger-btn,
.danger-btn.icon-btn {
    border-color: rgba(220, 38, 38, .18);
    color: var(--danger);
}

.icon-btn.danger:hover,
.icon-btn.danger:focus-visible,
.icon-btn.danger-btn:hover,
.icon-btn.danger-btn:focus-visible,
.danger-btn.icon-btn:hover,
.danger-btn.icon-btn:focus-visible {
    border-color: rgba(220, 38, 38, .35);
    background: var(--danger-soft);
    color: var(--danger);
}

.icon-btn.disabled,
.icon-btn:disabled,
.icon-btn.danger.disabled,
.icon-btn.danger:disabled {
    border-color: var(--border) !important;
    background: var(--surface-soft) !important;
    color: #98a2b3 !important;
    box-shadow: none;
    opacity: .7;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.icon-btn.warning {
    border-color: rgba(180, 83, 9, .22);
    color: #b45309;
}

.icon-btn.warning:hover,
.icon-btn.warning:focus-visible {
    border-color: rgba(180, 83, 9, .4);
    background: #fff7ed;
    color: #92400e;
}

.compact-chip {
    min-width: auto;
    padding: .2rem .45rem;
    margin-left: .35rem;
    font-size: .72rem;
}

/* Parte 1: prefacturación como generador simple de Excel */
.prefacturacion-card {
    max-width: 800px;
}

.prefactura-generate-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 180px)) auto;
    align-items: end;
    gap: .9rem;
    margin-top: 1rem;
}

.prefactura-generate-form .compact-input {
    max-width: none;
    width: 100%;
}

.prefactura-submit {
    min-height: 50px;
    white-space: nowrap;
}

.prefactura-includes {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin-top: 1rem;
    color: var(--muted);
    font-size: .94rem;
}

.prefactura-includes strong {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .28rem .7rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: .9rem;
}

/* Parte 1: aviso del repositorio más discreto */
.repo-security-card-compact {
    width: fit-content;
    max-width: 100%;
    padding: .65rem .85rem;
    margin-bottom: .75rem;
    border-radius: 999px;
    box-shadow: none;
}

@media (max-width: 820px) {
    .prefactura-generate-form {
        grid-template-columns: 1fr 1fr;
    }

    .prefactura-submit {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .prefactura-generate-form {
        grid-template-columns: 1fr;
    }

    .repo-security-card-compact {
        width: 100%;
        border-radius: 18px;
    }
}

/* Ajustes posteriores: prefacturación compacta, sticky-actions y elFinder */
.prefactura-generate-form {
    grid-template-columns: repeat(3, minmax(140px, 180px)) max-content;
    align-items: end;
}

.prefactura-submit {
    width: auto !important;
    min-width: 180px;
    justify-self: start;
}

.form-actions.sticky-actions {
    justify-content: flex-end;
}

.elfinder .ui-buttonset,
.elfinder .ui-controlgroup {
    font-size: inherit;
}

@media (max-width: 820px) {
    .prefactura-generate-form {
        grid-template-columns: 1fr 1fr;
    }

    .prefactura-submit {
        grid-column: 1 / -1;
        width: 100% !important;
        justify-self: stretch;
    }
}

.fc-more-popover {
    display: none !important;
}

.calendar-day-item {
    border-left: 5px solid #d1d5db;
}

.calendar-day-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.calendar-day-item-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.calendar-type-badge,
.calendar-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Tipo */
.calendar-day-item.event-type-incidencia {
    border-left-color: #dc2626;
}

/*.calendar-day-item.event-type-tarea {
    border-left-color: #2563eb;
}*/

.calendar-type-badge.event-type-incidencia {
    /*background: #fee2e2;*/
    color: #991b1b;
}

/*.calendar-type-badge.event-type-tarea {*/
    /*background: #dbeafe;*/
    /*color: #1e40af;
}*/

/* Estado */
.calendar-status-badge.status-realizado {
    background: #dcfce7;
    color: #166534;
}

.calendar-status-badge.status-standby {
    background: #fef3c7;
    color: #92400e;
}

.calendar-status-badge.status-cancelado {
    background: #e5e7eb;
    color: #919bab;
    /*opacity: 0.5;*/
}

.calendar-status-badge.status-default {
    background: #f3f4f6;
    color: #4b5563;
}

.calendar-status-badge.finca-pendiente {
    background: #e5e7eb;
    color: #374151;
}

.calendar-status-badge.incidencia-pendiente {
    background: #fff4f4;
    color: #dc2626;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .875rem;
}

    /* Incidencia pendiente */
    .status-chip.pendiente,
    .status-chip.incidencia-pendiente {
        background: #fff4f4;
        color: #dc2626;
    }

    /* Tarea finca pendiente */
    .status-chip.finca-pendiente {
        background: #e5e7eb;
        color: #374151;
    }

    /* Cancelado */
    .status-chip.cancelada {
        background: #f3f4f6;
        color: #a3a9b6;
    }

    /* Standby */
    .status-chip.standby {
        background: #fff7ed;
        color: #d97706;
    }

    /* Realizado */
    .status-chip.realizada {
        background: #ecfdf3;
        color: #0b6338;
    }

/*--------------------------------------------------------*/

.search-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 260px;
}

    .search-input-wrap .input {
        width: 100%;
        padding-right: 2.25rem;
    }

.filter-loading-icon {
    position: absolute;
    right: 0.75rem;
    display: none;
    color: var(--muted-color, #6b7280);
    pointer-events: none;
}

    .filter-loading-icon.is-visible {
        display: inline-flex;
    }

.table-card {
    position: relative;
}

.table-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(1px);
}

    .table-loading-overlay.is-visible {
        display: flex;
    }

.table-loading-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-weight: 600;
}

.table-card.is-loading .desktop-table,
.table-card.is-loading .mobile-cards,
.table-card.is-loading .pager {
    opacity: 0.45;
    pointer-events: none;
}

/*--------------------------------------------------------*/

.yr-swal-popup {
    border-radius: 22px;
    padding: 2rem;
    font-family: inherit;
}

.yr-swal-title {
    color: #073f2a;
    font-size: 2rem;
    font-weight: 800;
}

.yr-swal-html {
    color: #374151;
}

.yr-swal-current-state {
    margin-top: .25rem;
    margin-bottom: 1rem;
}

.yr-swal-input {
    border: 1px solid #b7d7c4 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    color: #073f2a !important;
    font-size: 1rem !important;
    padding: .85rem 1rem !important;
}

    .yr-swal-input:focus {
        border-color: #0b6338 !important;
        box-shadow: 0 0 0 3px rgba(11, 99, 56, .16) !important;
    }

.yr-swal-actions {
    gap: .75rem;
    margin-top: 1.5rem;
}

.yr-swal-confirm {
    background: #073f2a;
    color: #fff;
    border: 1px solid #073f2a;
}

    .yr-swal-confirm:hover {
        background: #0b6338;
        border-color: #0b6338;
    }

.yr-swal-cancel {
    background: #eef5f1;
    color: #073f2a;
    border: 1px solid #cfe3d8;
}

    .yr-swal-cancel:hover {
        background: #dfeee6;
    }

/*--------------------------------------------------------*/

.repo-help-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    /*padding: 1rem 1.1rem;*/
}

.repo-help-icon {
    flex: 0 0 auto;
    color: #0f172a;
    font-size: 1.1rem;
  /*  line-height: 1.4;
    margin-top: .1rem;*/
}

.repo-help-content {
    display: grid;
    /*gap: .35rem;*/
    line-height: 1;
}

    .repo-help-content p {
        margin: 0;
    }

    .repo-help-content strong {
        color: #0f172a;
    }
.sort-link {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
}

.sort-link:hover {
    text-decoration: underline;
}

.sort-link .fa-sort {
    opacity: .45;
}

/*--------------------------------------------------------*/

.form-hint {
    margin: .4rem 0 0;
    font-size: .85rem;
    color: var(--muted);
}

.warning-hint {
    color: #9a5b00;
}

.field label.field-label-with-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.field-label-note {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Ajuste hover calendario: respeta el color semántico del estado/origen */
.calendar-day-item.incidencia-pendiente:hover {
    background: #fff4f4;
    border-color: rgba(220, 38, 38, .28);
}

.calendar-day-item.finca-pendiente:hover {
    background: #f3f4f6;
    border-color: rgba(55, 65, 81, .24);
}

.calendar-day-item.status-standby:hover {
    background: #fff7ed;
    border-color: rgba(217, 119, 6, .28);
}

.calendar-day-item.status-realizado:hover {
    background: #ecfdf3;
    border-color: rgba(11, 99, 56, .24);
}

.calendar-day-item.status-cancelado:hover {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, .28);
}


/* Corrección Paso 3: acciones móviles compactas y sticky-actions por encima de la botonera inferior */
.mobile-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .65rem;
}

.mobile-card-actions form {
    display: inline-flex;
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.mobile-card-actions .icon-btn,
.mobile-card-actions .btn-icon,
.mobile-card-actions button.icon-btn,
.mobile-card-actions a.icon-btn {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
}

@media (max-width: 980px) {
    .sticky-actions {
        bottom: 76px;
    }

    .content {
        padding-bottom: 9rem;
    }
}

.permission-section {
    gap: 1rem;
}

.permission-toolbar {
    margin-bottom: 1rem;
}

.permission-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    background: var(--bg);
    padding: 1rem;
    border-radius: 20px;
}

.permission-group {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    overflow: hidden;
}

.permission-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fff, var(--surface-soft));
}

.permission-group-head h3 {
    margin: 0;
    font-size: 1rem;
}

.permission-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    justify-content: flex-end;
}

.permission-options {
    display: grid;
    gap: .35rem;
    padding: .85rem;
}

.permission-option {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .65rem .7rem;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
}

.permission-option:hover {
    border-color: var(--border);
    background: var(--surface-soft);
}

.permission-option input {
    margin-top: .2rem;
}

.permission-option strong,
.permission-option small {
    display: block;
}

.permission-option small {
    margin-top: .15rem;
    color: var(--muted);
    font-size: .78rem;
}

.permission-option.locked {
    cursor: not-allowed;
    opacity: .82;
}

.small-btn {
    padding: .35rem .6rem;
    font-size: .78rem;
}

.compact-empty {
    padding: 1rem;
}

@media(max-width: 760px) {
    .permission-groups {
        grid-template-columns: 1fr;
    }

    .permission-group-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .permission-group-actions {
        justify-content: flex-start;
    }
}

/* Compact row action dropdowns */
.row-actions-menu {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.row-actions-menu summary {
    list-style: none;
}

.row-actions-menu summary::marker {
    content: "";
}

.row-actions-trigger {
    cursor: pointer;
}

.row-actions-panel {
    position: absolute;
    top: calc(100% + .35rem);
    right: 0;
    z-index: 30;
    min-width: 220px;
    padding: .35rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .16);
    display: none;
}

.row-actions-menu[open] .row-actions-panel {
    display: grid;
    gap: .15rem;
}

.row-actions-panel form {
    margin: 0;
}

.row-action-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .62rem .75rem;
    border-radius: 12px;
    text-decoration: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.row-action-item:hover,
.row-action-item:focus-visible {
    background: var(--surface-soft);
    outline: none;
}

.row-action-item i {
    width: 1.15rem;
    text-align: center;
    color: var(--muted);
}

.row-action-item.danger,
.row-action-item.danger i {
    color: var(--danger);
}

.mobile-row-actions-menu {
    width: 100%;
    justify-content: stretch;
}

.mobile-row-actions-menu .row-actions-trigger {
    width: 100%;
    justify-content: center;
    gap: .45rem;
}

.mobile-row-actions-menu .row-actions-panel {
    left: 0;
    right: 0;
    min-width: 0;
}

/* Admin list refinements */
.admin-list-card {
    overflow: visible;
}

.admin-list-card .desktop-table {
    overflow-x: visible;
}

.admin-toolbar .search-input-wrap {
    min-width: 280px;
}

.row-actions-panel.is-floating {
    position: fixed;
    z-index: 4000;
    overflow-y: auto;
}

.row-action-item.info i,
.row-action-item.info {
    color: #1d4ed8;
}

.row-action-item.success i,
.row-action-item.success {
    color: #047857;
}

.row-action-item.warning i,
.row-action-item.warning {
    color: #b45309;
}

.row-action-item.info:hover,
.row-action-item.info:focus-visible {
    background: #eff6ff;
}

.row-action-item.success:hover,
.row-action-item.success:focus-visible {
    background: #ecfdf5;
}

.row-action-item.warning:hover,
.row-action-item.warning:focus-visible {
    background: #fffbeb;
}

.row-action-item.danger:hover,
.row-action-item.danger:focus-visible {
    background: var(--danger-soft);
}

.permission-group-actions {
    gap: .45rem;
}

.permission-group-icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
}

@media(max-width: 760px) {
    .admin-list-card .desktop-table {
        overflow-x: auto;
    }
}

/* Admin roles: acciones visibles y compactas */
.role-inline-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
    flex-wrap: nowrap;
    width: 100%;
}

.role-inline-actions form {
    margin: 0;
    display: inline-flex;
}

.mobile-card-actions.role-inline-actions {
    justify-content: flex-start;
    width: auto;
    flex-wrap: wrap;
}

.warning-btn,
.app-swal-deny {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

.warning-btn:hover,
.warning-btn:focus-visible,
.app-swal-deny:hover,
.app-swal-deny:focus-visible {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}

.app-swal-select {
    width: 100% !important;
    max-width: 100%;
    margin: .75rem 0 .25rem;
}

.swal-form-label {
    display: block;
    margin-top: .85rem;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
}

.swal-form-hint {
    margin: .35rem 0 0;
    color: var(--muted);
    font-size: .92rem;
    text-align: left;
}

.readonly-input {
    display: flex;
    align-items: center;
    min-height: 44px;
    background: var(--surface-soft);
    color: var(--muted);
}

.location-summary {
    display: grid;
    gap: .25rem;
    justify-items: start;
}

.location-planned {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.25;
}

/* Estancias: mantener estable la cuadrícula al alternar entrada real/prevista */
.estancia-form-grid {
    align-items: start;
}

.estancia-form-grid > .estancia-exit-slot[hidden] {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
}

/* Estados compactos en tablas y etiqueta auxiliar de fecha prevista */
.status-chip.table-status-chip {
    min-width: 0;
    padding: .22rem .5rem;
    gap: .3rem;
    font-size: .78rem;
    line-height: 1.2;
}

.status-chip.compact-chip {
    min-width: 0;
    padding: .14rem .4rem;
    margin-left: .35rem;
    gap: .25rem;
    font-size: .7rem;
    line-height: 1.15;
}

@media (max-width: 900px) {
    .estancia-form-grid > .estancia-exit-slot[hidden] {
        display: none !important;
    }
}
