
/* ==========================================================
   ArboriaGEST - Rediseño Visual Corporativo v1.0
   ========================================================== */

:root {
    --ag-font-sans: "IBM Plex Sans", "Aptos", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    --ag-blue-900: #102A56;
    --ag-blue-800: #153E75;
    --ag-blue-700: #1D4ED8;
    --ag-blue-600: #2563EB;
    --ag-blue-500: #3B82F6;
    --ag-blue-100: #DBEAFE;
    --ag-blue-50: #EFF6FF;

    --ag-slate-950: #020617;
    --ag-slate-900: #0F172A;
    --ag-slate-800: #1E293B;
    --ag-slate-700: #334155;
    --ag-slate-600: #475569;
    --ag-slate-500: #64748B;
    --ag-slate-400: #94A3B8;
    --ag-slate-300: #CBD5E1;
    --ag-slate-200: #E2E8F0;
    --ag-slate-100: #F1F5F9;
    --ag-slate-50: #F8FAFC;

    --ag-success: #16A34A;
    --ag-warning: #F59E0B;
    --ag-danger: #EF4444;
    --ag-info: #2563EB;

    --ag-bg: #F6F8FC;
    --ag-surface: #FFFFFF;
    --ag-surface-soft: #F8FAFC;
    --ag-border: #E5E7EB;
    --ag-text: #111827;
    --ag-muted: #64748B;

    --ag-radius-xs: 6px;
    --ag-radius-sm: 8px;
    --ag-radius-md: 12px;
    --ag-radius-lg: 16px;
    --ag-radius-xl: 22px;

    --ag-shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --ag-shadow-sm: 0 4px 12px rgba(16, 24, 40, .06);
    --ag-shadow-md: 0 10px 24px rgba(16, 24, 40, .08);
    --ag-shadow-lg: 0 18px 42px rgba(16, 24, 40, .10);

    --ag-sidebar-width: 272px;
    --ag-topbar-height: 72px;
}

[data-bs-theme="dark"] {
    --ag-bg: #0B1220;
    --ag-surface: #111827;
    --ag-surface-soft: #0F172A;
    --ag-border: #1F2937;
    --ag-text: #F8FAFC;
    --ag-muted: #94A3B8;

    --bs-body-bg: var(--ag-bg);
    --bs-body-color: var(--ag-text);
    --bs-border-color: var(--ag-border);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--ag-font-sans);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .06), transparent 34rem),
        linear-gradient(180deg, var(--ag-slate-50), var(--ag-bg));
    color: var(--ag-text);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

[data-bs-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .16), transparent 32rem),
        linear-gradient(180deg, #0B1220, #070C16);
}

/* Bootstrap refinement */

.btn {
    --bs-btn-border-radius: var(--ag-radius-sm);
    min-height: 38px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.btn-primary {
    --bs-btn-bg: var(--ag-blue-600);
    --bs-btn-border-color: var(--ag-blue-600);
    --bs-btn-hover-bg: var(--ag-blue-700);
    --bs-btn-hover-border-color: var(--ag-blue-700);
    --bs-btn-active-bg: var(--ag-blue-800);
    --bs-btn-active-border-color: var(--ag-blue-800);
    box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
}

.btn-outline-secondary {
    --bs-btn-color: var(--ag-slate-700);
    --bs-btn-border-color: var(--ag-border);
    --bs-btn-hover-bg: var(--ag-slate-50);
    --bs-btn-hover-border-color: var(--ag-slate-300);
    --bs-btn-hover-color: var(--ag-slate-900);
}

[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: var(--ag-slate-300);
    --bs-btn-border-color: var(--ag-border);
    --bs-btn-hover-bg: #1F2937;
    --bs-btn-hover-color: #fff;
}

.form-control,
.form-select {
    min-height: 40px;
    border-radius: var(--ag-radius-sm);
    border-color: var(--ag-border);
    background-color: var(--ag-surface);
    color: var(--ag-text);
    font-size: .875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, .5);
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .12);
}

.card {
    border-radius: var(--ag-radius-lg);
    border-color: var(--ag-border);
    background-color: var(--ag-surface);
    box-shadow: var(--ag-shadow-sm);
}

.dropdown-menu {
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    box-shadow: var(--ag-shadow-md);
    padding: .45rem;
}

.dropdown-item {
    border-radius: var(--ag-radius-sm);
    font-size: .875rem;
    padding: .55rem .7rem;
}

/* Brand */

.ag-brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

.ag-brand-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ag-brand-mark svg {
    width: 34px;
    height: 34px;
    display: block;
}

.ag-brand-text {
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--ag-slate-900);
}

[data-bs-theme="dark"] .ag-brand-text {
    color: #fff;
}

.ag-brand-text span {
    color: var(--ag-blue-600);
}

/* Layout */

.ag-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--ag-sidebar-width) 1fr;
}

.ag-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: rgba(255, 255, 255, .84);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--ag-border);
    padding: 1.15rem .9rem;
    z-index: 1030;
}

[data-bs-theme="dark"] .ag-sidebar {
    background: rgba(17, 24, 39, .84);
}

.ag-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .35rem .55rem 1.15rem;
}

.ag-sidebar-close {
    display: none;
}

.ag-nav {
    display: grid;
    gap: .18rem;
}

.ag-nav-section {
    margin: .95rem .65rem .35rem;
    color: var(--ag-muted);
    font-size: .68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ag-nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 40px;
    padding: .58rem .72rem;
    border-radius: var(--ag-radius-md);
    color: var(--ag-slate-600);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 700;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

[data-bs-theme="dark"] .ag-nav-link {
    color: var(--ag-slate-300);
}

.ag-nav-link:hover {
    background: var(--ag-slate-100);
    color: var(--ag-slate-900);
    transform: translateX(1px);
}

[data-bs-theme="dark"] .ag-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.ag-nav-link.active {
    background: var(--ag-blue-50);
    color: var(--ag-blue-700);
}

[data-bs-theme="dark"] .ag-nav-link.active {
    background: rgba(37, 99, 235, .18);
    color: #93C5FD;
}

.ag-nav-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    flex: 0 0 auto;
    font-size: 1.15rem;
}

.ag-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ag-topbar {
    position: sticky;
    top: 0;
    height: var(--ag-topbar-height);
    z-index: 1020;
    background: rgba(246, 248, 252, .78);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(229, 231, 235, .75);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.4rem;
}

[data-bs-theme="dark"] .ag-topbar {
    background: rgba(11, 18, 32, .78);
    border-bottom-color: rgba(31, 41, 55, .75);
}

.ag-mobile-menu {
    display: none;
}

.ag-page-title {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
}

.ag-page-title h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

.ag-search {
    width: min(440px, 100%);
    position: relative;
}

.ag-search input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    background: var(--ag-surface);
    color: var(--ag-text);
    padding: 0 4.2rem 0 2.45rem;
    font-size: .86rem;
    outline: none;
}

.ag-search svg {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--ag-muted);
}

.ag-search-kbd {
    position: absolute;
    right: .48rem;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--ag-border);
    border-radius: 7px;
    padding: .1rem .4rem;
    font-size: .72rem;
    color: var(--ag-muted);
    background: var(--ag-surface-soft);
}

.ag-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
}

.ag-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    background: var(--ag-surface);
    color: var(--ag-slate-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.ag-icon-btn:hover {
    background: var(--ag-slate-50);
}

[data-bs-theme="dark"] .ag-icon-btn:hover {
    background: rgba(255, 255, 255, .06);
}

.ag-notify-dot {
    position: absolute;
    top: -4px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--ag-blue-600);
    color: #fff;
    font-size: .68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ag-surface);
}

.ag-user-menu {
    display: flex;
    align-items: center;
    gap: .65rem;
    border: 1px solid transparent;
    background: transparent;
    border-radius: var(--ag-radius-md);
    padding: .28rem .4rem;
    color: var(--ag-text);
}

.ag-user-menu:hover {
    border-color: var(--ag-border);
    background: var(--ag-surface);
}

.ag-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ag-blue-600), #7C3AED);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.ag-user-meta {
    text-align: left;
    line-height: 1.12;
}

.ag-user-name {
    font-size: .84rem;
    font-weight: 800;
}

.ag-user-role {
    color: var(--ag-muted);
    font-size: .72rem;
    font-weight: 600;
}

.ag-content {
    padding: 1.35rem;
    min-width: 0;
}

/* Dashboard */

.ag-dashboard-grid {
    display: grid;
    gap: 1rem;
}

.ag-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.ag-kpi-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    box-shadow: var(--ag-shadow-sm);
    padding: 1rem;
    display: flex;
    gap: .85rem;
    align-items: center;
}

.ag-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--ag-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.ag-kpi-icon.blue {
    background: var(--ag-blue-50);
    color: var(--ag-blue-700);
}

.ag-kpi-icon.purple {
    background: #F3E8FF;
    color: #7E22CE;
}

.ag-kpi-icon.orange {
    background: #FFF7ED;
    color: #EA580C;
}

.ag-kpi-icon.green {
    background: #ECFDF5;
    color: #16A34A;
}

.ag-kpi-label {
    color: var(--ag-muted);
    font-size: .78rem;
    font-weight: 700;
}

.ag-kpi-value {
    margin-top: .1rem;
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -.04em;
}

.ag-kpi-delta {
    margin-top: .28rem;
    font-size: .74rem;
    font-weight: 700;
}

.ag-kpi-delta.up {
    color: var(--ag-success);
}

.ag-kpi-delta.down {
    color: var(--ag-danger);
}

.ag-dashboard-main {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr) minmax(280px, .65fr);
    gap: 1rem;
}

.ag-panel {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    box-shadow: var(--ag-shadow-sm);
    overflow: hidden;
}

.ag-panel-header {
    padding: 1rem 1rem .6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.ag-panel-title {
    margin: 0;
    font-size: .98rem;
    font-weight: 850;
    letter-spacing: -.02em;
}

.ag-chart {
    padding: .2rem 1rem 1rem;
}

.ag-chart svg {
    width: 100%;
    height: 260px;
    display: block;
}

.ag-activity-list,
.ag-quick-list {
    display: grid;
    gap: .4rem;
    padding: .25rem .85rem 1rem;
}

.ag-activity-item,
.ag-quick-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .68rem;
    border-radius: var(--ag-radius-md);
    text-decoration: none;
    color: var(--ag-text);
}

.ag-activity-item:hover,
.ag-quick-item:hover {
    background: var(--ag-surface-soft);
}

.ag-activity-icon,
.ag-quick-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--ag-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ag-blue-50);
    color: var(--ag-blue-700);
    flex: 0 0 auto;
}

.ag-activity-content {
    min-width: 0;
    flex: 1;
}

.ag-activity-title {
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-activity-subtitle {
    color: var(--ag-muted);
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-activity-time {
    color: var(--ag-muted);
    font-size: .72rem;
    white-space: nowrap;
}

/* Users */

.ag-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ag-page-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 850;
    letter-spacing: -.04em;
}

.ag-page-head p {
    margin: .25rem 0 0;
    color: var(--ag-muted);
    font-size: .92rem;
}

.ag-page-head--sticky {
    position: sticky;
    top: var(--ag-topbar-height, 72px);
    z-index: 1015;
    background: var(--ag-bg, #F6F8FC);
    padding-top: .5rem;
    padding-bottom: .5rem;
    margin-bottom: 1rem;
}

.ag-toolbar-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    box-shadow: var(--ag-shadow-sm);
    padding: .85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.ag-toolbar-card .form-control,
.ag-toolbar-card .form-select {
    width: auto;
}

.ag-table-card {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    box-shadow: var(--ag-shadow-sm);
    overflow: hidden;
}

.ag-table {
    margin: 0;
    font-size: .875rem;
}

.ag-table thead th {
    background: var(--ag-surface-soft);
    color: var(--ag-muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 850;
    border-bottom: 1px solid var(--ag-border);
    padding: .82rem 1rem;
    white-space: nowrap;
}

.ag-table tbody td {
    padding: .82rem 1rem;
    vertical-align: middle;
    border-bottom-color: var(--ag-border);
}

.ag-table tbody tr:hover > td {
    background: rgba(37, 99, 235, .025);
}

.ag-user-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 220px;
}

.ag-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: var(--ag-blue-50);
    color: var(--ag-blue-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    flex: 0 0 auto;
}

.ag-user-cell strong {
    display: block;
    font-weight: 820;
    color: var(--ag-text);
}

.ag-user-cell span {
    color: var(--ag-muted);
    font-size: .76rem;
}

.ag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    min-height: 24px;
    padding: .22rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ag-badge.success {
    color: #166534;
    background: #DCFCE7;
    border-color: #BBF7D0;
}

.ag-badge.warning {
    color: #92400E;
    background: #FEF3C7;
    border-color: #FDE68A;
}

.ag-badge.danger {
    color: #991B1B;
    background: #FEE2E2;
    border-color: #FECACA;
}

.ag-badge.info {
    color: #1D4ED8;
    background: #DBEAFE;
    border-color: #BFDBFE;
}

.ag-badge.neutral {
    color: var(--ag-slate-700);
    background: var(--ag-slate-100);
    border-color: var(--ag-slate-200);
}

.ag-action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-sm);
    background: var(--ag-surface);
    color: var(--ag-muted);
    cursor: pointer;
}

.ag-action-btn:hover {
    color: var(--ag-blue-700);
    background: var(--ag-blue-50);
    border-color: var(--ag-blue-100);
}

.ag-permissions-row > td {
    background: linear-gradient(180deg, rgba(37, 99, 235, .035), rgba(37, 99, 235, .015));
    padding: 0 !important;
}

.ag-permissions-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--ag-border);
}

.ag-permissions-summary {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    padding: 1rem;
}

.ag-permissions-summary h3 {
    margin: 0 0 .4rem;
    font-size: .95rem;
    font-weight: 850;
}

.ag-permissions-summary p {
    color: var(--ag-muted);
    font-size: .82rem;
    margin: 0;
}

.ag-permissions-matrix {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    overflow: hidden;
}

.ag-permissions-matrix table {
    margin: 0;
}

.ag-permissions-matrix th {
    background: var(--ag-surface-soft);
    color: var(--ag-muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 850;
    padding: .7rem .8rem;
}

.ag-permissions-matrix td {
    padding: .62rem .8rem;
}

.ag-permissions-matrix .form-check-input {
    cursor: pointer;
}

/* Login */

.ag-login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .08), transparent 30rem),
        linear-gradient(180deg, #FFFFFF, #F6F8FC);
}

.ag-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 430px) minmax(640px, 1fr);
    gap: 2rem;
    padding: 2rem;
}

.ag-login-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0 1rem .25rem;
}

.ag-login-intro h1 {
    margin: 2.4rem 0 .8rem;
    max-width: 330px;
    color: var(--ag-slate-900);
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 850;
    line-height: 1.06;
    letter-spacing: -.065em;
}

.ag-login-accent {
    width: 46px;
    height: 3px;
    border-radius: 999px;
    background: var(--ag-blue-600);
    margin: .7rem 0 1.35rem;
}

.ag-login-intro p {
    max-width: 320px;
    color: var(--ag-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.ag-login-features {
    display: grid;
    gap: 1rem;
    margin-top: 1.65rem;
}

.ag-login-feature {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: var(--ag-slate-600);
    font-weight: 650;
    font-size: .92rem;
}

.ag-login-feature-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--ag-blue-100);
    border-radius: 999px;
    color: var(--ag-blue-600);
    background: rgba(239, 246, 255, .8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ag-login-card {
    align-self: center;
    justify-self: stretch;
    max-width: 900px;
    min-height: 620px;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: 22px;
    box-shadow: var(--ag-shadow-lg);
    overflow: hidden;
}

.ag-login-visual {
    position: relative;
    min-height: 620px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(255, 255, 255, .2)),
        url("/assets/img/imagen_login.svg");
    background-size: cover;
    background-position: center;
}

.ag-login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .08), rgba(255, 255, 255, .12)),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, .42), transparent 18rem);
}

.ag-login-visual::after {
    content: "A";
    position: absolute;
    top: 12%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .52);
    font-size: 12rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -.08em;
}

.ag-login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem;
}

.ag-login-form {
    width: 100%;
    max-width: 360px;
}

.ag-login-form .ag-brand {
    justify-content: center;
    margin-bottom: 1.8rem;
}

.ag-login-form h2 {
    margin: 0;
    text-align: center;
    color: var(--ag-slate-900);
    font-size: 1.45rem;
    font-weight: 850;
    letter-spacing: -.04em;
}

.ag-login-form .ag-login-subtitle {
    margin: .45rem 0 1.65rem;
    text-align: center;
    color: var(--ag-muted);
    font-size: .88rem;
}

.ag-login-field {
    margin-bottom: .95rem;
}

.ag-login-field label {
    display: block;
    margin-bottom: .42rem;
    color: var(--ag-slate-700);
    font-size: .8rem;
    font-weight: 800;
}

.ag-input-icon {
    position: relative;
}

.ag-input-icon svg {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--ag-muted);
}

.ag-input-icon input {
    padding-left: 2.45rem;
}

.ag-password-toggle {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--ag-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ag-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin: .55rem 0 1rem;
}

.ag-login-options .form-check-label,
.ag-login-options a {
    font-size: .78rem;
    font-weight: 700;
}

.ag-login-options a {
    color: var(--ag-blue-600);
    text-decoration: none;
}

.ag-login-submit {
    width: 100%;
    min-height: 44px;
}

.ag-login-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.4rem 0 1rem;
    color: var(--ag-muted);
    font-size: .78rem;
}

.ag-login-divider::before,
.ag-login-divider::after {
    content: "";
    height: 1px;
    background: var(--ag-border);
    flex: 1;
}

.ag-sso-grid {
    display: grid;
    gap: .75rem;
}

.ag-sso-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 42px;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-sm);
    background: var(--ag-surface);
    color: var(--ag-text);
    text-decoration: none;
    font-weight: 800;
    font-size: .86rem;
}

.ag-sso-btn:hover {
    background: var(--ag-slate-50);
    color: var(--ag-text);
}

/* Responsive */

@media (max-width: 1199.98px) {
    .ag-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ag-dashboard-main {
        grid-template-columns: 1fr;
    }

    .ag-login-shell {
        grid-template-columns: 1fr;
    }

    .ag-login-intro {
        display: none;
    }

    .ag-login-card {
        justify-self: center;
        width: min(100%, 920px);
    }
}

@media (max-width: 991.98px) {
    .ag-shell {
        grid-template-columns: 1fr;
    }

    .ag-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform .18s ease;
        width: min(88vw, var(--ag-sidebar-width));
        box-shadow: var(--ag-shadow-lg);
    }

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

    .ag-sidebar-close,
    .ag-mobile-menu {
        display: inline-flex;
    }

    .ag-topbar {
        grid-template-columns: auto 1fr auto;
    }

    .ag-search {
        display: none;
    }

    .ag-user-meta {
        display: none;
    }

    .ag-content {
        padding: 1rem;
    }

    .ag-permissions-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ag-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ag-login-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .ag-login-visual {
        min-height: 210px;
    }

    .ag-login-shell {
        padding: 1rem;
    }

    .ag-login-form-wrap {
        padding: 1.5rem;
    }

    .ag-page-head {
        flex-direction: column;
    }

    .ag-toolbar-card {
        align-items: stretch;
    }

    .ag-toolbar-card .form-control,
    .ag-toolbar-card .form-select,
    .ag-toolbar-card .btn {
        width: 100%;
    }
}

/* ==========================================================
   ARBORIAGEST - Tipografía estilizada v009
   ========================================================== */

:root {
    --ag-font-sans: "IBM Plex Sans", "Aptos", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

    /*
     * Escala tipográfica más fina y corporativa.
     * Menos redondeada, más limpia y con mejor lectura en tablas.
     */
    --ag-font-weight-light: 300;
    --ag-font-weight-regular: 400;
    --ag-font-weight-medium: 450;
    --ag-font-weight-semibold: 500;
    --ag-font-weight-bold: 600;
    --ag-font-weight-heavy: 700;
}

html,
body {
    font-family: var(--ag-font-sans) !important;
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.012em;
}

/* Textos generales */

body,
.form-control,
.form-select,
.btn,
.dropdown-menu,
.table,
.modal,
.offcanvas,
.alert {
    font-family: var(--ag-font-sans) !important;
}

/* Font Awesome — forzar familia tipografica por encima de IBM Plex */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
}

.fab,
.fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
}

p,
.text-secondary,
.form-text,
.dropdown-item,
.ag-activity-subtitle,
.ag-user-role,
.ag-kpi-label,
.ag-login-subtitle {
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.006em;
}

/* Marca */

.ag-brand-text {
    font-weight: var(--ag-font-weight-bold);
    letter-spacing: -0.045em;
}

.ag-brand-text span {
    font-weight: var(--ag-font-weight-semibold);
}

/* Títulos */

h1,
h2,
h3,
h4,
h5,
h6,
.ag-page-title h1,
.ag-page-head h2,
.ag-login-intro h1,
.ag-login-form h2,
.ag-panel-title,
.ag-permissions-summary h3 {
    font-family: var(--ag-font-sans) !important;
    font-weight: var(--ag-font-weight-semibold) !important;
    letter-spacing: -0.045em;
}

.ag-login-intro h1 {
    font-weight: var(--ag-font-weight-semibold) !important;
    line-height: 1.08;
}

.ag-page-title h1 {
    font-size: 1.08rem;
}

.ag-page-head h2 {
    font-size: 1.28rem;
}

/* Navegación */

.ag-nav-section {
    font-weight: var(--ag-font-weight-semibold);
    letter-spacing: .075em;
}

.ag-nav-link {
    font-weight: var(--ag-font-weight-medium);
    letter-spacing: -0.018em;
}

/* Topbar */

.ag-search input {
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.012em;
}

.ag-search-kbd {
    font-weight: var(--ag-font-weight-medium);
}

.ag-user-name {
    font-weight: var(--ag-font-weight-semibold);
    letter-spacing: -0.02em;
}

.ag-user-role {
    font-weight: var(--ag-font-weight-regular);
}

/* Dashboard */

.ag-kpi-value {
    font-weight: var(--ag-font-weight-semibold);
    letter-spacing: -0.055em;
}

.ag-kpi-delta {
    font-weight: var(--ag-font-weight-medium);
}

.ag-activity-title {
    font-weight: var(--ag-font-weight-medium);
    letter-spacing: -0.018em;
}

/* Botones */

.btn,
.ag-sso-btn,
.ag-action-btn {
    font-weight: var(--ag-font-weight-medium) !important;
    letter-spacing: -0.018em;
}

.btn-primary {
    font-weight: var(--ag-font-weight-semibold) !important;
}

/* Formularios */

.form-label,
.ag-login-field label {
    font-weight: var(--ag-font-weight-medium);
    letter-spacing: -0.012em;
}

.form-control,
.form-select,
.ag-login-field input {
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.012em;
}

/* Tablas */

.ag-table {
    font-size: .855rem;
}

.ag-table thead th,
.ag-permissions-matrix th,
.permisos-table thead th,
.usuarios-table thead th {
    font-weight: var(--ag-font-weight-semibold) !important;
    letter-spacing: .045em;
}

.ag-table tbody td,
.ag-permissions-matrix td,
.permisos-table td,
.usuarios-table tbody td {
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.012em;
}

.ag-user-cell strong {
    font-weight: var(--ag-font-weight-medium);
    letter-spacing: -0.018em;
}

/* Badges */

.ag-badge,
.badge {
    font-family: var(--ag-font-sans) !important;
    font-weight: var(--ag-font-weight-medium) !important;
    letter-spacing: -0.01em;
}

/* Login */

.ag-login-feature {
    font-weight: var(--ag-font-weight-regular);
    letter-spacing: -0.012em;
}

.ag-login-options .form-check-label,
.ag-login-options a {
    font-weight: var(--ag-font-weight-regular);
}

/* Ajuste fino para que la interfaz se vea más estilizada */

.ag-panel,
.ag-kpi-card,
.ag-table-card,
.ag-toolbar-card,
.card,
.modal-content,
.offcanvas {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}


/* ==========================================================
   ARBORIAGEST - Sidebar icon-only v011
   ========================================================== */

:root {
    --ag-sidebar-width-expanded: 272px;
    --ag-sidebar-width-collapsed: 82px;
    --ag-sidebar-width: var(--ag-sidebar-width-expanded);
}

body.ag-sidebar-collapsed {
    --ag-sidebar-width: var(--ag-sidebar-width-collapsed);
}

.ag-shell {
    grid-template-columns: var(--ag-sidebar-width) 1fr;
    transition: grid-template-columns .18s ease;
}

.ag-sidebar {
    width: var(--ag-sidebar-width);
    transition: width .18s ease, transform .18s ease;
    overflow-x: hidden;
}

.ag-sidebar-head {
    min-height: 58px;
}

.ag-sidebar-toggle {
    display: inline-flex;
}

body.ag-sidebar-collapsed .ag-sidebar {
    padding-left: .7rem;
    padding-right: .7rem;
}

body.ag-sidebar-collapsed .ag-brand {
    justify-content: center;
    width: 100%;
}

body.ag-sidebar-collapsed .ag-brand-text {
    display: none;
}

body.ag-sidebar-collapsed .ag-nav-section {
    display: none;
}

body.ag-sidebar-collapsed .ag-nav {
    gap: .35rem;
    margin-top: .7rem;
}

body.ag-sidebar-collapsed .ag-nav-link {
    justify-content: center;
    padding: .72rem;
    min-height: 44px;
}

body.ag-sidebar-collapsed .ag-nav-link span:not(.ag-nav-icon) {
    display: none;
}

body.ag-sidebar-collapsed .ag-nav-icon {
    width: 22px;
    height: 22px;
}

.ag-sidebar-close,
.ag-mobile-menu {
    display: none !important;
}

@media (max-width: 991.98px) {
    .ag-shell {
        grid-template-columns: var(--ag-sidebar-width-collapsed) 1fr;
    }

    .ag-sidebar {
        position: sticky;
        transform: none !important;
        width: var(--ag-sidebar-width-collapsed);
        padding-left: .7rem;
        padding-right: .7rem;
        box-shadow: none;
    }

    .ag-sidebar .ag-brand {
        justify-content: center;
        width: 100%;
    }

    .ag-sidebar .ag-brand-text,
    .ag-sidebar .ag-nav-section,
    .ag-sidebar .ag-nav-link span:not(.ag-nav-icon) {
        display: none;
    }

    .ag-sidebar .ag-nav-link {
        justify-content: center;
        padding: .72rem;
        min-height: 44px;
    }

    body:not(.ag-sidebar-collapsed) {
        --ag-sidebar-width: var(--ag-sidebar-width-collapsed);
    }
}

/* ==========================================================
   ARBORIAGEST - Sidebar desktop toggle v012
   ========================================================== */

:root {
    --ag-sidebar-width-expanded: 272px;
    --ag-sidebar-width-collapsed: 82px;
    --ag-sidebar-width: var(--ag-sidebar-width-expanded);
}

body.ag-sidebar-collapsed {
    --ag-sidebar-width: var(--ag-sidebar-width-collapsed);
}

.ag-shell {
    grid-template-columns: var(--ag-sidebar-width) 1fr !important;
    transition: grid-template-columns .18s ease;
}

.ag-sidebar {
    width: var(--ag-sidebar-width) !important;
    transition: width .18s ease, transform .18s ease;
    overflow-x: hidden;
}

.ag-sidebar-toggle-desktop {
    display: inline-flex !important;
    margin-left: .25rem;
}

.ag-sidebar-close,
.ag-mobile-menu,
[data-sidebar-open],
[data-sidebar-close],
[data-sidebar-toggle] {
    display: none !important;
}

body.ag-sidebar-collapsed .ag-brand {
    justify-content: center;
    width: 100%;
}

body.ag-sidebar-collapsed .ag-brand-text,
body.ag-sidebar-collapsed .ag-nav-section,
body.ag-sidebar-collapsed .ag-nav-link span:not(.ag-nav-icon) {
    display: none !important;
}

body.ag-sidebar-collapsed .ag-sidebar {
    padding-left: .7rem;
    padding-right: .7rem;
}

body.ag-sidebar-collapsed .ag-nav {
    gap: .35rem;
    margin-top: .7rem;
}

body.ag-sidebar-collapsed .ag-nav-link {
    justify-content: center;
    padding: .72rem;
    min-height: 44px;
}

body.ag-sidebar-collapsed .ag-nav-icon {
    width: 22px;
    height: 22px;
}

@media (max-width: 991.98px) {
    :root {
        --ag-sidebar-width: var(--ag-sidebar-width-collapsed);
    }

    .ag-shell {
        grid-template-columns: var(--ag-sidebar-width-collapsed) 1fr !important;
    }

    .ag-sidebar {
        position: sticky !important;
        transform: none !important;
        width: var(--ag-sidebar-width-collapsed) !important;
        padding-left: .7rem;
        padding-right: .7rem;
        box-shadow: none;
    }

    .ag-sidebar .ag-brand {
        justify-content: center;
        width: 100%;
    }

    .ag-sidebar .ag-brand-text,
    .ag-sidebar .ag-nav-section,
    .ag-sidebar .ag-nav-link span:not(.ag-nav-icon) {
        display: none !important;
    }

    .ag-sidebar .ag-nav-link {
        justify-content: center;
        padding: .72rem;
        min-height: 44px;
    }
}

/* ==========================================================
   ARBORIAGEST - Fix topbar + sidebar toggle v013
   ========================================================== */

/*
 * La topbar vuelve a tener:
 * izquierda: título de página
 * centro: buscador
 * derecha: theme, notificaciones y usuario
 */
.ag-topbar {
    display: grid !important;
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 440px) minmax(260px, 1fr) !important;
    align-items: center !important;
    gap: 1rem !important;
}

.ag-page-title {
    justify-self: start !important;
    min-width: 0;
}

.ag-search {
    justify-self: center !important;
    width: min(440px, 100%) !important;
}

.ag-top-actions {
    justify-self: end !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: .65rem !important;
    min-width: max-content;
}

/*
 * Botón de contraer/expandir dentro del sidebar,
 * al lado del nombre de la aplicación.
 */
.ag-sidebar-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .65rem !important;
}

.ag-sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    background: var(--ag-surface);
    color: var(--ag-slate-600);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ag-sidebar-collapse-btn:hover {
    background: var(--ag-blue-50);
    color: var(--ag-blue-700);
    border-color: var(--ag-blue-100);
}

[data-bs-theme="dark"] .ag-sidebar-collapse-btn:hover {
    background: rgba(37, 99, 235, .18);
    color: #93C5FD;
}

/*
 * Oculta cualquier botón antiguo que haya quedado en la topbar.
 */
.ag-sidebar-toggle-desktop,
.ag-mobile-menu,
.ag-sidebar-close,
[data-sidebar-open],
[data-sidebar-close],
[data-sidebar-toggle] {
    display: none !important;
}

/*
 * En modo colapsado, el botón sigue visible junto al logo.
 */
body.ag-sidebar-collapsed .ag-sidebar-head {
    justify-content: center !important;
    flex-direction: column;
    gap: .7rem;
}

body.ag-sidebar-collapsed .ag-sidebar-collapse-btn {
    width: 38px;
    height: 38px;
}

body.ag-sidebar-collapsed .ag-brand-text {
    display: none !important;
}

/*
 * Responsive: mantenemos acciones a la derecha.
 */
@media (max-width: 991.98px) {
    .ag-topbar {
        grid-template-columns: minmax(120px, 1fr) auto !important;
    }

    .ag-search {
        display: none !important;
    }

    .ag-top-actions {
        grid-column: 2;
        justify-self: end !important;
    }

    .ag-page-title {
        grid-column: 1;
    }

    .ag-user-meta {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .ag-topbar {
        padding-left: .85rem !important;
        padding-right: .85rem !important;
        gap: .5rem !important;
    }

    .ag-top-actions {
        gap: .4rem !important;
    }

    .ag-icon-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================
   ARBORIAGEST - Sidebar toggle fix v014
   ========================================================== */

:root {
    --ag-sidebar-width-expanded: 272px;
    --ag-sidebar-width-collapsed: 82px;
    --ag-sidebar-width: var(--ag-sidebar-width-expanded);
}

body.ag-sidebar-collapsed {
    --ag-sidebar-width: var(--ag-sidebar-width-collapsed);
}

.ag-shell {
    grid-template-columns: var(--ag-sidebar-width) 1fr !important;
    transition: grid-template-columns .18s ease !important;
}

.ag-sidebar {
    width: var(--ag-sidebar-width) !important;
    min-width: var(--ag-sidebar-width) !important;
    max-width: var(--ag-sidebar-width) !important;
    overflow-x: hidden !important;
    transition: width .18s ease, min-width .18s ease, max-width .18s ease !important;
}

.ag-sidebar-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .6rem !important;
}

.ag-sidebar-collapse-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border: 1px solid var(--ag-border) !important;
    border-radius: var(--ag-radius-md) !important;
    background: var(--ag-surface) !important;
    color: var(--ag-slate-600) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 20 !important;
    padding: 0 !important;
}

.ag-sidebar-collapse-btn:hover {
    background: var(--ag-blue-50) !important;
    color: var(--ag-blue-700) !important;
    border-color: var(--ag-blue-100) !important;
}

body.ag-sidebar-collapsed .ag-sidebar-head {
    justify-content: center !important;
    flex-direction: column !important;
    gap: .7rem !important;
}

body.ag-sidebar-collapsed .ag-brand {
    justify-content: center !important;
    width: 100% !important;
}

body.ag-sidebar-collapsed .ag-brand-text {
    display: none !important;
}

body.ag-sidebar-collapsed .ag-nav-section {
    display: none !important;
}

body.ag-sidebar-collapsed .ag-nav {
    gap: .35rem !important;
    margin-top: .7rem !important;
}

body.ag-sidebar-collapsed .ag-nav-link {
    justify-content: center !important;
    padding: .72rem !important;
    min-height: 44px !important;
}

body.ag-sidebar-collapsed .ag-nav-link span:not(.ag-nav-icon) {
    display: none !important;
}

body.ag-sidebar-collapsed .ag-nav-icon {
    width: 22px !important;
    height: 22px !important;
    font-size: 1.2rem;
}

/*
 * Importante: no ocultar el botón nuevo.
 * Se ocultan solo los botones antiguos.
 */
.ag-sidebar-toggle-desktop,
.ag-mobile-menu,
.ag-sidebar-close,
[data-sidebar-open],
[data-sidebar-close],
[data-sidebar-toggle] {
    display: none !important;
}

@media (max-width: 991.98px) {
    .ag-shell {
        grid-template-columns: var(--ag-sidebar-width) 1fr !important;
    }

    .ag-sidebar {
        position: sticky !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ==========================================================
   ARBORIAGEST - Usuario topbar nombre + rol v015
   ========================================================== */

.ag-user-menu {
    min-height: 44px;
}

.ag-user-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: .12rem !important;
    line-height: 1.1 !important;
    max-width: 180px;
}

.ag-user-name {
    display: block !important;
    color: var(--ag-text) !important;
    font-size: .84rem !important;
    font-weight: var(--ag-font-weight-semibold, 600) !important;
    letter-spacing: -0.02em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 180px;
}

.ag-user-role {
    display: block !important;
    color: var(--ag-muted) !important;
    font-size: .72rem !important;
    font-weight: var(--ag-font-weight-regular, 400) !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 180px;
}

@media (max-width: 991.98px) {
    .ag-user-meta {
        display: none !important;
    }
}

/* ==========================================================
   ARBORIAGEST - SweetAlert2 style v016
   ========================================================== */

.swal2-popup {
    border-radius: var(--ag-radius-lg, 16px) !important;
    font-family: var(--ag-font-sans, system-ui, sans-serif) !important;
    box-shadow: var(--ag-shadow-lg, 0 18px 42px rgba(16, 24, 40, .10)) !important;
}

.swal2-title {
    font-weight: var(--ag-font-weight-semibold, 600) !important;
    letter-spacing: -0.035em !important;
}

.swal2-html-container {
    font-weight: var(--ag-font-weight-regular, 400) !important;
    color: var(--ag-muted, #64748B) !important;
}

.swal2-confirm,
.swal2-cancel {
    border-radius: var(--ag-radius-sm, 8px) !important;
    font-weight: var(--ag-font-weight-medium, 500) !important;
}

/* ==========================================================
   ARBORIAGEST - Tickets MVC full v019
   ========================================================== */

.ticket-description {
    color: var(--ag-text);
    line-height: 1.7;
    font-size: .94rem;
}

.ticket-comments {
    display: grid;
    gap: .8rem;
}

.ticket-comment {
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    background: var(--ag-surface-soft);
    padding: .85rem;
}

.ticket-activity-item {
    border-left: 2px solid var(--ag-blue-600);
    padding: .4rem .8rem;
    margin-bottom: .55rem;
    background: var(--ag-surface-soft);
    border-radius: 0 var(--ag-radius-sm) var(--ag-radius-sm) 0;
}

.ticket-detail-grid {
    display: grid;
    gap: .75rem;
}

.ticket-detail-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--ag-border);
    padding-bottom: .6rem;
}

.ticket-detail-grid span {
    color: var(--ag-muted);
    font-size: .78rem;
}

.ticket-detail-grid strong {
    text-align: right;
    font-size: .84rem;
}

.ticket-board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: .5rem;
}

.ticket-board-column {
    background: var(--ag-surface);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-lg);
    box-shadow: var(--ag-shadow-sm);
    min-height: 540px;
    display: flex;
    flex-direction: column;
}

.ticket-board-header {
    padding: .9rem;
    border-bottom: 1px solid var(--ag-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.ticket-board-list {
    padding: .75rem;
    display: grid;
    gap: .75rem;
}

.ticket-board-card {
    display: block;
    text-decoration: none;
    color: var(--ag-text);
    background: var(--ag-surface-soft);
    border: 1px solid var(--ag-border);
    border-radius: var(--ag-radius-md);
    padding: .85rem;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.ticket-board-card:hover {
    color: var(--ag-text);
    transform: translateY(-1px);
    border-color: var(--ag-blue-100);
    box-shadow: var(--ag-shadow-sm);
}

.ticket-board-summary {
    margin-top: .65rem;
    font-weight: var(--ag-font-weight-medium, 500);
    line-height: 1.35;
}

/* ==========================================================
   ARBORIAGEST - Dashboard tickets real only v021
   ========================================================== */

.ag-ticket-open-counter-fallback {
    margin-top: .35rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ag-text, #111827);
}

.ag-ticket-dashboard-real-panel {
    padding: 1rem;
}

.ag-ticket-dashboard-real-list {
    display: grid;
    gap: .65rem;
}

.ag-ticket-dashboard-real-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: .7rem;
    padding: .75rem;
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-md, 12px);
    background: var(--ag-surface-soft, #F8FAFC);
    color: var(--ag-text, #111827);
    text-decoration: none;
}

.ag-ticket-dashboard-real-item:hover {
    color: var(--ag-text, #111827);
    border-color: var(--ag-blue-100, #DBEAFE);
    box-shadow: var(--ag-shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
}

.ag-ticket-dashboard-real-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--ag-blue-600, #2563EB);
    margin-top: .32rem;
}

.ag-ticket-dashboard-real-content {
    min-width: 0;
    display: grid;
    gap: .15rem;
}

.ag-ticket-dashboard-real-title {
    font-weight: 600;
    font-size: .88rem;
}

.ag-ticket-dashboard-real-ticket {
    font-size: .82rem;
    color: var(--ag-text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-ticket-dashboard-real-meta {
    font-size: .76rem;
    color: var(--ag-muted, #64748B);
}

/* ==========================================================
   ARBORIAGEST - Dashboard real chart and logs v022
   ========================================================== */

.ag-real-ticket-chart {
    padding: 1rem;
}

.ag-real-ticket-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ag-real-ticket-chart-head strong {
    display: block;
    font-size: .95rem;
}

.ag-real-ticket-chart-head span {
    display: block;
    color: var(--ag-muted, #64748B);
    font-size: .78rem;
}

.ag-real-ticket-chart-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ag-text, #111827);
    line-height: 1;
}

.ag-real-ticket-chart-bars {
    display: grid;
    gap: .85rem;
}

.ag-real-ticket-chart-row {
    display: grid;
    gap: .35rem;
}

.ag-real-ticket-chart-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .84rem;
}

.ag-real-ticket-chart-track {
    height: 10px;
    border-radius: 999px;
    background: var(--ag-surface-soft, #F8FAFC);
    border: 1px solid var(--ag-border, #E5E7EB);
    overflow: hidden;
}

.ag-real-ticket-chart-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 3px;
}

.ag-ticket-dashboard-real-list {
    display: grid;
    gap: .65rem;
}

.ag-ticket-dashboard-real-item {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: .7rem;
    padding: .75rem;
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-md, 12px);
    background: var(--ag-surface-soft, #F8FAFC);
    color: var(--ag-text, #111827);
    text-decoration: none;
}

.ag-ticket-dashboard-real-item:hover {
    color: var(--ag-text, #111827);
    border-color: var(--ag-blue-100, #DBEAFE);
}

.ag-ticket-dashboard-real-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--ag-blue-600, #2563EB);
    margin-top: .32rem;
}

.ag-ticket-dashboard-real-content {
    min-width: 0;
    display: grid;
    gap: .15rem;
}

.ag-ticket-dashboard-real-title {
    font-weight: 600;
    font-size: .88rem;
}

.ag-ticket-dashboard-real-ticket {
    font-size: .82rem;
    color: var(--ag-text, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-ticket-dashboard-real-meta {
    font-size: .76rem;
    color: var(--ag-muted, #64748B);
}

.ag-log-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(5, minmax(140px, .75fr)) auto;
    gap: .65rem;
    margin-bottom: .8rem;
    align-items: center;
}

.ag-log-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ag-muted, #64748B);
    font-size: .82rem;
    margin-bottom: .75rem;
}

.ag-log-viewer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 1rem;
    min-height: 680px;
}

.ag-log-list {
    height: 680px;
    overflow: auto;
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-lg, 16px);
    background: var(--ag-surface, #fff);
}

.ag-log-line {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--ag-border, #E5E7EB);
    background: transparent;
    display: grid;
    grid-template-columns: 160px 72px 82px minmax(0, 1fr);
    gap: .7rem;
    padding: .65rem .8rem;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .78rem;
    color: var(--ag-text, #111827);
}

.ag-log-line:hover,
.ag-log-table-row:hover {
    background: var(--ag-surface-soft, #F8FAFC);
}

.ag-log-level {
    font-weight: 700;
}

.ag-log-source {
    color: var(--ag-muted, #64748B);
}

.ag-log-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-error {
    background: rgba(239, 68, 68, .08) !important;
}

.level-error .ag-log-level,
.level-error .ag-log-pill {
    color: #DC2626;
}

.level-warn {
    background: rgba(245, 158, 11, .10) !important;
}

.level-warn .ag-log-level,
.level-warn .ag-log-pill {
    color: #D97706;
}

.level-info .ag-log-level,
.level-info .ag-log-pill {
    color: #16A34A;
}

.level-debug {
    color: #64748B;
    background: rgba(100, 116, 139, .08) !important;
}

.ag-log-detail {
    height: 680px;
    overflow: auto;
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-lg, 16px);
    background: var(--ag-surface, #fff);
    padding: 1rem;
}

.ag-log-detail-empty {
    color: var(--ag-muted, #64748B);
    display: grid;
    place-items: center;
    height: 100%;
    text-align: center;
}

.ag-log-detail-head h3 {
    font-size: 1rem;
    margin: 0;
}

.ag-log-detail-head p {
    margin: .2rem 0 0;
    color: var(--ag-muted, #64748B);
    font-size: .8rem;
}

.ag-log-detail-message {
    margin: 1rem 0;
    padding: .8rem;
    border-radius: var(--ag-radius-md, 12px);
    background: var(--ag-surface-soft, #F8FAFC);
    font-weight: 600;
}

.ag-log-detail h4 {
    font-size: .86rem;
    margin-top: 1rem;
}

.ag-log-detail-field {
    border-bottom: 1px solid var(--ag-border, #E5E7EB);
    padding: .55rem 0;
}

.ag-log-detail-field strong {
    display: block;
    font-size: .78rem;
    color: var(--ag-muted, #64748B);
    margin-bottom: .25rem;
}

.ag-log-detail pre,
.ag-log-raw {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .78rem;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ag-log-mode-table {
    padding: 0;
}

.ag-log-table-row {
    cursor: pointer;
}

.ag-log-pill {
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    .ag-log-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .ag-log-viewer {
        grid-template-columns: 1fr;
    }

    .ag-log-detail {
        height: auto;
        min-height: 320px;
    }
}

/* ==========================================================
   ARBORIAGEST - Dashboard chart real v023
   ========================================================== */

.ag-dashboard-real-chart-anchor {
    display: block;
    margin: 1rem 0;
}

.ag-real-dashboard-chart-panel {
    background: var(--ag-surface, #fff);
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-lg, 16px);
    box-shadow: var(--ag-shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
    padding: 1rem;
}

.ag-real-dashboard-chart-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ag-real-dashboard-chart-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: var(--ag-text, #111827);
}

.ag-real-dashboard-chart-head p {
    margin: .25rem 0 0;
    color: var(--ag-muted, #64748B);
    font-size: .82rem;
}

.ag-real-dashboard-chart-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.ag-real-dashboard-chart-kpi {
    background: var(--ag-surface-soft, #F8FAFC);
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-md, 12px);
    padding: .85rem;
}

.ag-real-dashboard-chart-kpi span {
    display: block;
    color: var(--ag-muted, #64748B);
    font-size: .76rem;
    margin-bottom: .25rem;
}

.ag-real-dashboard-chart-kpi strong {
    display: inline-block;
    color: var(--ag-text, #111827);
    font-size: 1.65rem;
    line-height: 1;
    letter-spacing: -0.045em;
}

.ag-real-dashboard-chart-kpi small {
    margin-left: .35rem;
    color: var(--ag-muted, #64748B);
    font-size: .78rem;
}

.ag-real-dashboard-chart-bars {
    display: grid;
    gap: .85rem;
}

.ag-real-dashboard-chart-row {
    display: grid;
    gap: .38rem;
}

.ag-real-dashboard-chart-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: .86rem;
}

.ag-real-dashboard-chart-label span {
    color: var(--ag-text, #111827);
    font-weight: 500;
}

.ag-real-dashboard-chart-label strong {
    color: var(--ag-muted, #64748B);
    font-weight: 650;
}

.ag-real-dashboard-chart-track {
    height: 11px;
    border-radius: 999px;
    background: var(--ag-surface-soft, #F8FAFC);
    border: 1px solid var(--ag-border, #E5E7EB);
    overflow: hidden;
}

.ag-real-dashboard-chart-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 4px;
    transition: width .25s ease;
}

@media (max-width: 767.98px) {
    .ag-real-dashboard-chart-summary {
        grid-template-columns: 1fr;
    }

    .ag-real-dashboard-chart-head {
        flex-direction: column;
    }
}

/* ==========================================================
   ARBORIAGEST - Dashboard grid editor v025
   ========================================================== */

.ag-dashboard-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: var(--ag-surface, #fff);
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-lg, 16px);
    box-shadow: var(--ag-shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}

.ag-dashboard-editor-toolbar strong {
    display: block;
    font-size: .92rem;
    color: var(--ag-text, #111827);
}

.ag-dashboard-editor-toolbar span {
    display: block;
    color: var(--ag-muted, #64748B);
    font-size: .78rem;
    margin-top: .12rem;
}

.ag-dashboard-editor-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.ag-dashboard-layout-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 1rem;
    align-items: stretch;
}

.ag-dashboard-grid-item {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ag-dashboard-grid-item > .card,
.ag-dashboard-grid-item > .ag-panel,
.ag-dashboard-grid-item > .dashboard-card,
.ag-dashboard-grid-item > .stat-card,
.ag-dashboard-grid-item > .ag-kpi-card,
.ag-dashboard-grid-item > .ag-ticket-status-replace-panel,
.ag-dashboard-grid-item > .ag-real-dashboard-chart-panel {
    height: 100%;
    min-height: inherit;
}

.ag-dashboard-widget-controls {
    display: none;
    align-items: center;
    gap: .35rem;
    margin-bottom: .45rem;
    padding: .45rem;
    border: 1px dashed var(--ag-border, #CBD5E1);
    border-radius: var(--ag-radius-md, 12px);
    background: color-mix(in srgb, var(--ag-surface, #fff) 88%, #2563EB 12%);
}

.ag-dashboard-edit-mode .ag-dashboard-widget-controls {
    display: flex;
}

.ag-dashboard-widget-controls button {
    border: 1px solid var(--ag-border, #CBD5E1);
    background: var(--ag-surface, #fff);
    color: var(--ag-text, #111827);
    border-radius: 999px;
    padding: .25rem .5rem;
    font-size: .72rem;
    line-height: 1;
}

.ag-dashboard-widget-controls button:hover {
    border-color: var(--ag-blue-600, #2563EB);
    color: var(--ag-blue-600, #2563EB);
}

.ag-dashboard-widget-drag {
    cursor: grab;
    font-weight: 700;
}

.ag-dashboard-widget-title {
    min-width: 0;
    flex: 1;
    color: var(--ag-muted, #64748B);
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-dashboard-edit-mode .ag-dashboard-grid-item {
    outline: 1px dashed color-mix(in srgb, var(--ag-blue-600, #2563EB) 45%, transparent);
    outline-offset: 4px;
    border-radius: var(--ag-radius-lg, 16px);
}

.ag-dashboard-grid-item.is-dragging {
    opacity: .45;
    transform: scale(.985);
}

.ag-dashboard-grid-item.is-drag-over {
    outline: 2px solid var(--ag-blue-600, #2563EB);
    outline-offset: 5px;
}

.ag-dashboard-panel-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 92vw);
    height: 100vh;
    background: var(--ag-surface, #fff);
    border-left: 1px solid var(--ag-border, #E5E7EB);
    box-shadow: -20px 0 60px rgba(15, 23, 42, .18);
    z-index: 1080;
    transform: translateX(105%);
    transition: transform .2s ease;
    display: flex;
    flex-direction: column;
}

.ag-dashboard-panel-drawer-open .ag-dashboard-panel-drawer {
    transform: translateX(0);
}

.ag-dashboard-panel-drawer-head {
    padding: 1rem;
    border-bottom: 1px solid var(--ag-border, #E5E7EB);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.ag-dashboard-panel-drawer-head strong {
    display: block;
    font-size: .98rem;
}

.ag-dashboard-panel-drawer-head span {
    display: block;
    color: var(--ag-muted, #64748B);
    font-size: .78rem;
    margin-top: .15rem;
}

.ag-dashboard-panel-drawer-body {
    padding: 1rem;
    overflow: auto;
    display: grid;
    gap: .65rem;
}

.ag-dashboard-panel-toggle {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: .65rem;
    align-items: flex-start;
    border: 1px solid var(--ag-border, #E5E7EB);
    border-radius: var(--ag-radius-md, 12px);
    padding: .75rem;
    background: var(--ag-surface-soft, #F8FAFC);
    cursor: pointer;
}

.ag-dashboard-panel-toggle strong {
    display: block;
    font-size: .86rem;
    color: var(--ag-text, #111827);
}

.ag-dashboard-panel-toggle small {
    display: block;
    margin-top: .15rem;
    color: var(--ag-muted, #64748B);
    font-size: .72rem;
}

@media (max-width: 1399.98px) {
    .ag-dashboard-layout-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .ag-dashboard-grid-item {
        grid-column: span min(8, attr(data-cols number));
    }
}

@media (max-width: 991.98px) {
    .ag-dashboard-editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ag-dashboard-layout-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ag-dashboard-grid-item {
        grid-column: span 4 !important;
    }
}

@media (max-width: 575.98px) {
    .ag-dashboard-layout-grid {
        grid-template-columns: 1fr;
    }

    .ag-dashboard-grid-item {
        grid-column: span 1 !important;
    }

    .ag-dashboard-widget-controls {
        flex-wrap: wrap;
    }
}

/* ==========================================================
   ARBORIAGEST - Dashboard editor user menu v026
   ========================================================== */

.ag-dashboard-editor-toolbar {
    display: none !important;
}

.ag-dashboard-editor-dock[hidden] {
    display: none !important;
}

.ag-dashboard-editor-dock {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: 0 0 1rem 0;
    padding: .75rem 1rem;
    background: color-mix(in srgb, var(--ag-surface, #fff) 94%, #2563EB 6%);
    border-bottom: 1px solid var(--ag-border, #E5E7EB);
    box-shadow: var(--ag-shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
}

.ag-dashboard-editor-dock-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.ag-dashboard-editor-dock strong {
    display: block;
    font-size: .92rem;
    color: var(--ag-text, #111827);
}

.ag-dashboard-editor-dock span {
    display: block;
    color: var(--ag-muted, #64748B);
    font-size: .78rem;
    margin-top: .12rem;
}

.ag-dashboard-editor-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.ag-dashboard-widget-controls {
    display: none !important;
}

.ag-dashboard-edit-mode .ag-dashboard-widget-controls {
    display: flex !important;
}

.ag-dashboard-edit-mode .ag-dashboard-grid-item {
    outline: 1px dashed color-mix(in srgb, var(--ag-blue-600, #2563EB) 45%, transparent);
    outline-offset: 4px;
    border-radius: var(--ag-radius-lg, 16px);
}

@media (max-width: 991.98px) {
    .ag-dashboard-editor-dock-inner {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================
   ARBORIAGEST - Dashboard persistence v027
   ========================================================== */

.ag-dashboard-editor-dock span::after {
    content: " Guardado por usuario.";
    color: var(--ag-blue-600, #2563EB);
    font-weight: 500;
}


/* ==========================================================
   ARBORIAGEST - Dashboard footer final position v036
   ========================================================== */

/*
 * El contenido del dashboard mantiene un flujo vertical normal.
 */
body.ag-dashboard .ag-main > .ag-content {
    display: flex !important;
    flex-direction: column !important;
}

/*
 * La cuadrícula nunca debe absorber ni contener el footer.
 */
body.ag-dashboard #agDashboardLayoutGrid {
    flex: 0 0 auto !important;
    order: 20 !important;
}

/*
 * Footer recolocado por JavaScript como último hijo de .ag-content.
 */
body.ag-dashboard .ag-content > .ag-app-footer,
body.ag-dashboard .ag-dashboard-footer-final {
    position: static !important;
    order: 2147483647 !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    clear: both !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: .32rem !important;

    width: 100% !important;
    max-width: none !important;
    min-height: 28px !important;

    margin: .7rem 0 0 !important;
    padding: .38rem .65rem !important;

    border: 0 !important;
    border-top: 1px solid var(--ag-border, #E5E7EB) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;

    color: var(--ag-muted, #64748B) !important;
    font-size: .7rem !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    text-align: center !important;

    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    float: none !important;
    z-index: auto !important;
    box-sizing: border-box !important;
}

body.ag-dashboard .ag-app-footer span:first-child {
    color: var(--ag-text, #111827) !important;
    font-weight: 650 !important;
}

body.ag-dashboard .ag-app-footer-sep {
    color: var(--ag-border-strong, #CBD5E1) !important;
}

/*
 * Evita que una regla global de footer fijo o absoluto tenga efecto
 * mientras se carga y antes de que JavaScript lo recoloque.
 */
body.ag-dashboard .ag-app-footer {
    position: static !important;
    inset: auto !important;
    float: none !important;
}

/*
 * Barra superior sin los márgenes del contenido.
 */
body.ag-dashboard .ag-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.ag-dashboard .ag-main > .ag-topbar {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
}

/*
 * Espaciado únicamente dentro del contenido.
 */
body.ag-dashboard .ag-main > .ag-content {
    padding-left: clamp(1rem, 1.35vw, 1.45rem) !important;
    padding-right: clamp(1rem, 1.35vw, 1.45rem) !important;
}

body.ag-dashboard .ag-dashboard-layout-grid {
    gap: .62rem !important;
}

@media (max-width: 991.98px) {
    body.ag-dashboard .ag-main > .ag-content {
        padding-left: .8rem !important;
        padding-right: .8rem !important;
    }

    body.ag-dashboard .ag-content > .ag-app-footer,
    body.ag-dashboard .ag-dashboard-footer-final {
        font-size: .68rem !important;
        padding: .36rem .5rem !important;
    }
}


/* ==========================================================
   ARBORIAGEST - Button design laboratory v039
   ========================================================== */

.ag-button-lab {
    display: grid;
    gap: 1rem;
}

.ag-button-lab-intro {
    padding: 1rem 1.1rem;
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            rgba(37, 99, 235, .06),
            rgba(255, 255, 255, .94)
        );
}

.ag-button-lab-intro strong,
.ag-button-lab-intro span {
    display: block;
}

.ag-button-lab-intro strong {
    color: var(--ag-text, #111827);
    font-size: .95rem;
}

.ag-button-lab-intro span {
    margin-top: .2rem;
    color: var(--ag-muted, #64748b);
    font-size: .82rem;
}

.ag-button-design-card {
    overflow: hidden;
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 16px;
    background: var(--ag-surface, #fff);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .045);
}

.ag-button-design-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-button-design-header h3 {
    margin: .15rem 0 .25rem;
    color: var(--ag-text, #111827);
    font-size: 1rem;
}

.ag-button-design-header p {
    max-width: 760px;
    margin: 0;
    color: var(--ag-muted, #64748b);
    font-size: .8rem;
}

.ag-button-design-number {
    color: #2563eb;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .12em;
}

.ag-button-design-tag {
    flex: 0 0 auto;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .68rem;
    font-weight: 700;
}

.ag-button-preview {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
    padding: 1.4rem 1.1rem;
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, .82),
            rgba(255, 255, 255, .94)
        );
}

.ag-button-preview .ag-demo-btn {
    border: 0;
    font-family: inherit;
    cursor: pointer;
}

/* ----------------------------------------------------------
   01 - CORPORATIVO SOBRIO
   ---------------------------------------------------------- */

.ag-buttons-corporate .ag-demo-btn {
    min-height: 38px;
    padding: .55rem .9rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: .8rem;
    font-weight: 650;
    transition:
        background-color .14s ease,
        border-color .14s ease,
        box-shadow .14s ease,
        transform .14s ease;
}

.ag-buttons-corporate .ag-demo-btn:hover {
    transform: translateY(-1px);
}

.ag-buttons-corporate .ag-demo-primary {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 3px 8px rgba(37, 99, 235, .2);
}

.ag-buttons-corporate .ag-demo-primary:hover {
    background: #1d4ed8;
}

.ag-buttons-corporate .ag-demo-secondary {
    color: #334155;
    border-color: #cbd5e1;
    background: #fff;
}

.ag-buttons-corporate .ag-demo-success {
    color: #fff;
    background: #059669;
}

.ag-buttons-corporate .ag-demo-warning {
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb;
}

.ag-buttons-corporate .ag-demo-danger {
    color: #fff;
    background: #dc2626;
}

.ag-buttons-corporate .ag-demo-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    color: #334155;
    border-color: #cbd5e1;
    background: #fff;
}

/* ----------------------------------------------------------
   02 - GEOMÉTRICO ARBORIA
   ---------------------------------------------------------- */

.ag-buttons-geometric .ag-demo-btn {
    position: relative;
    min-height: 40px;
    padding: .58rem 1rem .58rem 1.15rem;
    clip-path:
        polygon(
            8px 0,
            100% 0,
            100% calc(100% - 8px),
            calc(100% - 8px) 100%,
            0 100%,
            0 8px
        );
    border: 0;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .01em;
    transition:
        transform .15s ease,
        filter .15s ease;
}

.ag-buttons-geometric .ag-demo-btn::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, .42);
}

.ag-buttons-geometric .ag-demo-btn:hover {
    transform: translateY(-2px);
    filter: brightness(.96);
}

.ag-buttons-geometric .ag-demo-primary {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

.ag-buttons-geometric .ag-demo-secondary {
    color: #1e293b;
    background: #e2e8f0;
}

.ag-buttons-geometric .ag-demo-secondary::before {
    background: #64748b;
}

.ag-buttons-geometric .ag-demo-success {
    color: #fff;
    background: linear-gradient(135deg, #10b981, #047857);
}

.ag-buttons-geometric .ag-demo-warning {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #b45309);
}

.ag-buttons-geometric .ag-demo-danger {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #991b1b);
}

.ag-buttons-geometric .ag-demo-icon {
    width: 40px;
    padding: 0;
    color: #fff;
    background: #334155;
}

/* ----------------------------------------------------------
   03 - SOFT UI
   ---------------------------------------------------------- */

.ag-buttons-soft .ag-demo-btn {
    min-height: 40px;
    padding: .58rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 650;
    box-shadow:
        0 5px 14px rgba(15, 23, 42, .055),
        inset 0 1px 0 rgba(255, 255, 255, .7);
    transition:
        transform .14s ease,
        box-shadow .14s ease;
}

.ag-buttons-soft .ag-demo-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, .08),
        inset 0 1px 0 rgba(255, 255, 255, .8);
}

.ag-buttons-soft .ag-demo-primary {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.ag-buttons-soft .ag-demo-secondary {
    color: #475569;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.ag-buttons-soft .ag-demo-success {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.ag-buttons-soft .ag-demo-warning {
    color: #b45309;
    border-color: #fde68a;
    background: #fffbeb;
}

.ag-buttons-soft .ag-demo-danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.ag-buttons-soft .ag-demo-icon {
    width: 40px;
    padding: 0;
    color: #475569;
    border-color: #e2e8f0;
    background: #f8fafc;
}

/* ----------------------------------------------------------
   04 - COMPACTO TÉCNICO
   ---------------------------------------------------------- */

.ag-buttons-technical .ag-demo-btn {
    min-height: 31px;
    padding: .38rem .68rem;
    border: 1px solid;
    border-radius: 5px;
    font-family:
        "IBM Plex Sans",
        system-ui,
        sans-serif;
    font-size: .72rem;
    font-weight: 650;
    letter-spacing: .015em;
    text-transform: uppercase;
    box-shadow: none;
    transition:
        background-color .1s ease,
        border-color .1s ease;
}

.ag-buttons-technical .ag-demo-primary {
    color: #fff;
    border-color: #1d4ed8;
    background: #2563eb;
}

.ag-buttons-technical .ag-demo-secondary {
    color: #334155;
    border-color: #94a3b8;
    background: #fff;
}

.ag-buttons-technical .ag-demo-success {
    color: #fff;
    border-color: #047857;
    background: #059669;
}

.ag-buttons-technical .ag-demo-warning {
    color: #78350f;
    border-color: #f59e0b;
    background: #fef3c7;
}

.ag-buttons-technical .ag-demo-danger {
    color: #fff;
    border-color: #b91c1c;
    background: #dc2626;
}

.ag-buttons-technical .ag-demo-icon {
    width: 31px;
    padding: 0;
    color: #334155;
    border-color: #94a3b8;
    background: #fff;
}

/* ----------------------------------------------------------
   05 - PREMIUM MINIMAL
   ---------------------------------------------------------- */

.ag-buttons-premium .ag-demo-btn {
    position: relative;
    min-height: 39px;
    padding: .55rem .9rem;
    border: 1px solid;
    border-radius: 10px;
    background: transparent;
    font-size: .8rem;
    font-weight: 650;
    overflow: hidden;
    transition:
        color .18s ease,
        background-color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}

.ag-buttons-premium .ag-demo-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: translateX(-50%);
    transition: width .18s ease;
}

.ag-buttons-premium .ag-demo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(15, 23, 42, .08);
}

.ag-buttons-premium .ag-demo-btn:hover::after {
    width: 22px;
}

.ag-buttons-premium .ag-demo-primary {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: rgba(239, 246, 255, .55);
}

.ag-buttons-premium .ag-demo-secondary {
    color: #475569;
    border-color: #cbd5e1;
    background: rgba(248, 250, 252, .6);
}

.ag-buttons-premium .ag-demo-success {
    color: #047857;
    border-color: #6ee7b7;
    background: rgba(236, 253, 245, .6);
}

.ag-buttons-premium .ag-demo-warning {
    color: #b45309;
    border-color: #fcd34d;
    background: rgba(255, 251, 235, .65);
}

.ag-buttons-premium .ag-demo-danger {
    color: #b91c1c;
    border-color: #fca5a5;
    background: rgba(254, 242, 242, .65);
}

.ag-buttons-premium .ag-demo-icon {
    width: 39px;
    padding: 0;
    color: #475569;
    border-color: #cbd5e1;
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 767.98px) {
    .ag-button-design-header {
        flex-direction: column;
    }

    .ag-button-preview {
        align-items: stretch;
    }

    .ag-button-preview .ag-demo-btn:not(.ag-demo-icon) {
        flex: 1 1 145px;
    }
}


/* ==========================================================
   ARBORIAGEST - Premium minimal buttons global v040
   ========================================================== */

:root {
    --ag-btn-blue: #2563eb;
    --ag-btn-blue-dark: #1d4ed8;
    --ag-btn-blue-soft: #eff6ff;

    --ag-btn-green: #047857;
    --ag-btn-green-soft: #ecfdf5;

    --ag-btn-amber: #b45309;
    --ag-btn-amber-soft: #fffbeb;

    --ag-btn-red: #b91c1c;
    --ag-btn-red-soft: #fef2f2;

    --ag-btn-slate: #475569;
    --ag-btn-slate-soft: #f8fafc;

    --ag-btn-radius: 10px;
    --ag-btn-border: #cbd5e1;
    --ag-btn-shadow-hover: 0 7px 18px rgba(15, 23, 42, .09);
}

/* ----------------------------------------------------------
   BASE
   ---------------------------------------------------------- */

.btn {
    --bs-btn-font-family: inherit;

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;

    min-height: 38px;
    padding: .54rem .9rem;

    border-width: 1px;
    border-style: solid;
    border-radius: var(--ag-btn-radius);

    font-size: .8rem;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: .004em;

    box-shadow: none;
    overflow: hidden;

    transition:
        color .16s ease,
        background-color .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

/*
 * Línea inferior distintiva del estilo Premium Minimal.
 */
.btn::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;

    width: 0;
    height: 2px;

    border-radius: 999px;
    background: currentColor;
    opacity: .8;

    transform: translateX(-50%);
    transition: width .16s ease;
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--ag-btn-shadow-hover);
}

.btn:hover::after,
.btn:focus-visible::after,
.btn.active::after,
.btn.show::after {
    width: 22px;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .08);
}

.btn:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
    opacity: .5;
    transform: none !important;
    box-shadow: none !important;
}

.btn:disabled::after,
.btn.disabled::after {
    width: 0 !important;
}

/* ----------------------------------------------------------
   PRIMARY
   ---------------------------------------------------------- */

.btn-primary {
    color: var(--ag-btn-blue-dark);
    border-color: #93c5fd;
    background: rgba(239, 246, 255, .78);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary.show {
    color: #fff;
    border-color: var(--ag-btn-blue);
    background: var(--ag-btn-blue);
}

/* ----------------------------------------------------------
   SECONDARY
   ---------------------------------------------------------- */

.btn-secondary {
    color: #334155;
    border-color: var(--ag-btn-border);
    background: rgba(248, 250, 252, .82);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-secondary.active,
.btn-secondary.show {
    color: #fff;
    border-color: #475569;
    background: #475569;
}

/* ----------------------------------------------------------
   SUCCESS
   ---------------------------------------------------------- */

.btn-success {
    color: var(--ag-btn-green);
    border-color: #6ee7b7;
    background: rgba(236, 253, 245, .78);
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.btn-success.show {
    color: #fff;
    border-color: var(--ag-btn-green);
    background: var(--ag-btn-green);
}

/* ----------------------------------------------------------
   WARNING
   ---------------------------------------------------------- */

.btn-warning {
    color: var(--ag-btn-amber);
    border-color: #fcd34d;
    background: rgba(255, 251, 235, .82);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.btn-warning.active,
.btn-warning.show {
    color: #fff;
    border-color: var(--ag-btn-amber);
    background: var(--ag-btn-amber);
}

/* ----------------------------------------------------------
   DANGER
   ---------------------------------------------------------- */

.btn-danger {
    color: var(--ag-btn-red);
    border-color: #fca5a5;
    background: rgba(254, 242, 242, .82);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.btn-danger.show {
    color: #fff;
    border-color: var(--ag-btn-red);
    background: var(--ag-btn-red);
}

/* ----------------------------------------------------------
   INFO
   ---------------------------------------------------------- */

.btn-info {
    color: #0369a1;
    border-color: #7dd3fc;
    background: rgba(240, 249, 255, .82);
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.btn-info.active,
.btn-info.show {
    color: #fff;
    border-color: #0284c7;
    background: #0284c7;
}

/* ----------------------------------------------------------
   LIGHT / DARK
   ---------------------------------------------------------- */

.btn-light {
    color: #334155;
    border-color: #e2e8f0;
    background: rgba(255, 255, 255, .9);
}

.btn-light:hover,
.btn-light:focus {
    color: #0f172a;
    border-color: #cbd5e1;
    background: #f8fafc;
}

.btn-dark {
    color: #fff;
    border-color: #1e293b;
    background: #1e293b;
}

.btn-dark:hover,
.btn-dark:focus {
    color: #fff;
    border-color: #0f172a;
    background: #0f172a;
}

/* ----------------------------------------------------------
   OUTLINE
   ---------------------------------------------------------- */

.btn-outline-primary {
    color: var(--ag-btn-blue-dark);
    border-color: #93c5fd;
    background: rgba(239, 246, 255, .42);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
    color: #fff;
    border-color: var(--ag-btn-blue);
    background: var(--ag-btn-blue);
}

.btn-outline-secondary {
    color: var(--ag-btn-slate);
    border-color: var(--ag-btn-border);
    background: rgba(248, 250, 252, .58);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary.active {
    color: #fff;
    border-color: var(--ag-btn-slate);
    background: var(--ag-btn-slate);
}

.btn-outline-success {
    color: var(--ag-btn-green);
    border-color: #6ee7b7;
    background: rgba(236, 253, 245, .48);
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success.active {
    color: #fff;
    border-color: var(--ag-btn-green);
    background: var(--ag-btn-green);
}

.btn-outline-warning {
    color: var(--ag-btn-amber);
    border-color: #fcd34d;
    background: rgba(255, 251, 235, .48);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus,
.btn-outline-warning.active {
    color: #fff;
    border-color: var(--ag-btn-amber);
    background: var(--ag-btn-amber);
}

.btn-outline-danger {
    color: var(--ag-btn-red);
    border-color: #fca5a5;
    background: rgba(254, 242, 242, .5);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger.active {
    color: #fff;
    border-color: var(--ag-btn-red);
    background: var(--ag-btn-red);
}

.btn-outline-info {
    color: #0369a1;
    border-color: #7dd3fc;
    background: rgba(240, 249, 255, .48);
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info.active {
    color: #fff;
    border-color: #0284c7;
    background: #0284c7;
}

.btn-outline-dark {
    color: #1e293b;
    border-color: #94a3b8;
    background: rgba(248, 250, 252, .5);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-dark.active {
    color: #fff;
    border-color: #1e293b;
    background: #1e293b;
}

/* ----------------------------------------------------------
   TAMAÑOS
   ---------------------------------------------------------- */

.btn-sm {
    min-height: 32px;
    padding: .4rem .68rem;
    border-radius: 8px;
    font-size: .74rem;
}

.btn-lg {
    min-height: 46px;
    padding: .7rem 1.15rem;
    border-radius: 12px;
    font-size: .9rem;
}

.btn-sm::after {
    bottom: 3px;
    height: 1.5px;
}

.btn-lg::after {
    bottom: 5px;
}

/* ----------------------------------------------------------
   ICONOS
   ---------------------------------------------------------- */

.btn-icon,
.ag-icon-btn,
button[class*="icon-btn"] {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
}

.btn-icon.btn-sm,
.ag-icon-btn.btn-sm {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
}

.btn-icon.btn-lg,
.ag-icon-btn.btn-lg {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
}

/* ----------------------------------------------------------
   GRUPOS
   ---------------------------------------------------------- */

.btn-group {
    gap: 3px;
}

.btn-group > .btn {
    border-radius: 8px !important;
}

.btn-group > .btn:first-child {
    border-radius: 10px 7px 7px 10px !important;
}

.btn-group > .btn:last-child {
    border-radius: 7px 10px 10px 7px !important;
}

/* ----------------------------------------------------------
   DASHBOARD EDITOR
   ---------------------------------------------------------- */

.ag-dashboard-widget-controls button {
    position: relative;
    min-height: 28px;
    padding: .32rem .52rem;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    color: #475569;
    background: rgba(248, 250, 252, .9);

    font-family: inherit;
    font-size: .69rem;
    font-weight: 650;

    box-shadow: none;
    transition:
        color .14s ease,
        background-color .14s ease,
        border-color .14s ease,
        transform .14s ease;
}

.ag-dashboard-widget-controls button:hover {
    color: #fff;
    border-color: var(--ag-btn-blue);
    background: var(--ag-btn-blue);
    transform: translateY(-1px);
}

/*
 * El botón de ocultar mantiene semántica de peligro.
 */
.ag-dashboard-widget-controls button[data-ag-hide-widget]:hover {
    border-color: var(--ag-btn-red);
    background: var(--ag-btn-red);
}

/* ----------------------------------------------------------
   SIDEBAR COLLAPSE
   ---------------------------------------------------------- */

.ag-sidebar-collapse-btn {
    border: 1px solid rgba(148, 163, 184, .32) !important;
    border-radius: 9px !important;
    background: rgba(255, 255, 255, .07) !important;
    box-shadow: none !important;
}

.ag-sidebar-collapse-btn::after {
    display: none !important;
}

.ag-sidebar-collapse-btn:hover {
    border-color: rgba(255, 255, 255, .34) !important;
    background: rgba(255, 255, 255, .14) !important;
}

/* ----------------------------------------------------------
   DROPDOWNS
   ---------------------------------------------------------- */

.dropdown-menu .btn,
.dropdown-item.btn {
    width: 100%;
    min-height: auto;
    justify-content: flex-start;

    padding: .55rem .72rem;

    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
}

.dropdown-menu .btn::after,
.dropdown-item.btn::after {
    display: none;
}

.dropdown-menu .btn:hover,
.dropdown-item.btn:hover {
    transform: none;
    box-shadow: none;
}

/* ----------------------------------------------------------
   BOTONES DE TABLAS
   ---------------------------------------------------------- */

.table .btn,
.dataTable .btn {
    min-height: 31px;
    padding: .38rem .6rem;
    border-radius: 8px;
    font-size: .72rem;
}

.table .btn::after,
.dataTable .btn::after {
    bottom: 2px;
}

/* ----------------------------------------------------------
   MODO OSCURO
   ---------------------------------------------------------- */

[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
body.ag-theme-dark .btn-secondary,
body.ag-theme-dark .btn-outline-secondary,
body.dark-mode .btn-secondary,
body.dark-mode .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
    background: rgba(30, 41, 59, .72);
}

[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
body.ag-theme-dark .btn-secondary:hover,
body.ag-theme-dark .btn-outline-secondary:hover,
body.dark-mode .btn-secondary:hover,
body.dark-mode .btn-outline-secondary:hover {
    color: #fff;
    border-color: #64748b;
    background: #475569;
}

[data-bs-theme="dark"] .btn-light,
body.ag-theme-dark .btn-light,
body.dark-mode .btn-light {
    color: #e2e8f0;
    border-color: #475569;
    background: rgba(30, 41, 59, .8);
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 575.98px) {
    .btn {
        min-height: 36px;
        padding: .5rem .76rem;
    }

    .btn-sm {
        min-height: 31px;
        padding: .38rem .6rem;
    }
}


/* ==========================================================
   ARBORIAGEST - Footer global v041
   ========================================================== */

.ag-app-footer,
#agAppFooter,
footer.ag-app-footer {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .45rem 1rem;
    font-size: .72rem;
    color: #94a3b8;
    background: transparent;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

[data-bs-theme="dark"] .ag-app-footer {
    color: #64748b;
    border-top-color: #1f2937;
}

.ag-login-shell .ag-app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: none;
    margin-top: 0;
    padding: .55rem 1rem;
    font-size: .72rem;
    color: #94a3b8;
    background: transparent;
    z-index: 10;
}


/* ==========================================================
   ARBORIAGEST - Dashboard body margins v042
   ========================================================== */

body.ag-dashboard {
    --ag-dashboard-body-margin-x: clamp(1.5rem, 2vw, 2.25rem);
    --ag-dashboard-panel-gap: .7rem;
}

/*
 * No se aplica padding a .ag-main porque contiene la barra superior.
 * Así la topbar sigue ocupando todo el ancho disponible.
 */
body.ag-dashboard .ag-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/*
 * Márgenes interiores simétricos en el cuerpo real del dashboard.
 */
body.ag-dashboard .ag-main > .ag-content {
    width: 100% !important;
    max-width: none !important;

    padding-left: var(--ag-dashboard-body-margin-x) !important;
    padding-right: var(--ag-dashboard-body-margin-x) !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    box-sizing: border-box !important;
}

/*
 * La cabecera y el editor ocupan exactamente el ancho interior.
 */
body.ag-dashboard .ag-page-head,
body.ag-dashboard .ag-dashboard-editor-dock {
    width: 100% !important;
    max-width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    box-sizing: border-box !important;
}

/*
 * La cuadrícula respeta el mismo margen izquierdo y derecho.
 */
body.ag-dashboard #agDashboardLayoutGrid,
body.ag-dashboard .ag-dashboard-layout-grid {
    width: 100% !important;
    max-width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    gap: var(--ag-dashboard-panel-gap) !important;
    box-sizing: border-box !important;
}

/*
 * Evita que los paneles introduzcan márgenes propios
 * y rompan la simetría exterior.
 */
body.ag-dashboard
#agDashboardLayoutGrid > [data-dashboard-widget],
body.ag-dashboard
.ag-dashboard-layout-grid > [data-dashboard-widget],
body.ag-dashboard
.ag-dashboard-grid-item {
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/*
 * El contenido visual de cada panel ocupa todo el ancho asignado.
 */
body.ag-dashboard
#agDashboardLayoutGrid > [data-dashboard-widget] > *,
body.ag-dashboard
.ag-dashboard-layout-grid > [data-dashboard-widget] > *,
body.ag-dashboard
.ag-dashboard-grid-item > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/*
 * La barra superior permanece fuera de estos márgenes.
 */
body.ag-dashboard .ag-main > .ag-topbar {
    width: 100% !important;
    max-width: none !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    transform: none !important;
    box-sizing: border-box !important;
}

/*
 * Resoluciones intermedias.
 */
@media (max-width: 1199.98px) {
    body.ag-dashboard {
        --ag-dashboard-body-margin-x: 1.35rem;
    }
}

/*
 * Tablets y menú lateral móvil.
 */
@media (max-width: 991.98px) {
    body.ag-dashboard {
        --ag-dashboard-body-margin-x: 1rem;
        --ag-dashboard-panel-gap: .62rem;
    }
}

/*
 * Móviles.
 */
@media (max-width: 575.98px) {
    body.ag-dashboard {
        --ag-dashboard-body-margin-x: .75rem;
        --ag-dashboard-panel-gap: .55rem;
    }
}


/* ==========================================================
   ARBORIAGEST - Dashboard grid real margins v043
   ========================================================== */

body.ag-dashboard {
    /*
     * El margen exterior y la separación entre paneles usan
     * exactamente el mismo valor.
     */
    --ag-dashboard-grid-gap-v043: 12px;
}

/*
 * El main y la topbar permanecen a ancho completo.
 */
body.ag-dashboard .ag-main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

body.ag-dashboard .ag-main > .ag-topbar {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/*
 * Se elimina el padding anterior del contenedor porque el margen
 * se aplicará directamente sobre la cuadrícula real.
 */
body.ag-dashboard .ag-main > .ag-content {
    width: 100% !important;
    max-width: 100% !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    box-sizing: border-box !important;
}

/*
 * Corrección principal:
 *
 * - 12 px entre menú lateral y primer panel.
 * - 12 px entre el último panel y el borde derecho.
 * - 12 px entre paneles.
 */
body.ag-dashboard #agDashboardLayoutGrid,
body.ag-dashboard .ag-dashboard-layout-grid {
    width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043))) !important;
    max-width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043))) !important;

    margin-left: var(--ag-dashboard-grid-gap-v043) !important;
    margin-right: var(--ag-dashboard-grid-gap-v043) !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    gap: var(--ag-dashboard-grid-gap-v043) !important;

    box-sizing: border-box !important;
}

/*
 * Evita que el primer o último panel introduzcan desplazamientos
 * o sobresalgan fuera de la cuadrícula.
 */
body.ag-dashboard
#agDashboardLayoutGrid > [data-dashboard-widget],
body.ag-dashboard
.ag-dashboard-layout-grid > [data-dashboard-widget] {
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    box-sizing: border-box !important;
}

/*
 * Los paneles internos ocupan exactamente el espacio de su celda.
 */
body.ag-dashboard
#agDashboardLayoutGrid > [data-dashboard-widget] > *,
body.ag-dashboard
.ag-dashboard-layout-grid > [data-dashboard-widget] > * {
    width: 100% !important;
    max-width: 100% !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    box-sizing: border-box !important;
}

/*
 * La cabecera del dashboard y la barra de personalización respetan
 * el mismo margen exterior que los paneles.
 */
body.ag-dashboard .ag-page-head,
body.ag-dashboard .ag-dashboard-editor-dock {
    width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043))) !important;
    max-width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043))) !important;

    margin-left: var(--ag-dashboard-grid-gap-v043) !important;
    margin-right: var(--ag-dashboard-grid-gap-v043) !important;

    box-sizing: border-box !important;
}

/*
 * En móvil se mantiene una separación ligeramente menor,
 * pero continúa siendo simétrica.
 */
@media (max-width: 575.98px) {
    body.ag-dashboard {
        --ag-dashboard-grid-gap-v043: 8px;
    }
}


/* ==========================================================
   ARBORIAGEST - Dashboard compact header v044
   ========================================================== */

/*
 * Reduce al mínimo el espacio superior del cuerpo del dashboard.
 * No afecta a la topbar.
 */
body.ag-dashboard .ag-main > .ag-content {
    padding-top: 8px !important;
    margin-top: 0 !important;
}

/*
 * Encabezado compacto, alineado exactamente con los paneles.
 * Utiliza el mismo margen de 12 px definido en el Update 043.
 */
body.ag-dashboard .ag-dashboard-page-header {
    width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043, 12px))) !important;
    max-width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043, 12px))) !important;

    margin:
        0
        var(--ag-dashboard-grid-gap-v043, 12px)
        8px !important;

    padding: 0 !important;
    box-sizing: border-box !important;
}

.ag-dashboard-page-header__identity {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 42px;
}

.ag-dashboard-page-header__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    border: 1px solid #bfdbfe;
    border-radius: 10px;

    color: #2563eb;
    background: rgba(239, 246, 255, .8);
}

.ag-dashboard-page-header h1 {
    margin: 0;
    color: var(--ag-text, #0f172a);
    font-size: 1.08rem;
    font-weight: 720;
    line-height: 1.15;
    letter-spacing: -.015em;
}

.ag-dashboard-page-header p {
    margin: .12rem 0 0;
    color: var(--ag-muted, #64748b);
    font-size: .74rem;
    line-height: 1.2;
}

/*
 * El grid queda inmediatamente debajo del encabezado.
 */
body.ag-dashboard .ag-dashboard-page-header
+ #agDashboardLayoutGrid,
body.ag-dashboard .ag-dashboard-page-header
~ #agDashboardLayoutGrid,
body.ag-dashboard .ag-dashboard-page-header
~ .ag-dashboard-layout-grid {
    margin-top: 0 !important;
}

/*
 * Elimina espacios verticales antiguos de cabeceras generadas
 * por versiones anteriores.
 */
body.ag-dashboard .ag-page-head:empty {
    display: none !important;
}

body.ag-dashboard .ag-page-head {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

/*
 * La barra de personalización tampoco crea una franja vacía
 * cuando está cerrada.
 */
body.ag-dashboard
.ag-dashboard-editor-dock:not(.is-open):not(.show):empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/*
 * Modo oscuro.
 */
[data-bs-theme="dark"] .ag-dashboard-page-header__mark,
body.ag-theme-dark .ag-dashboard-page-header__mark,
body.dark-mode .ag-dashboard-page-header__mark {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, .32);
    background: rgba(30, 64, 175, .18);
}

/*
 * Responsive.
 */
@media (max-width: 575.98px) {
    body.ag-dashboard .ag-main > .ag-content {
        padding-top: 6px !important;
    }

    body.ag-dashboard .ag-dashboard-page-header {
        width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043, 8px))) !important;
        max-width: calc(100% - (2 * var(--ag-dashboard-grid-gap-v043, 8px))) !important;

        margin-left: var(--ag-dashboard-grid-gap-v043, 8px) !important;
        margin-right: var(--ag-dashboard-grid-gap-v043, 8px) !important;
        margin-bottom: 6px !important;
    }

    .ag-dashboard-page-header__identity {
        min-height: 38px;
    }

    .ag-dashboard-page-header__mark {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .ag-dashboard-page-header h1 {
        font-size: 1rem;
    }

    .ag-dashboard-page-header p {
        display: none;
    }
}


/* ==========================================================
   ARBORIAGEST - Unified module headers v045
   ========================================================== */

:root {
    --ag-module-header-bg: #ffffff;
    --ag-module-header-border: #e2e8f0;
    --ag-module-header-title: #0f172a;
    --ag-module-header-muted: #64748b;
    --ag-module-header-accent: #2563eb;
    --ag-module-header-accent-soft: #eff6ff;
    --ag-module-header-radius: 15px;
    --ag-module-header-shadow:
        0 1px 2px rgba(15, 23, 42, .025),
        0 6px 18px rgba(15, 23, 42, .035);
}

/* ----------------------------------------------------------
   CONTENEDOR GENERAL
   ---------------------------------------------------------- */

.ag-module-header {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    width: 100%;
    min-height: 76px;

    margin: 0 0 12px;
    padding: 13px 16px;

    border: 1px solid var(--ag-module-header-border);
    border-radius: var(--ag-module-header-radius);

    background: var(--ag-module-header-bg);
    box-shadow: var(--ag-module-header-shadow);

    overflow: hidden;
    box-sizing: border-box;
}

/*
 * Marca visual lateral propia de ArboriaGEST.
 */
.ag-module-header::before {
    content: "";

    position: absolute;
    top: 17px;
    bottom: 17px;
    left: 0;

    width: 3px;

    border-radius: 0 999px 999px 0;
    background:
        linear-gradient(
            180deg,
            #60a5fa 0%,
            var(--ag-module-header-accent) 55%,
            #1d4ed8 100%
        );
}

.ag-module-header--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 72px;
    z-index: 1015;
}

/* ----------------------------------------------------------
   IDENTIDAD
   ---------------------------------------------------------- */

.ag-module-header__identity {
    display: flex;
    align-items: center;
    gap: .85rem;

    min-width: 0;
}

.ag-module-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 43px;
    height: 43px;
    min-width: 43px;

    border: 1px solid #bfdbfe;
    border-radius: 12px;

    color: var(--ag-module-header-accent);
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .98),
            var(--ag-module-header-accent-soft)
        );

    box-shadow:
        0 4px 10px rgba(37, 99, 235, .07),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

.ag-module-header__icon i {
    font-size: 1.3rem;
}

.ag-module-header__copy {
    min-width: 0;
}

.ag-module-header__title {
    margin: 0;

    color: var(--ag-module-header-title);

    font-size: 1.16rem;
    font-weight: 730;
    line-height: 1.2;
    letter-spacing: -.018em;
}

.ag-module-header__subtitle {
    max-width: 760px;

    margin: .18rem 0 0;

    color: var(--ag-module-header-muted);

    font-size: .76rem;
    font-weight: 450;
    line-height: 1.35;
}

/* ----------------------------------------------------------
   ACCIONES
   ---------------------------------------------------------- */

.ag-module-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;

    flex: 0 0 auto;
}

.ag-module-header__actions form {
    margin: 0;
}

/* ----------------------------------------------------------
   COLORES POR MÓDULO
   ---------------------------------------------------------- */

.ag-module-header[data-module="administration"] {
    --ag-module-header-accent: #475569;
    --ag-module-header-accent-soft: #f1f5f9;
}

.ag-module-header[data-module="administration"] .ag-module-header__icon {
    border-color: #cbd5e1;
}

.ag-module-header[data-module="users"] {
    --ag-module-header-accent: #4f46e5;
    --ag-module-header-accent-soft: #eef2ff;
}

.ag-module-header[data-module="users"] .ag-module-header__icon {
    border-color: #c7d2fe;
}

.ag-module-header[data-module="tickets"] {
    --ag-module-header-accent: #7c3aed;
    --ag-module-header-accent-soft: #f5f3ff;
}

.ag-module-header[data-module="tickets"] .ag-module-header__icon {
    border-color: #ddd6fe;
}

.ag-module-header[data-module="purchases"] {
    --ag-module-header-accent: #ea580c;
    --ag-module-header-accent-soft: #fff7ed;
}

.ag-module-header[data-module="purchases"] .ag-module-header__icon {
    border-color: #fed7aa;
}

.ag-module-header[data-module="inventory"] {
    --ag-module-header-accent: #0891b2;
    --ag-module-header-accent-soft: #ecfeff;
}

.ag-module-header[data-module="inventory"] .ag-module-header__icon {
    border-color: #a5f3fc;
}

.ag-module-header[data-module="documentation"] {
    --ag-module-header-accent: #0284c7;
    --ag-module-header-accent-soft: #f0f9ff;
}

.ag-module-header[data-module="documentation"] .ag-module-header__icon {
    border-color: #bae6fd;
}

.ag-module-header[data-module="ens"] {
    --ag-module-header-accent: #059669;
    --ag-module-header-accent-soft: #ecfdf5;
}

.ag-module-header[data-module="ens"] .ag-module-header__icon {
    border-color: #a7f3d0;
}

.ag-module-header[data-module="labels"] {
    --ag-module-header-accent: #c026d3;
    --ag-module-header-accent-soft: #fdf4ff;
}

.ag-module-header[data-module="labels"] .ag-module-header__icon {
    border-color: #f5d0fe;
}

.ag-module-header[data-module="time"] {
    --ag-module-header-accent: #16a34a;
    --ag-module-header-accent-soft: #f0fdf4;
}

.ag-module-header[data-module="time"] .ag-module-header__icon {
    border-color: #bbf7d0;
}

.ag-module-header[data-module="reports"] {
    --ag-module-header-accent: #0f766e;
    --ag-module-header-accent-soft: #f0fdfa;
}

.ag-module-header[data-module="reports"] .ag-module-header__icon {
    border-color: #99f6e4;
}

.ag-module-header[data-module="projects"] {
    --ag-module-header-accent: #d97706;
    --ag-module-header-accent-soft: #fffbeb;
}

.ag-module-header[data-module="projects"] .ag-module-header__icon {
    border-color: #fde68a;
}

.ag-module-header[data-module="brain"] {
    --ag-module-header-accent: #7c3aed;
    --ag-module-header-accent-soft: #f5f3ff;
}

.ag-module-header[data-module="brain"] .ag-module-header__icon {
    border-color: #ddd6fe;
}

.ag-module-header[data-module="hourglass"] {
    --ag-module-header-accent: #0891b2;
    --ag-module-header-accent-soft: #ecfeff;
}

.ag-module-header[data-module="hourglass"] .ag-module-header__icon {
    border-color: #67e8f9;
}

.ag-module-header[data-module="building"] {
    --ag-module-header-accent: #0284c7;
    --ag-module-header-accent-soft: #f0f9ff;
}

.ag-module-header[data-module="building"] .ag-module-header__icon {
    border-color: #bae6fd;
}

/* ----------------------------------------------------------
   DASHBOARD
   ---------------------------------------------------------- */

/*
 * El encabezado del dashboard conserva exactamente el mismo margen
 * exterior que la cuadrícula.
 */
body.ag-dashboard .ag-module-header {
    width: calc(
        100% - (2 * var(--ag-dashboard-grid-gap-v043, 12px))
    );

    max-width: calc(
        100% - (2 * var(--ag-dashboard-grid-gap-v043, 12px))
    );

    margin:
        0
        var(--ag-dashboard-grid-gap-v043, 12px)
        var(--ag-dashboard-grid-gap-v043, 12px);
}

/*
 * Se anula el diseño anterior específico del dashboard.
 */
body.ag-dashboard .ag-dashboard-page-header {
    margin-bottom: 12px !important;
}

body.ag-dashboard .ag-main > .ag-content {
    padding-top: var(--ag-dashboard-grid-gap-v043, 12px) !important;
}

/* ----------------------------------------------------------
   CABECERAS ANTIGUAS
   ---------------------------------------------------------- */

/*
 * La transformación JavaScript cambia estas clases por .ag-module-header,
 * pero estas reglas evitan saltos visuales durante la carga.
 */
.ag-page-head,
.ag-dashboard-page-header {
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   CONTENIDO VACÍO
   ---------------------------------------------------------- */

/*
 * Mantiene coherencia con el fondo blanco utilizado por módulos
 * sin contenido o pantallas de configuración.
 */
.ag-content > .ag-empty-state,
.ag-content > .empty-state,
.ag-content > .ag-module-empty,
.ag-content > .card:only-child {
    border: 1px solid var(--ag-module-header-border);
    background: var(--ag-module-header-bg);
}

/* ----------------------------------------------------------
   MODO OSCURO
   ---------------------------------------------------------- */

[data-bs-theme="dark"],
body.ag-theme-dark,
body.dark-mode {
    --ag-module-header-bg: #111827;
    --ag-module-header-border: #263244;
    --ag-module-header-title: #f8fafc;
    --ag-module-header-muted: #94a3b8;
    --ag-module-header-shadow:
        0 1px 2px rgba(0, 0, 0, .15),
        0 8px 20px rgba(0, 0, 0, .12);
}

[data-bs-theme="dark"] .ag-module-header__icon,
body.ag-theme-dark .ag-module-header__icon,
body.dark-mode .ag-module-header__icon {
    background: rgba(30, 41, 59, .82);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .025),
        0 5px 12px rgba(0, 0, 0, .12);
}

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 767.98px) {
    .ag-module-header {
        align-items: flex-start;
        flex-direction: column;

        min-height: auto;
        padding: 12px 13px;
    }

    .ag-module-header__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .ag-module-header__actions .btn {
        flex: 0 1 auto;
    }
}

@media (max-width: 575.98px) {
    .ag-module-header {
        gap: .7rem;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .ag-module-header__identity {
        gap: .7rem;
    }

    .ag-module-header__icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 10px;
    }

    .ag-module-header__icon i {
        font-size: 1.15rem;
    }

    .ag-module-header__title {
        font-size: 1.02rem;
    }

    .ag-module-header__subtitle {
        font-size: .72rem;
    }

    body.ag-dashboard .ag-module-header {
        width: calc(
            100% - (2 * var(--ag-dashboard-grid-gap-v043, 8px))
        );

        max-width: calc(
            100% - (2 * var(--ag-dashboard-grid-gap-v043, 8px))
        );

        margin-left: var(--ag-dashboard-grid-gap-v043, 8px);
        margin-right: var(--ag-dashboard-grid-gap-v043, 8px);
        margin-bottom: var(--ag-dashboard-grid-gap-v043, 8px);
    }
}


/* ==========================================================
   ARBORIAGEST - Dashboard panel compact position v047
   ========================================================== */

body.ag-dashboard {
    /*
     * Se utiliza el mismo valor para:
     * - margen lateral izquierdo;
     * - margen lateral derecho;
     * - separación entre paneles;
     * - separación entre encabezado y paneles.
     */
    --ag-dashboard-spacing-v047:
        var(--ag-dashboard-grid-gap-v043, 12px);
}

/*
 * No se modifica la posición superior del encabezado.
 */
body.ag-dashboard .ag-module-header {
    margin-bottom: var(--ag-dashboard-spacing-v047) !important;
}

/*
 * El contenido no debe repartir verticalmente los elementos.
 */
body.ag-dashboard
.ag-main > .ag-content.ag-dashboard-content-compact {
    display: block !important;
    justify-content: initial !important;
    align-content: initial !important;

    height: auto !important;
    min-height: 0 !important;
}

/*
 * La cuadrícula se sitúa inmediatamente después del encabezado.
 */
body.ag-dashboard
#agDashboardLayoutGrid.ag-dashboard-grid-compact-position,
body.ag-dashboard
.ag-dashboard-layout-grid.ag-dashboard-grid-compact-position {
    position: relative !important;

    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;

    transform: none !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;

    padding-top: 0 !important;

    vertical-align: top !important;
    align-self: auto !important;
}

/*
 * Conserva los márgenes laterales ya aprobados.
 */
body.ag-dashboard
#agDashboardLayoutGrid {
    width: calc(
        100% - (2 * var(--ag-dashboard-spacing-v047))
    ) !important;

    max-width: calc(
        100% - (2 * var(--ag-dashboard-spacing-v047))
    ) !important;

    margin-left: var(--ag-dashboard-spacing-v047) !important;
    margin-right: var(--ag-dashboard-spacing-v047) !important;

    gap: var(--ag-dashboard-spacing-v047) !important;
    box-sizing: border-box !important;
}

/*
 * Evita que elementos técnicos situados entre el encabezado y el grid
 * reserven altura cuando no están visibles.
 */
body.ag-dashboard
.ag-dashboard-editor-dock[hidden],
body.ag-dashboard
.ag-dashboard-editor-dock[aria-hidden="true"] {
    display: none !important;
}

body.ag-dashboard
.ag-dashboard-editor-dock:not(.is-open):not(.show) {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/*
 * Cuando el editor está visible, conserva el mismo espaciado.
 */
body.ag-dashboard
.ag-dashboard-editor-dock.is-open,
body.ag-dashboard
.ag-dashboard-editor-dock.show {
    margin-bottom: var(--ag-dashboard-spacing-v047) !important;
}

/*
 * Elimina cualquier altura artificial del grid o su contenedor.
 */
body.ag-dashboard
#agDashboardLayoutGrid,
body.ag-dashboard
.ag-dashboard-layout-grid {
    min-height: 0 !important;
}

/*
 * El encabezado y el grid mantienen exactamente la misma alineación.
 */
body.ag-dashboard .ag-module-header {
    width: calc(
        100% - (2 * var(--ag-dashboard-spacing-v047))
    ) !important;

    max-width: calc(
        100% - (2 * var(--ag-dashboard-spacing-v047))
    ) !important;

    margin-left: var(--ag-dashboard-spacing-v047) !important;
    margin-right: var(--ag-dashboard-spacing-v047) !important;
}

/*
 * Móvil.
 */
@media (max-width: 575.98px) {
    body.ag-dashboard {
        --ag-dashboard-spacing-v047:
            var(--ag-dashboard-grid-gap-v043, 8px);
    }
}


/* ==========================================================
   ARBORIAGEST - Modern users module and avatars v048
   ========================================================== */

.usuarios-page {
    display: grid;
    gap: 12px;
}

.ag-users-panel {
    overflow: visible;
    border: 1px solid var(--ag-border, #e2e8f0);
    border-radius: 15px;
    background: var(--ag-surface, #fff);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .025),
        0 8px 20px rgba(15, 23, 42, .035);
}

.ag-users-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ag-border, #e2e8f0);
}

.ag-users-panel__header h2 {
    margin: 0;
    color: var(--ag-text, #0f172a);
    font-size: .92rem;
    font-weight: 700;
}

.ag-users-panel__header p {
    margin: .15rem 0 0;
    color: var(--ag-muted, #64748b);
    font-size: .72rem;
}

.ag-users-search {
    display: flex;
    align-items: center;
    gap: .45rem;
    width: min(280px, 100%);
    min-height: 36px;
    padding: 0 .7rem;
    border: 1px solid var(--ag-border, #dbe3ee);
    border-radius: 10px;
    background: var(--ag-surface-soft, #f8fafc);
    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background-color .15s ease;
}

.ag-users-search:focus-within {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.ag-users-search svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #64748b;
}

.ag-users-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ag-text, #0f172a);
    font-size: .76rem;
}

.ag-users-list {
    padding: 6px;
}

.ag-user-row {
    display: grid;
    grid-template-columns:
        minmax(190px, 1.4fr)
        minmax(190px, 1.25fr)
        minmax(190px, .95fr)
        minmax(130px, .75fr)
        116px;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 10px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    transition:
        background-color .14s ease,
        border-color .14s ease,
        box-shadow .14s ease;
}

.ag-user-row + .ag-user-row,
.ag-user-permissions-collapse + .ag-user-row {
    margin-top: 3px;
}

.ag-user-row:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .03);
}

.ag-user-row__identity {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.ag-user-row__name {
    min-width: 0;
}

.ag-user-row__name strong {
    display: block;
    overflow: hidden;
    color: var(--ag-text, #0f172a);
    font-size: .8rem;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-user-row__name span,
.ag-user-row__label {
    display: block;
    margin-top: .12rem;
    color: var(--ag-muted, #64748b);
    font-size: .66rem;
    line-height: 1.2;
}

.ag-user-row__email {
    min-width: 0;
}

.ag-user-row__email a {
    display: block;
    overflow: hidden;
    color: #334155;
    font-size: .75rem;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-user-row__email a:hover {
    color: #2563eb;
}

.ag-user-row__tags {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.ag-user-tag {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    min-height: 24px;
    padding: .24rem .52rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 680;
    line-height: 1;
    white-space: nowrap;
}

.ag-user-tag__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.ag-user-tag--superadmin {
    color: #4338ca;
    border-color: #c7d2fe;
    background: #eef2ff;
}

.ag-user-tag--admin {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.ag-user-tag--user {
    color: #475569;
    border-color: #dbe3ee;
    background: #f8fafc;
}

.ag-user-tag--active {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.ag-user-tag--inactive {
    color: #64748b;
    border-color: #dbe3ee;
    background: #f1f5f9;
}

.ag-user-row__access {
    color: #334155;
    font-size: .72rem;
}

.ag-user-row__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    min-width: 116px;
}

.ag-user-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    color: #475569;
    background: #fff;
    cursor: pointer;
    transition:
        color .14s ease,
        border-color .14s ease,
        background-color .14s ease,
        transform .14s ease,
        box-shadow .14s ease;
}

.ag-user-action svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-user-action:hover {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, .08);
    transform: translateY(-1px);
}

.ag-user-action--permissions:hover {
    color: #7c3aed;
    border-color: #c4b5fd;
    background: #f5f3ff;
}

.ag-user-action--danger:hover {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

.ag-user-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1d4ed8;
    background:
        linear-gradient(
            145deg,
            #fff,
            #eff6ff
        );
    font-weight: 720;
    letter-spacing: -.02em;
}

.ag-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ag-user-avatar--list {
    width: 42px;
    height: 42px;
    font-size: .75rem;
}

.ag-user-avatar--editor {
    width: 74px;
    height: 74px;
    border-radius: 18px;
    font-size: 1.05rem;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .1);
}

.ag-user-permissions-collapse {
    margin: 4px 4px 8px;
}

.ag-user-permissions {
    padding: 14px;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    background: #faf9ff;
}

.ag-user-permissions__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 12px;
}

.ag-user-permissions__head h3 {
    margin: 0;
    color: #312e81;
    font-size: .82rem;
    font-weight: 700;
}

.ag-user-permissions__head p {
    margin: .15rem 0 0;
    color: #6b7280;
    font-size: .68rem;
}

.ag-permissions-grid {
    display: grid;
    gap: 6px;
}

.ag-permission-item {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(440px, 1.8fr);
    align-items: center;
    gap: 16px;
    padding: 9px 10px;
    border: 1px solid #e9e5ff;
    border-radius: 9px;
    background: #fff;
}

.ag-permission-item.is-disabled {
    opacity: .55;
    background: #f8fafc;
}

.ag-permission-item__module strong {
    display: block;
    color: #1e293b;
    font-size: .73rem;
}

.ag-permission-item__module span {
    display: block;
    margin-top: .08rem;
    color: #64748b;
    font-size: .64rem;
}

.ag-permission-item__checks {
    display: grid;
    grid-template-columns: repeat(5, minmax(60px, 1fr));
    gap: 8px;
}

.ag-permission-item__checks label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin: 0;
    color: #475569;
    font-size: .64rem;
}

.ag-users-empty {
    padding: 2.5rem 1rem;
    color: #64748b;
    font-size: .8rem;
    text-align: center;
}

.ag-user-modal {
    overflow: hidden;
    border: 1px solid var(--ag-border, #e2e8f0);
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .16);
}

.ag-user-modal .modal-header,
.ag-user-offcanvas .offcanvas-header {
    align-items: flex-start;
}

.ag-user-modal .modal-title,
.ag-user-offcanvas .offcanvas-title {
    margin: 0;
    color: var(--ag-text, #0f172a);
    font-size: 1rem;
    font-weight: 720;
}

.ag-user-modal .modal-header p,
.ag-user-offcanvas .offcanvas-header p {
    margin: .15rem 0 0;
    color: var(--ag-muted, #64748b);
    font-size: .7rem;
}

.ag-user-offcanvas {
    width: min(440px, 100vw) !important;
}

.ag-avatar-editor {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    background: #f8fbff;
}

.ag-avatar-editor p {
    margin: .35rem 0 0;
    color: #64748b;
    font-size: .66rem;
}

.ag-switch-field {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: #334155;
    font-size: .76rem;
    cursor: pointer;
}

.ag-switch-field input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ag-switch-field__control {
    position: relative;
    width: 38px;
    height: 21px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color .15s ease;
}

.ag-switch-field__control::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(15, 23, 42, .18);
    transition: transform .15s ease;
}

.ag-switch-field input:checked + .ag-switch-field__control {
    background: #2563eb;
}

.ag-switch-field input:checked + .ag-switch-field__control::after {
    transform: translateX(17px);
}

/*
 * Avatar del panel superior.
 */
.ag-topbar .ag-avatar {
    overflow: hidden;
}

.ag-topbar .ag-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

/*
 * Modo oscuro.
 */
[data-bs-theme="dark"] .ag-user-row:hover,
body.ag-theme-dark .ag-user-row:hover,
body.dark-mode .ag-user-row:hover {
    border-color: #334155;
    background: #172033;
}

[data-bs-theme="dark"] .ag-user-action,
body.ag-theme-dark .ag-user-action,
body.dark-mode .ag-user-action {
    color: #cbd5e1;
    border-color: #334155;
    background: #111827;
}

[data-bs-theme="dark"] .ag-user-row__email a,
[data-bs-theme="dark"] .ag-user-row__access,
body.ag-theme-dark .ag-user-row__email a,
body.ag-theme-dark .ag-user-row__access {
    color: #cbd5e1;
}

[data-bs-theme="dark"] .ag-user-permissions,
body.ag-theme-dark .ag-user-permissions {
    border-color: #4338ca;
    background: #17152b;
}

[data-bs-theme="dark"] .ag-permission-item,
body.ag-theme-dark .ag-permission-item {
    border-color: #312e81;
    background: #111827;
}

[data-bs-theme="dark"] .ag-permission-item__module strong,
body.ag-theme-dark .ag-permission-item__module strong {
    color: #e2e8f0;
}

[data-bs-theme="dark"] .ag-avatar-editor,
body.ag-theme-dark .ag-avatar-editor {
    border-color: #334155;
    background: #111827;
}

/*
 * Responsive.
 */
@media (max-width: 1199.98px) {
    .ag-user-row {
        grid-template-columns:
            minmax(180px, 1.2fr)
            minmax(180px, 1fr)
            minmax(165px, .85fr)
            116px;
    }

    .ag-user-row__access {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .ag-user-row {
        grid-template-columns:
            minmax(190px, 1.2fr)
            minmax(165px, 1fr)
            116px;
    }

    .ag-user-row__email {
        display: none;
    }

    .ag-permission-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .ag-users-panel__header {
        align-items: stretch;
        flex-direction: column;
    }

    .ag-users-search {
        width: 100%;
    }

    .ag-user-row {
        grid-template-columns: 1fr auto;
        gap: 9px;
    }

    .ag-user-row__tags {
        grid-column: 1;
    }

    .ag-user-row__actions {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .ag-permission-item__checks {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 479.98px) {
    .ag-user-row {
        padding: 10px 7px;
    }

    .ag-user-row__actions {
        min-width: auto;
        gap: 3px;
    }

    .ag-user-action {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    .ag-avatar-editor {
        align-items: flex-start;
        flex-direction: column;
    }

    .ag-permission-item__checks {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* ==========================================================
   ARBORIAGEST - Login centered safe v050
   ========================================================== */

/*
 * El bloque promocional se elimina directamente del PHP.
 * Esta regla queda como protección ante cachés o versiones antiguas.
 */
.ag-login-intro {
    display: none !important;
}

/*
 * El shell deja de reservar una columna lateral.
 */
.ag-login-shell.ag-login-shell--centered {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;

    margin: 0 !important;
    padding: clamp(18px, 3vw, 48px) !important;

    grid-template-columns: none !important;
    column-gap: 0 !important;
    gap: 0 !important;

    box-sizing: border-box !important;
}

/*
 * La tarjeta que contiene ilustración y formulario queda centrada.
 */
.ag-login-shell--centered > .ag-login-card {
    display: grid !important;
    grid-template-columns:
        minmax(0, 1.08fr)
        minmax(390px, .92fr) !important;

    width: min(1080px, 100%) !important;
    max-width: 1080px !important;
    min-width: 0 !important;

    margin: auto !important;

    border: 1px solid var(--ag-border, #e5e7eb) !important;
    border-radius: 24px !important;

    background: var(--ag-surface, #fff) !important;
    box-shadow:
        0 18px 48px rgba(15, 23, 42, .10) !important;

    overflow: hidden !important;
    box-sizing: border-box !important;
}

/*
 * Conserva la ilustración sin modificar su contenido.
 */
.ag-login-shell--centered .ag-login-visual {
    min-width: 0 !important;
    min-height: 650px !important;

    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
}

/*
 * Conserva íntegramente el formulario.
 */
.ag-login-shell--centered .ag-login-form-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 0 !important;
    padding: clamp(28px, 4vw, 54px) !important;

    background: var(--ag-surface, #fff) !important;
}

.ag-login-shell--centered .ag-login-form {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
}

/*
 * Impide que estilos antiguos oculten accidentalmente el formulario.
 */
.ag-login-shell--centered .ag-login-card,
.ag-login-shell--centered .ag-login-form-wrap,
.ag-login-shell--centered .ag-login-form,
.ag-login-shell--centered form {
    visibility: visible !important;
    opacity: 1 !important;
}

.ag-login-shell--centered .ag-login-form-wrap,
.ag-login-shell--centered .ag-login-form {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/*
 * Tablet: se reduce el ancho sin perder las dos columnas.
 */
@media (max-width: 991.98px) {
    .ag-login-shell.ag-login-shell--centered {
        padding: 18px !important;
    }

    .ag-login-shell--centered > .ag-login-card {
        grid-template-columns:
            minmax(0, .9fr)
            minmax(360px, 1.1fr) !important;

        max-width: 850px !important;
    }

    .ag-login-shell--centered .ag-login-visual {
        min-height: 590px !important;
    }

    .ag-login-shell--centered .ag-login-form-wrap {
        padding: 30px !important;
    }
}

/*
 * Móvil: se oculta solo la ilustración y permanece el formulario.
 */
@media (max-width: 767.98px) {
    .ag-login-shell.ag-login-shell--centered {
        align-items: flex-start !important;
        padding: 12px !important;
    }

    .ag-login-shell--centered > .ag-login-card {
        display: block !important;
        width: 100% !important;
        max-width: 520px !important;
        border-radius: 18px !important;
    }

    .ag-login-shell--centered .ag-login-visual {
        display: none !important;
    }

    .ag-login-shell--centered .ag-login-form-wrap {
        display: flex !important;
        min-height: auto !important;
        padding: 28px 22px !important;
    }
}

@media (max-width: 479.98px) {
    .ag-login-shell--centered .ag-login-form-wrap {
        padding: 24px 17px !important;
    }
}

/*
 * Modo oscuro.
 */
[data-bs-theme="dark"]
.ag-login-shell--centered > .ag-login-card {
    border-color: #263244 !important;
    background: #111827 !important;
    box-shadow:
        0 20px 52px rgba(0, 0, 0, .28) !important;
}

[data-bs-theme="dark"]
.ag-login-shell--centered .ag-login-form-wrap {
    background: #111827 !important;
}


/* ==========================================================
   ARBORIAGEST - Direct user-only topbar v052
   ========================================================== */

/*
 * Topbar sin título, sin buscador y sin botones independientes.
 */
.ag-topbar.ag-topbar-user-only {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    grid-template-columns: none !important;

    width: 100% !important;
    height: var(--ag-topbar-height, 72px) !important;
    min-height: var(--ag-topbar-height, 72px) !important;

    padding: .7rem 1.25rem !important;
}

.ag-topbar-user-only .ag-top-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    width: auto !important;
    margin-left: auto !important;
}

/*
 * Botón principal del usuario.
 */
.ag-topbar-user-only .ag-user-menu {
    display: inline-flex !important;
    align-items: center !important;
    gap: .72rem !important;

    min-height: 52px !important;
    padding: .25rem .45rem .25rem .25rem !important;

    border: 1px solid transparent !important;
    border-radius: 15px !important;

    color: var(--ag-text, #111827) !important;
    background: transparent !important;

    cursor: pointer !important;
    box-shadow: none !important;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

.ag-topbar-user-only .ag-user-menu:hover,
.ag-topbar-user-only .ag-user-menu[aria-expanded="true"] {
    border-color: var(--ag-border, #e5e7eb) !important;
    background: var(--ag-surface, #fff) !important;
}

/*
 * Círculo/avatar señalado en verde.
 */
.ag-topbar-user-only .ag-avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;

    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;

    border: 2px solid rgba(255, 255, 255, .9) !important;
    border-radius: 50% !important;

    color: #fff !important;
    background:
        linear-gradient(
            145deg,
            #4f46e5,
            #2563eb
        ) !important;

    font-size: 1rem !important;
    font-weight: 800 !important;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .12),
        0 6px 14px rgba(37, 99, 235, .16) !important;
}

.ag-topbar-user-only .ag-avatar img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
}

.ag-topbar-user-only .ag-user-meta {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;

    min-width: 0 !important;
}

.ag-topbar-user-only .ag-user-name {
    color: var(--ag-text, #111827) !important;
    font-size: .85rem !important;
    font-weight: 720 !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}

.ag-topbar-user-only .ag-user-role {
    margin-top: .1rem !important;

    color: var(--ag-muted, #64748b) !important;
    font-size: .69rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
}

.ag-user-menu-chevron {
    width: 15px !important;
    height: 15px !important;

    fill: none !important;
    stroke: var(--ag-muted, #64748b) !important;
    stroke-width: 1.8 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;

    transition: transform .15s ease !important;
}

.ag-user-menu[aria-expanded="true"] .ag-user-menu-chevron {
    transform: rotate(180deg) !important;
}

/*
 * Desplegable.
 */
.ag-user-dropdown-menu {
    min-width: 300px !important;
    padding: .55rem !important;

    border: 1px solid var(--ag-border, #e5e7eb) !important;
    border-radius: 16px !important;

    background: var(--ag-surface, #fff) !important;

    box-shadow:
        0 20px 45px rgba(15, 23, 42, .14) !important;
}

/*
 * Perfil dentro del desplegable.
 */
.ag-user-dropdown-profile {
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;

    padding: .65rem .65rem .55rem !important;
}

.ag-user-dropdown-profile__avatar {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;

    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;

    border-radius: 50% !important;

    color: #fff !important;
    background:
        linear-gradient(
            145deg,
            #4f46e5,
            #2563eb
        ) !important;

    font-size: .82rem !important;
    font-weight: 800 !important;
}

.ag-user-dropdown-profile__avatar img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.ag-user-dropdown-profile__copy {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}

.ag-user-dropdown-profile__copy strong {
    overflow: hidden !important;
    color: var(--ag-text, #111827) !important;
    font-size: .82rem !important;
    font-weight: 720 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.ag-user-dropdown-profile__copy span {
    margin-top: .1rem !important;
    color: var(--ag-muted, #64748b) !important;
    font-size: .68rem !important;
}

/*
 * Opciones del menú, incluidos tema y notificaciones.
 */
.ag-user-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;

    width: 100% !important;
    min-height: 42px !important;

    padding: .6rem .68rem !important;

    border: 0 !important;
    border-radius: 10px !important;

    color: var(--ag-text, #111827) !important;
    background: transparent !important;

    font-size: .8rem !important;
    font-weight: 560 !important;
    text-align: left !important;

    box-shadow: none !important;
}

.ag-user-dropdown-item::after {
    display: none !important;
}

.ag-user-dropdown-item:hover,
.ag-user-dropdown-item:focus {
    color: var(--ag-text, #111827) !important;
    background: var(--ag-surface-soft, #f8fafc) !important;
    transform: none !important;
    box-shadow: none !important;
}

.ag-user-dropdown-item svg {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;

    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.7 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;

    color: #64748b !important;
}

.ag-user-dropdown-item > span:not(.ag-user-dropdown-badge) {
    flex: 1 1 auto !important;
}

.ag-user-dropdown-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-width: 21px !important;
    height: 21px !important;
    padding: 0 .35rem !important;

    border-radius: 999px !important;

    color: #fff !important;
    background: #2563eb !important;

    font-size: .66rem !important;
    font-weight: 750 !important;
}

.ag-user-dropdown-item--danger {
    color: #b91c1c !important;
}

.ag-user-dropdown-item--danger svg {
    color: #dc2626 !important;
}

.ag-user-dropdown-item--danger:hover {
    color: #b91c1c !important;
    background: #fef2f2 !important;
}

/*
 * Modo oscuro.
 */
[data-bs-theme="dark"] .ag-topbar-user-only .ag-user-menu:hover,
[data-bs-theme="dark"] .ag-topbar-user-only .ag-user-menu[aria-expanded="true"] {
    background: rgba(255, 255, 255, .05) !important;
}

[data-bs-theme="dark"] .ag-user-dropdown-menu {
    background: var(--ag-surface, #111827) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, .32) !important;
}

[data-bs-theme="dark"] .ag-user-dropdown-item:hover,
[data-bs-theme="dark"] .ag-user-dropdown-item:focus {
    background: rgba(255, 255, 255, .06) !important;
}

[data-bs-theme="dark"] .ag-user-dropdown-item--danger:hover {
    background: rgba(220, 38, 38, .12) !important;
}

/*
 * Responsive.
 */
@media (max-width: 767.98px) {
    .ag-topbar.ag-topbar-user-only {
        padding: .6rem .8rem !important;
    }

    .ag-topbar-user-only .ag-user-meta,
    .ag-user-menu-chevron {
        display: none !important;
    }

    .ag-topbar-user-only .ag-user-menu {
        min-height: 46px !important;
        padding: 0 !important;
    }

    .ag-topbar-user-only .ag-avatar {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }

    .ag-user-dropdown-menu {
        min-width: min(290px, calc(100vw - 24px)) !important;
    }
}


/* ==========================================================
   ARBORIAGEST - Login image real path v055
   ========================================================== */

/*
 * Se utiliza exactamente la ruta pública confirmada:
 * /assets/img/login_arboria_control_center.webp
 */
.ag-login-card .ag-login-visual,
.ag-login-card .ag-login-visual-v055,
.ag-login-shell--centered .ag-login-visual,
.ag-login-shell--centered .ag-login-visual-v055 {
    display: block !important;
    position: relative !important;

    min-height: 650px !important;

    background-color: #f8fafc !important;

    background-image:
        url("/assets/img/login_arboria_control_center.webp?v=055") !important;

    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;

    overflow: hidden !important;
}

/*
 * Neutraliza fondos antiguos aplicados mediante pseudo-elementos.
 */
.ag-login-card .ag-login-visual::before,
.ag-login-card .ag-login-visual-v055::before {
    content: none !important;
    display: none !important;
    background: none !important;
    background-image: none !important;
}

.ag-login-card .ag-login-visual::after,
.ag-login-card .ag-login-visual-v055::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0) 72%,
            rgba(255, 255, 255, .06) 100%
        ) !important;
}

/*
 * Oculta imágenes HTML antiguas dentro del panel si existieran.
 */
.ag-login-card .ag-login-visual > img,
.ag-login-card .ag-login-visual > picture,
.ag-login-card .ag-login-visual-v055 > img,
.ag-login-card .ag-login-visual-v055 > picture {
    display: none !important;
}

@media (max-width: 991.98px) {
    .ag-login-card .ag-login-visual,
    .ag-login-card .ag-login-visual-v055,
    .ag-login-shell--centered .ag-login-visual,
    .ag-login-shell--centered .ag-login-visual-v055 {
        min-height: 590px !important;
        background-position: center center !important;
    }
}

@media (max-width: 767.98px) {
    .ag-login-card .ag-login-visual,
    .ag-login-card .ag-login-visual-v055,
    .ag-login-shell--centered .ag-login-visual,
    .ag-login-shell--centered .ag-login-visual-v055 {
        display: none !important;
    }
}


/* ==========================================================
   ARBORIAGEST - Projects and offers modules v056
   ========================================================== */
.ag-module-list-panel{overflow:hidden;border:1px solid var(--ag-border);border-radius:15px;background:var(--ag-surface);box-shadow:var(--ag-shadow-sm)}
.ag-module-list-panel__header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:14px 16px;border-bottom:1px solid var(--ag-border)}
.ag-module-list-panel__header h2{margin:0;font-size:.9rem;font-weight:700}.ag-module-list-panel__header p{margin:.1rem 0 0;color:var(--ag-muted);font-size:.7rem}.ag-module-search{width:min(280px,100%)}
.ag-project-list,.ag-offer-list{padding:6px}.ag-project-row,.ag-offer-row{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(150px,1fr) minmax(170px,.9fr) minmax(140px,.9fr) minmax(110px,.6fr) 90px;align-items:center;gap:14px;min-height:70px;padding:10px;border:1px solid transparent;border-radius:11px}.ag-project-row:hover,.ag-offer-row:hover{border-color:var(--ag-border);background:var(--ag-surface-soft)}
.ag-project-row strong,.ag-offer-row strong{display:block;font-size:.77rem}.ag-project-row span,.ag-offer-row span{display:block;color:var(--ag-muted);font-size:.68rem}.ag-project-row small,.ag-offer-row small{display:block;margin-bottom:.15rem;color:var(--ag-muted);font-size:.62rem}.ag-project-tags,.ag-row-actions{display:flex;align-items:center;gap:5px}.ag-row-actions{justify-content:flex-end}
.ag-status-tag,.ag-priority-tag{display:inline-flex!important;align-items:center;width:fit-content;min-height:23px;padding:.22rem .5rem;border:1px solid var(--ag-border);border-radius:999px;font-size:.63rem!important;font-weight:700}.ag-status-active,.ag-offer-status-accepted{color:#047857!important;border-color:#a7f3d0;background:#ecfdf5}.ag-status-paused,.ag-offer-status-sent{color:#b45309!important;border-color:#fde68a;background:#fffbeb}.ag-status-completed{color:#1d4ed8!important;border-color:#bfdbfe;background:#eff6ff}.ag-status-cancelled,.ag-offer-status-rejected,.ag-offer-status-expired,.ag-priority-critical{color:#b91c1c!important;border-color:#fecaca;background:#fef2f2}.ag-priority-high{color:#b45309!important;background:#fffbeb}.ag-priority-normal{color:#1d4ed8!important;background:#eff6ff}.ag-priority-low,.ag-status-planning,.ag-offer-status-draft{color:#475569!important;background:#f8fafc}
.ag-wide-offcanvas{width:min(560px,100vw)!important}.ag-offer-offcanvas{width:min(1100px,100vw)!important}.ag-offer-items-header{display:flex;align-items:center;justify-content:space-between;margin:1.5rem 0 .7rem}.ag-offer-items-header h3{margin:0;font-size:.9rem}.ag-offer-item{display:grid;grid-template-columns:minmax(220px,2fr) 90px 80px 110px 90px 90px 34px;gap:7px;margin-bottom:7px}
.ag-offer-document{max-width:980px;margin:0 auto;padding:42px;border:1px solid var(--ag-border);border-radius:16px;background:#fff;color:#111827;box-shadow:var(--ag-shadow-sm)}.ag-offer-document__header,.ag-offer-document__meta{display:flex;justify-content:space-between;gap:2rem}.ag-offer-document__header{padding-bottom:24px;border-bottom:2px solid #2563eb}.ag-offer-document__header h1{margin:0;font-size:1.7rem}.ag-offer-document__header span,.ag-offer-document__meta span,.ag-offer-document__meta small{display:block;color:#64748b}.ag-offer-document__meta{margin:28px 0}.ag-offer-document__table{width:100%;margin:24px 0;border-collapse:collapse}.ag-offer-document__table th,.ag-offer-document__table td{padding:10px;border-bottom:1px solid #e5e7eb;font-size:.78rem}.ag-offer-document__table th{background:#f8fafc;text-align:left}.ag-offer-document__totals{width:min(360px,100%);margin-left:auto}.ag-offer-document__totals>div{display:flex;justify-content:space-between;padding:8px 0}.ag-offer-document__totals .is-total{margin-top:5px;padding-top:12px;border-top:2px solid #2563eb;font-size:1.05rem}
@media(max-width:1100px){.ag-project-row,.ag-offer-row{grid-template-columns:minmax(180px,1.3fr) minmax(150px,1fr) minmax(150px,.9fr) 90px}.ag-project-row>:nth-child(4),.ag-project-row>:nth-child(5),.ag-offer-row>:nth-child(3),.ag-offer-row>:nth-child(4){display:none}}
@media(max-width:767px){.ag-project-row,.ag-offer-row{grid-template-columns:1fr auto}.ag-project-row>:not(:first-child):not(:last-child),.ag-offer-row>:not(:first-child):not(:last-child){display:none}.ag-offer-item{grid-template-columns:1fr 1fr;padding:10px;border:1px solid var(--ag-border);border-radius:10px}.ag-offer-item__description{grid-column:1/-1}}
@media print{.ag-sidebar,.ag-topbar,.ag-no-print,.ag-app-footer{display:none!important}.ag-shell,.ag-main,.ag-content{display:block!important;margin:0!important;padding:0!important}.ag-offer-document{max-width:none;padding:0;border:0;box-shadow:none}}

/* ==========================================================
   ARBORIAGEST - Sidebar projects and offers v057
   ========================================================== */


/*
 * Enlaces de los nuevos módulos.
 */


/*
 * Módulo activo.
 */


/*
 * Iconos.
 */


/*
 * Texto del módulo.
 */


/*
 * Compatibilidad con distintas clases habituales
 * del menú lateral colapsado.
 */
.ag-sidebar.is-collapsed


.ag-sidebar.is-collapsed


/*
 * Modo oscuro.
 */
[data-bs-theme="dark"]


[data-bs-theme="dark"]


/* ==========================================================
   ARBORIAGEST - Dashboard projects and offers v058
   ========================================================== */

.ag-dashboard-business-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.ag-dashboard-business-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 15px 16px;

    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-dashboard-business-panel__title {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.ag-dashboard-business-panel__title h2 {
    margin: 0;

    color: var(--ag-text, #111827);

    font-size: .86rem;
    font-weight: 760;
    line-height: 1.2;
}

.ag-dashboard-business-panel__title p {
    margin: 3px 0 0;

    color: var(--ag-muted, #64748b);

    font-size: .66rem;
    line-height: 1.25;
}

.ag-dashboard-business-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;
    min-width: 36px;

    border-radius: 10px;
}

.ag-dashboard-business-panel__icon svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-dashboard-business-panel__icon--projects {
    color: #2563eb;
    background: rgba(37, 99, 235, .1);
}

.ag-dashboard-business-panel__icon--offers {
    color: #7c3aed;
    background: rgba(124, 58, 237, .1);
}

.ag-dashboard-business-panel__icon--quick {
    color: #0891b2;
    background: rgba(8, 145, 178, .1);
}

.ag-dashboard-business-panel__link {
    flex: 0 0 auto;

    color: var(--ag-primary, #2563eb);

    font-size: .67rem;
    font-weight: 700;
    text-decoration: none;
}

.ag-dashboard-business-panel__link:hover {
    text-decoration: underline;
}

.ag-dashboard-business-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;

    padding: 12px 14px 0;
}

.ag-dashboard-business-stat {
    min-width: 0;
    padding: 9px;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 9px;

    background: var(--ag-surface-soft, #f8fafc);
}

.ag-dashboard-business-stat span {
    display: block;

    overflow: hidden;

    color: var(--ag-muted, #64748b);

    font-size: .59rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-dashboard-business-stat strong {
    display: block;
    margin-top: 3px;

    color: var(--ag-text, #111827);

    font-size: 1.05rem;
    font-weight: 780;
    line-height: 1;
}

.ag-dashboard-business-money-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

    padding: 10px 14px 0;
}

.ag-dashboard-business-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: 10px 14px 0;
    padding: 9px 11px;

    border-radius: 9px;

    background: rgba(37, 99, 235, .07);
}

.ag-dashboard-business-money-grid
.ag-dashboard-business-total {
    margin: 0;
}

.ag-dashboard-offers-panel
.ag-dashboard-business-total {
    background: rgba(124, 58, 237, .07);
}

.ag-dashboard-business-total span {
    color: var(--ag-muted, #64748b);

    font-size: .64rem;
    font-weight: 650;
}

.ag-dashboard-business-total strong {
    color: var(--ag-text, #111827);

    font-size: .75rem;
    font-weight: 780;
    white-space: nowrap;
}

.ag-dashboard-business-list {
    flex: 1 1 auto;

    min-height: 0;
    margin-top: 11px;

    border-top: 1px solid var(--ag-border, #e5e7eb);
}

.ag-dashboard-business-list__heading {
    padding: 9px 14px 6px;

    color: var(--ag-muted, #64748b);

    font-size: .61rem;
    font-weight: 720;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.ag-dashboard-business-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    min-width: 0;
    padding: 7px 14px;

    border-top: 1px solid rgba(148, 163, 184, .12);

    color: inherit;
    text-decoration: none;
}

.ag-dashboard-business-row:hover {
    background: var(--ag-surface-soft, #f8fafc);
    text-decoration: none;
}

.ag-dashboard-business-row__main {
    display: block;
    min-width: 0;
}

.ag-dashboard-business-row__main strong,
.ag-dashboard-business-row__main small {
    display: block;
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-dashboard-business-row__main strong {
    color: var(--ag-text, #111827);

    font-size: .67rem;
    font-weight: 710;
}

.ag-dashboard-business-row__main small {
    margin-top: 2px;

    color: var(--ag-muted, #64748b);

    font-size: .58rem;
}

.ag-dashboard-business-status {
    display: inline-flex;
    align-items: center;

    flex: 0 0 auto;

    min-height: 21px;
    padding: 3px 7px;

    border-radius: 999px;

    font-size: .56rem;
    font-weight: 720;
    white-space: nowrap;
}

.ag-dashboard-business-status.is-project-planning,
.ag-dashboard-business-status.is-offer-draft {
    color: #475569;
    background: #f1f5f9;
}

.ag-dashboard-business-status.is-project-active,
.ag-dashboard-business-status.is-offer-accepted {
    color: #047857;
    background: #ecfdf5;
}

.ag-dashboard-business-status.is-project-completed {
    color: #1d4ed8;
    background: #eff6ff;
}

.ag-dashboard-business-status.is-project-paused,
.ag-dashboard-business-status.is-offer-sent {
    color: #b45309;
    background: #fffbeb;
}

.ag-dashboard-business-status.is-project-cancelled,
.ag-dashboard-business-status.is-offer-rejected,
.ag-dashboard-business-status.is-offer-expired {
    color: #b91c1c;
    background: #fef2f2;
}

.ag-dashboard-business-empty,
.ag-dashboard-business-panel__error {
    padding: 18px 14px;

    color: var(--ag-muted, #64748b);

    font-size: .67rem;
    text-align: center;
}

.ag-dashboard-business-panel__footer {
    display: flex;
    align-items: center;
    gap: 7px;

    padding: 10px 14px;

    border-top: 1px solid var(--ag-border, #e5e7eb);
}

/*
 * Nuevas opciones rápidas.
 */
.ag-dashboard-projects-offers-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

    padding: 12px 14px;
}

.ag-dashboard-quick-link {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;
    min-height: 46px;
    padding: 9px 10px;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 10px;

    color: var(--ag-text, #111827);
    background: var(--ag-surface-soft, #f8fafc);

    font-size: .66rem;
    text-decoration: none;
}

.ag-dashboard-quick-link:hover {
    border-color: rgba(37, 99, 235, .3);

    color: var(--ag-primary, #2563eb);
    background: rgba(37, 99, 235, .06);

    text-decoration: none;
}

.ag-dashboard-quick-link > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    min-width: 30px;

    border-radius: 8px;
}

.ag-dashboard-quick-link--projects > span {
    color: #2563eb;
    background: rgba(37, 99, 235, .1);
}

.ag-dashboard-quick-link--offers > span {
    color: #7c3aed;
    background: rgba(124, 58, 237, .1);
}

.ag-dashboard-quick-link svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-dashboard-quick-link strong {
    overflow: hidden;

    font-size: .66rem;
    font-weight: 710;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Mantener los nuevos widgets utilizables en tamaños reducidos.
 */
.ag-dashboard-grid-item[data-widget-id="projects-summary"],
.ag-dashboard-grid-item[data-widget-id="offers-summary"] {
    min-height: 250px;
}

[data-bs-theme="dark"]
.ag-dashboard-business-status.is-project-planning,
[data-bs-theme="dark"]
.ag-dashboard-business-status.is-offer-draft {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .12);
}

[data-bs-theme="dark"]
.ag-dashboard-business-status.is-project-active,
[data-bs-theme="dark"]
.ag-dashboard-business-status.is-offer-accepted {
    color: #6ee7b7;
    background: rgba(16, 185, 129, .13);
}

[data-bs-theme="dark"]
.ag-dashboard-business-status.is-project-completed {
    color: #93c5fd;
    background: rgba(59, 130, 246, .14);
}

[data-bs-theme="dark"]
.ag-dashboard-business-status.is-project-paused,
[data-bs-theme="dark"]
.ag-dashboard-business-status.is-offer-sent {
    color: #fcd34d;
    background: rgba(245, 158, 11, .13);
}

[data-bs-theme="dark"]
.ag-dashboard-business-status.is-project-cancelled,
[data-bs-theme="dark"]
.ag-dashboard-business-status.is-offer-rejected,
[data-bs-theme="dark"]
.ag-dashboard-business-status.is-offer-expired {
    color: #fca5a5;
    background: rgba(239, 68, 68, .13);
}

@media (max-width: 760px) {
    .ag-dashboard-business-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ag-dashboard-business-money-grid,
    .ag-dashboard-projects-offers-actions {
        grid-template-columns: 1fr;
    }

    .ag-dashboard-business-panel__header {
        align-items: flex-start;
    }

    .ag-dashboard-business-panel__link {
        display: none;
    }
}


/* ==========================================================
   ARBORIAGEST - User password generator v059
   ========================================================== */

.ag-user-password-generator {
    width: 100%;
    margin-top: 7px;
}

.ag-user-password-generator__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ag-user-password-generator__button,
.ag-user-password-generator__icon-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;

    min-height: 32px !important;

    padding-top: 5px !important;
    padding-bottom: 5px !important;

    font-size: .68rem !important;
    line-height: 1 !important;
}

.ag-user-password-generator__button svg,
.ag-user-password-generator__icon-button svg {
    width: 15px;
    height: 15px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-user-password-generator__icon-button {
    width: 34px;
    min-width: 34px;

    padding-left: 5px !important;
    padding-right: 5px !important;
}

.ag-user-password-generator__icon-button.is-visible {
    color: var(--ag-primary, #2563eb) !important;

    border-color: rgba(37, 99, 235, .35) !important;
    background: rgba(37, 99, 235, .08) !important;
}

.ag-user-password-generator__help {
    display: block;

    margin-top: 6px;

    color: var(--ag-muted, #64748b);

    font-size: .61rem;
    line-height: 1.35;
}

[data-bs-theme="dark"]
.ag-user-password-generator__icon-button.is-visible {
    color: #93c5fd !important;

    border-color: rgba(96, 165, 250, .3) !important;
    background: rgba(59, 130, 246, .14) !important;
}

@media (max-width: 575.98px) {
    .ag-user-password-generator__actions {
        align-items: stretch;
    }

    .ag-user-password-generator__button {
        flex: 1 1 auto;
    }
}


/* ==========================================================
   ARBORIAGEST - User activity v060
   ========================================================== */

.ag-user-activity-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 10px;

    margin-bottom: 18px;
}

.ag-user-activity-summary__card {
    min-width: 0;
    padding: 14px;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 12px;

    background: var(--ag-surface-soft, #f8fafc);
}

.ag-user-activity-summary__card span {
    display: block;

    color: var(--ag-muted, #64748b);

    font-size: .66rem;
    font-weight: 620;
}

.ag-user-activity-summary__card strong {
    display: block;
    margin-top: 6px;

    overflow: hidden;

    color: var(--ag-text, #111827);

    font-size: .78rem;
    font-weight: 740;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-user-activity-section {
    overflow: hidden;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 13px;

    background: var(--ag-surface, #fff);
}

.ag-user-activity-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 15px;

    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-user-activity-section__header h3 {
    margin: 0;

    color: var(--ag-text, #111827);

    font-size: .82rem;
    font-weight: 740;
}

.ag-user-activity-section__header p {
    margin: 3px 0 0;

    color: var(--ag-muted, #64748b);

    font-size: .64rem;
}

.ag-user-activity-timeline {
    padding: 5px 14px 10px;
}

.ag-user-activity-event {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 11px;

    padding: 12px 0;

    border-bottom: 1px solid
        rgba(148, 163, 184, .16);
}

.ag-user-activity-event:last-child {
    border-bottom: 0;
}

.ag-user-activity-event__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    border-radius: 9px;

    color: #2563eb;
    background: rgba(37, 99, 235, .1);

    font-size: .8rem;
    font-weight: 800;
}

.ag-user-activity-event__icon.is-key {
    color: #7c3aed;
    background: rgba(124, 58, 237, .1);
}

.ag-user-activity-event__icon.is-shield {
    color: #0891b2;
    background: rgba(8, 145, 178, .1);
}

.ag-user-activity-event__icon.is-user-plus {
    color: #047857;
    background: rgba(16, 185, 129, .1);
}

.ag-user-activity-event__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.ag-user-activity-event__head strong,
.ag-user-activity-event__head span {
    display: block;
}

.ag-user-activity-event__head strong {
    color: var(--ag-text, #111827);

    font-size: .72rem;
    font-weight: 730;
}

.ag-user-activity-event__head span {
    margin-top: 2px;

    color: var(--ag-muted, #64748b);

    font-size: .64rem;
}

.ag-user-activity-event__head time {
    flex: 0 0 auto;

    color: var(--ag-muted, #64748b);

    font-size: .61rem;
    white-space: nowrap;
}

.ag-user-activity-event__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 15px;

    margin-top: 7px;
}

.ag-user-activity-event__meta span {
    color: var(--ag-muted, #64748b);

    font-size: .59rem;
}

.ag-user-activity-event__meta strong {
    color: var(--ag-text, #111827);
    font-weight: 680;
}

.ag-user-activity-empty {
    padding: 35px 20px;

    color: var(--ag-muted, #64748b);

    font-size: .7rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .ag-user-activity-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ag-user-activity-summary {
        grid-template-columns: 1fr;
    }

    .ag-user-activity-event__head {
        display: block;
    }

    .ag-user-activity-event__head time {
        display: block;
        margin-top: 5px;
    }
}


/* ARBORIAGEST ADMIN FUNCTION CARDS V062 START */

/*
 * Cuadrícula general.
 */
.ag-admin-functions-grid {
    align-items: stretch;
}

/*
 * Tarjeta principal.
 */
.ag-admin-function-card {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    width: 100%;
    min-height: 188px;
    height: 100%;

    padding: 17px;

    overflow: hidden;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 16px;

    color: var(--ag-text, #111827);
    background: var(--ag-surface, #ffffff);

    box-shadow:
        0 1px 2px rgba(15, 23, 42, .05),
        0 8px 22px rgba(15, 23, 42, .055);

    text-decoration: none;

    transition:
        border-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease,
        background-color .18s ease;
}

a.ag-admin-function-card:hover {
    border-color: rgba(37, 99, 235, .22);

    color: var(--ag-text, #111827);
    background: var(--ag-surface, #ffffff);

    box-shadow:
        0 2px 4px rgba(15, 23, 42, .05),
        0 14px 30px rgba(15, 23, 42, .09);

    text-decoration: none;

    transform: translateY(-2px);
}

a.ag-admin-function-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .2);
    outline-offset: 2px;
}

/*
 * Icono.
 */
.ag-admin-function-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;
    min-width: 54px;

    margin-bottom: 18px;

    border-radius: 14px;

    font-size: .84rem;
    font-weight: 720;
    letter-spacing: -.02em;
}

.ag-admin-function-card__icon svg {
    display: block;

    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-admin-function-card__icon--text {
    font-size: .82rem;
    font-weight: 650;
}

/*
 * Variantes cromáticas.
 */
.ag-admin-function-card__icon--blue {
    color: #2563eb;
    background: #eff6ff;
}

.ag-admin-function-card__icon--purple {
    color: #9333ea;
    background: #f3e8ff;
}

.ag-admin-function-card__icon--green {
    color: #059669;
    background: #ecfdf5;
}

.ag-admin-function-card__icon--orange {
    color: #d97706;
    background: #fff7ed;
}

.ag-admin-function-card__icon--cyan {
    color: #0891b2;
    background: #ecfeff;
}

.ag-admin-function-card__icon--indigo {
    color: #4f46e5;
    background: #eef2ff;
}

/*
 * Contenido.
 */
.ag-admin-function-card__content {
    min-width: 0;
    padding-right: 24px;
}

.ag-admin-function-card__content h3 {
    margin: 0 0 8px;

    color: var(--ag-text, #111827);

    font-size: 1rem;
    font-weight: 740;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.ag-admin-function-card__content p {
    margin: 0;

    color: var(--ag-muted, #64748b);

    font-size: .79rem;
    font-weight: 430;
    line-height: 1.55;
}

/*
 * Flecha inferior derecha.
 */
.ag-admin-function-card__arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 27px;
    height: 27px;

    border-radius: 8px;

    color: var(--ag-muted, #64748b);
    background: transparent;

    opacity: 0;

    transform: translateX(-4px);

    transition:
        opacity .18s ease,
        color .18s ease,
        background-color .18s ease,
        transform .18s ease;
}

.ag-admin-function-card__arrow svg {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

a.ag-admin-function-card:hover
.ag-admin-function-card__arrow {
    color: #2563eb;
    background: rgba(37, 99, 235, .08);

    opacity: 1;

    transform: translateX(0);
}

/*
 * Tarjeta sin ruta disponible.
 */
.ag-admin-function-card--disabled {
    cursor: default;
}

.ag-admin-function-card--disabled::after {
    position: absolute;
    inset: 0;

    content: "";

    pointer-events: none;
}

.ag-admin-function-card__pending {
    position: absolute;
    top: 17px;
    right: 17px;

    display: inline-flex;
    align-items: center;

    min-height: 23px;
    padding: 3px 8px;

    border-radius: 999px;

    color: #7c3aed;
    background: rgba(124, 58, 237, .09);

    font-size: .57rem;
    font-weight: 700;
    letter-spacing: .01em;
}

/*
 * Modo oscuro.
 */
[data-bs-theme="dark"]
.ag-admin-function-card {
    border-color: rgba(148, 163, 184, .14);

    background: var(--ag-surface, #111827);

    box-shadow:
        0 1px 2px rgba(0, 0, 0, .12),
        0 9px 24px rgba(0, 0, 0, .16);
}

[data-bs-theme="dark"]
a.ag-admin-function-card:hover {
    border-color: rgba(96, 165, 250, .25);

    background: rgba(30, 41, 59, .96);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--blue {
    color: #93c5fd;
    background: rgba(59, 130, 246, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--purple {
    color: #d8b4fe;
    background: rgba(168, 85, 247, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--green {
    color: #6ee7b7;
    background: rgba(16, 185, 129, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--orange {
    color: #fcd34d;
    background: rgba(245, 158, 11, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--cyan {
    color: #67e8f9;
    background: rgba(6, 182, 212, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__icon--indigo {
    color: #a5b4fc;
    background: rgba(99, 102, 241, .14);
}

[data-bs-theme="dark"]
.ag-admin-function-card__pending {
    color: #d8b4fe;
    background: rgba(168, 85, 247, .14);
}

/*
 * Ajustes adaptativos.
 */
@media (max-width: 767.98px) {
    .ag-admin-function-card {
        min-height: 166px;
        padding: 15px;
    }

    .ag-admin-function-card__icon {
        width: 48px;
        height: 48px;
        min-width: 48px;

        margin-bottom: 15px;
    }

    .ag-admin-function-card__content h3 {
        font-size: .94rem;
    }

    .ag-admin-function-card__content p {
        font-size: .75rem;
    }

    .ag-admin-function-card__arrow {
        opacity: 1;
        transform: none;
    }
}

/* ARBORIAGEST ADMIN FUNCTION CARDS V062 END */


/* ==========================================================
   ARBORIAGEST - Time clock core v063
   ========================================================== */

.ag-clock-state {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ag-clock-state__indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.ag-clock-state__indicator.is-working {
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, .12);
}

.ag-clock-state__indicator.is-on_break {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, .12);
}

.ag-clock-state__indicator.is-outside {
    background: #94a3b8;
    box-shadow: 0 0 0 6px rgba(148, 163, 184, .12);
}

.ag-clock-state span {
    display: block;
    color: var(--ag-muted, #64748b);
    font-size: .67rem;
}

.ag-clock-state strong {
    display: block;
    margin-top: 2px;
    color: var(--ag-text, #111827);
    font-size: .92rem;
}

.ag-clock-current-time {
    margin: 35px 0;
    color: var(--ag-text, #111827);
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 760;
    letter-spacing: -.05em;
    text-align: center;
}

.ag-clock-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.ag-clock-location-status {
    margin-top: 18px;
    color: var(--ag-muted, #64748b);
    font-size: .64rem;
    text-align: center;
}

.ag-clock-timeline {
    display: flex;
    flex-direction: column;
}

.ag-clock-timeline__item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-clock-timeline__item:last-child {
    border-bottom: 0;
}

.ag-clock-timeline__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #64748b;
}

.ag-clock-timeline__dot.is-clock_in,
.ag-clock-timeline__dot.is-break_end {
    background: #10b981;
}

.ag-clock-timeline__dot.is-break_start {
    background: #f59e0b;
}

.ag-clock-timeline__dot.is-clock_out {
    background: #ef4444;
}

.ag-clock-timeline__item strong,
.ag-clock-timeline__item span {
    display: block;
}

.ag-clock-timeline__item strong {
    color: var(--ag-text, #111827);
    font-size: .69rem;
}

.ag-clock-timeline__item span,
.ag-clock-timeline__item small {
    color: var(--ag-muted, #64748b);
    font-size: .61rem;
}

.ag-clock-live-status {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
}

.ag-clock-live-status.is-working {
    color: #047857;
    background: #ecfdf5;
}

.ag-clock-live-status.is-on_break {
    color: #b45309;
    background: #fffbeb;
}

.ag-clock-live-status.is-outside {
    color: #475569;
    background: #f1f5f9;
}

@media (max-width: 575.98px) {
    .ag-clock-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ag-clock-actions .btn {
        width: 100%;
    }
}


/* ==========================================================
   ARBORIAGEST - Time clock core v063
   ========================================================== */

.ag-clock-state {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ag-clock-state__indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.ag-clock-state__indicator.is-working {
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, .12);
}

.ag-clock-state__indicator.is-on_break {
    background: #f59e0b;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, .12);
}

.ag-clock-state__indicator.is-outside {
    background: #94a3b8;
    box-shadow: 0 0 0 6px rgba(148, 163, 184, .12);
}

.ag-clock-state span {
    display: block;
    color: var(--ag-muted, #64748b);
    font-size: .67rem;
}

.ag-clock-state strong {
    display: block;
    margin-top: 2px;
    color: var(--ag-text, #111827);
    font-size: .92rem;
}

.ag-clock-current-time {
    margin: 35px 0;
    color: var(--ag-text, #111827);
    font-size: clamp(2.2rem, 8vw, 4rem);
    font-weight: 760;
    letter-spacing: -.05em;
    text-align: center;
}

.ag-clock-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.ag-clock-location-status {
    margin-top: 18px;
    color: var(--ag-muted, #64748b);
    font-size: .64rem;
    text-align: center;
}

.ag-clock-timeline {
    display: flex;
    flex-direction: column;
}

.ag-clock-timeline__item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-clock-timeline__item:last-child {
    border-bottom: 0;
}

.ag-clock-timeline__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #64748b;
}

.ag-clock-timeline__dot.is-clock_in,
.ag-clock-timeline__dot.is-break_end {
    background: #10b981;
}

.ag-clock-timeline__dot.is-break_start {
    background: #f59e0b;
}

.ag-clock-timeline__dot.is-clock_out {
    background: #ef4444;
}

.ag-clock-timeline__item strong,
.ag-clock-timeline__item span {
    display: block;
}

.ag-clock-timeline__item strong {
    color: var(--ag-text, #111827);
    font-size: .69rem;
}

.ag-clock-timeline__item span,
.ag-clock-timeline__item small {
    color: var(--ag-muted, #64748b);
    font-size: .61rem;
}

.ag-clock-live-status {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
}

.ag-clock-live-status.is-working {
    color: #047857;
    background: #ecfdf5;
}

.ag-clock-live-status.is-on_break {
    color: #b45309;
    background: #fffbeb;
}

.ag-clock-live-status.is-outside {
    color: #475569;
    background: #f1f5f9;
}

@media (max-width: 575.98px) {
    .ag-clock-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ag-clock-actions .btn {
        width: 100%;
    }
}


/* ARBORIAGEST TIME CLOCK TOPBAR V065 START */

.ag-clock-topbar-source {
    display: none;
}

.ag-clock-topbar {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 9px;
}

.ag-clock-topbar__trigger {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 39px;
    height: 39px;
    padding: 0;

    border: 1px solid transparent;
    border-radius: 12px;

    color: #64748b;
    background: rgba(148, 163, 184, .08);

    cursor: pointer;

    transition:
        color .18s ease,
        border-color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.ag-clock-topbar__trigger:hover {
    transform: translateY(-1px);
}

.ag-clock-topbar__trigger:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .18);
    outline-offset: 2px;
}

.ag-clock-topbar__trigger.is-working {
    color: #059669;
    border-color: rgba(16, 185, 129, .22);
    background: rgba(16, 185, 129, .1);

    box-shadow:
        0 0 0 1px rgba(16, 185, 129, .06),
        0 0 17px rgba(16, 185, 129, .25);
}

.ag-clock-topbar__trigger.is-on_break {
    color: #d97706;
    border-color: rgba(245, 158, 11, .25);
    background: rgba(245, 158, 11, .11);

    box-shadow:
        0 0 0 1px rgba(245, 158, 11, .06),
        0 0 17px rgba(245, 158, 11, .26);
}

.ag-clock-topbar__trigger.is-outside {
    color: #64748b;
    border-color: rgba(148, 163, 184, .18);
    background: rgba(148, 163, 184, .08);
}

.ag-clock-topbar__glow {
    position: absolute;
    inset: 5px;

    border-radius: 9px;

    opacity: 0;
    pointer-events: none;
}

.ag-clock-topbar__trigger.is-working
.ag-clock-topbar__glow {
    background: rgba(16, 185, 129, .15);
    opacity: 1;

    animation:
        agClockTopbarWorkingGlow
        2.3s ease-in-out infinite;
}

.ag-clock-topbar__trigger.is-on_break
.ag-clock-topbar__glow {
    background: rgba(245, 158, 11, .15);
    opacity: 1;

    animation:
        agClockTopbarPauseGlow
        2.3s ease-in-out infinite;
}

.ag-clock-topbar__icon {
    position: relative;
    z-index: 2;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ag-clock-topbar__icon svg {
    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-clock-topbar__status-dot {
    position: absolute;
    right: 4px;
    bottom: 4px;
    z-index: 3;

    width: 8px;
    height: 8px;

    border: 2px solid var(--ag-surface, #fff);
    border-radius: 50%;

    background: #94a3b8;
}

.ag-clock-topbar__trigger.is-working
.ag-clock-topbar__status-dot {
    background: #10b981;
}

.ag-clock-topbar__trigger.is-on_break
.ag-clock-topbar__status-dot {
    background: #f59e0b;
}

.ag-clock-topbar__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1080;

    width: min(330px, calc(100vw - 28px));

    overflow: hidden;

    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 15px;

    background: var(--ag-surface, #fff);

    box-shadow:
        0 20px 45px rgba(15, 23, 42, .15),
        0 4px 12px rgba(15, 23, 42, .08);

    transform-origin: top right;

    animation:
        agClockTopbarMenuOpen .15s ease-out;
}

.ag-clock-topbar__menu[hidden] {
    display: none !important;
}

.ag-clock-topbar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 14px;

    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-clock-topbar__header span,
.ag-clock-topbar__header strong {
    display: block;
}

.ag-clock-topbar__header > div > span {
    color: var(--ag-muted, #64748b);
    font-size: .62rem;
}

.ag-clock-topbar__header > div > strong {
    margin-top: 2px;

    color: var(--ag-text, #111827);

    font-size: .78rem;
    font-weight: 740;
}

.ag-clock-topbar__state {
    display: inline-flex;
    align-items: center;

    min-height: 23px;
    padding: 3px 8px;

    border-radius: 999px;

    font-size: .58rem;
    font-weight: 720;
}

.ag-clock-topbar__state.is-working {
    color: #047857;
    background: #ecfdf5;
}

.ag-clock-topbar__state.is-on_break {
    color: #b45309;
    background: #fffbeb;
}

.ag-clock-topbar__state.is-outside {
    color: #475569;
    background: #f1f5f9;
}

.ag-clock-topbar__last-event {
    padding: 9px 14px;

    border-bottom: 1px solid var(--ag-border, #e5e7eb);

    color: var(--ag-muted, #64748b);
    background: var(--ag-surface-soft, #f8fafc);

    font-size: .61rem;
}

.ag-clock-topbar__last-event strong {
    color: var(--ag-text, #111827);
}

.ag-clock-topbar__actions {
    display: flex;
    flex-direction: column;
    padding: 7px;
}

.ag-clock-topbar__action {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 9px;

    border: 0;
    border-radius: 10px;

    color: var(--ag-text, #111827);
    background: transparent;

    text-align: left;
    cursor: pointer;

    transition:
        color .15s ease,
        background-color .15s ease;
}

.ag-clock-topbar__action:hover {
    background: var(--ag-surface-soft, #f8fafc);
}

.ag-clock-topbar__action:disabled {
    cursor: wait;
    opacity: .58;
}

.ag-clock-topbar__action > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    min-width: 34px;

    border-radius: 9px;
}

.ag-clock-topbar__action > span svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-clock-topbar__action.is-start > span,
.ag-clock-topbar__action.is-resume > span {
    color: #059669;
    background: rgba(16, 185, 129, .1);
}

.ag-clock-topbar__action.is-pause > span {
    color: #d97706;
    background: rgba(245, 158, 11, .11);
}

.ag-clock-topbar__action.is-stop > span {
    color: #dc2626;
    background: rgba(239, 68, 68, .1);
}

.ag-clock-topbar__action strong,
.ag-clock-topbar__action small {
    display: block;
}

.ag-clock-topbar__action strong {
    color: inherit;

    font-size: .68rem;
    font-weight: 710;
}

.ag-clock-topbar__action small {
    margin-top: 2px;

    color: var(--ag-muted, #64748b);
    font-size: .58rem;
}

.ag-clock-topbar__details {
    display: block;

    padding: 10px 14px;

    border-top: 1px solid var(--ag-border, #e5e7eb);

    color: var(--ag-primary, #2563eb);
    background: var(--ag-surface-soft, #f8fafc);

    font-size: .63rem;
    font-weight: 690;
    text-align: center;
    text-decoration: none;
}

.ag-clock-topbar__details:hover {
    text-decoration: underline;
}

@keyframes agClockTopbarWorkingGlow {
    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(16, 185, 129, .28);
    }

    50% {
        box-shadow:
            0 0 0 7px rgba(16, 185, 129, 0);
    }
}

@keyframes agClockTopbarPauseGlow {
    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(245, 158, 11, .28);
    }

    50% {
        box-shadow:
            0 0 0 7px rgba(245, 158, 11, 0);
    }
}

@keyframes agClockTopbarMenuOpen {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[data-bs-theme="dark"]
.ag-clock-topbar__status-dot {
    border-color: var(--ag-surface, #111827);
}

[data-bs-theme="dark"]
.ag-clock-topbar__state.is-working {
    color: #6ee7b7;
    background: rgba(16, 185, 129, .13);
}

[data-bs-theme="dark"]
.ag-clock-topbar__state.is-on_break {
    color: #fcd34d;
    background: rgba(245, 158, 11, .13);
}

[data-bs-theme="dark"]
.ag-clock-topbar__state.is-outside {
    color: #cbd5e1;
    background: rgba(148, 163, 184, .12);
}

@media (max-width: 575.98px) {
    .ag-clock-topbar {
        margin-right: 5px;
    }

    .ag-clock-topbar__trigger {
        width: 36px;
        height: 36px;
    }

    .ag-clock-topbar__menu {
        position: fixed;
        top: 62px;
        right: 10px;
        left: 10px;

        width: auto;
    }
}

/* ARBORIAGEST TIME CLOCK TOPBAR V065 END */


/* ARBORIAGEST TIME CLOCK TOPBAR ALIGN V068 START */

/*
 * El componente está insertado dinámicamente junto al menú de usuario.
 * Se usa transform porque los márgenes verticales pueden quedar anulados
 * por la alineación flex del contenedor superior.
 */
.ag-clock-topbar {
    position: relative !important;
    top: 0 !important;

    align-self: center !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;

    transform: translateY(-8px) !important;
}

/*
 * Evita que reglas anteriores del botón compensen el desplazamiento.
 */
.ag-clock-topbar__trigger {
    position: relative !important;
    top: 0 !important;

    margin-top: 0 !important;
    margin-bottom: 0 !important;

    transform: none;
}

/*
 * El hover conserva la alineación vertical y solo genera
 * un desplazamiento adicional muy ligero.
 */
.ag-clock-topbar__trigger:hover {
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .ag-clock-topbar {
        transform: translateY(-6px) !important;
    }
}

/* ARBORIAGEST TIME CLOCK TOPBAR ALIGN V068 END */


/* ARBORIAGEST DEPARTMENTS V075 START */

.ag-departments-back {
    display: inline-flex;
    margin-bottom: 6px;
    color: var(--ag-muted, #64748b);
    font-size: .7rem;
    font-weight: 650;
    text-decoration: none;
}

.ag-departments-panel {
    overflow: hidden;
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 16px;
    background: var(--ag-surface, #fff);
}

.ag-departments-panel__header {
    padding: 17px 19px;
    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-departments-panel__header h2 {
    margin: 0;
    font-size: .9rem;
    font-weight: 750;
}

.ag-departments-panel__header p {
    margin: 3px 0 0;
    color: var(--ag-muted, #64748b);
    font-size: .62rem;
}

.ag-department-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--ag-border, #edf0f4);
}

.ag-department-row__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #7c3aed;
    background: rgba(124, 58, 237, .1);
}

.ag-department-row__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-department-row__content strong,
.ag-department-row__content span {
    display: block;
}

.ag-department-row__content strong {
    font-size: .72rem;
}

.ag-department-row__content span {
    margin-top: 3px;
    color: var(--ag-muted, #64748b);
    font-size: .6rem;
}

.ag-department-row__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ag-muted, #64748b);
    font-size: .6rem;
}

.ag-department-status {
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.ag-department-status.is-active {
    color: #047857;
    background: #ecfdf5;
}

.ag-department-status.is-inactive {
    color: #64748b;
    background: #f1f5f9;
}

.ag-department-row__actions {
    display: flex;
    gap: 7px;
}

.ag-departments-empty {
    padding: 35px;
    color: var(--ag-muted, #64748b);
    font-size: .68rem;
    text-align: center;
}

.ag-user-tag--department {
    color: #6d28d9;
    background: rgba(124, 58, 237, .1);
}

.ag-user-tag--department-empty {
    color: #64748b;
    background: #f1f5f9;
}

@media (max-width: 767.98px) {
    .ag-department-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }

    .ag-department-row__meta {
        display: none;
    }
}

/* ARBORIAGEST DEPARTMENTS V075 END */


/* ARBORIAGEST RICH TEXT COMMENTS V079 START */

.ag-rich-editor {
    overflow: hidden;

    border: 1px solid var(--ag-border, #dbe2ea);
    border-radius: 10px;

    background: var(--ag-surface, #fff);

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}

.ag-rich-editor:focus-within {
    border-color: var(--bs-primary, #2563eb);

    box-shadow:
        0 0 0 .2rem
        rgba(37, 99, 235, .12);
}

.ag-rich-editor__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;

    padding: 7px 8px;

    border-bottom: 1px solid var(--ag-border, #e5e7eb);

    background: var(--ag-surface-soft, #f8fafc);
}

.ag-rich-editor__toolbar button {
    min-width: 31px;
    min-height: 29px;
    padding: 4px 8px;

    border: 0;
    border-radius: 6px;

    color: var(--ag-text, #334155);
    background: transparent;

    font-size: .68rem;
}

.ag-rich-editor__toolbar button:hover {
    color: var(--bs-primary, #2563eb);
    background: rgba(37, 99, 235, .09);
}

.ag-rich-editor__separator {
    width: 1px;
    height: 21px;
    margin: 0 3px;

    background: var(--ag-border, #dbe2ea);
}

.ag-rich-editor__content {
    min-height: 130px;
    max-height: 420px;
    overflow-y: auto;

    padding: 12px 13px;

    outline: none;

    color: var(--ag-text, #111827);

    font-size: .78rem;
    line-height: 1.6;
}

.ag-rich-editor__content:empty::before {
    color: var(--ag-muted, #94a3b8);

    content: attr(data-placeholder);
    pointer-events: none;
}

.ticket-comment-rich {
    overflow-wrap: anywhere;

    font-size: .78rem;
    line-height: 1.65;
}

.ticket-comment-rich p:last-child,
.ticket-comment-rich ul:last-child,
.ticket-comment-rich ol:last-child,
.ticket-comment-rich blockquote:last-child {
    margin-bottom: 0;
}

.ticket-comment-rich blockquote {
    margin: 8px 0;
    padding: 7px 11px;

    border-left: 3px solid var(--bs-primary, #2563eb);

    color: var(--ag-muted, #64748b);
    background: var(--ag-surface-soft, #f8fafc);
}

.ticket-comment-rich a {
    color: var(--bs-primary, #2563eb);
}

.ticket-detail-assignee {
    grid-column: 1 / -1;
}

.ticket-detail-assignee form {
    width: 100%;
}

/* ARBORIAGEST RICH TEXT COMMENTS V079 END */


/* ==========================================================
   ARBORIAGEST - Dashboard compras por estado v087
   ========================================================== */

.ag-purchase-status-panel {
    margin-top: 1rem;
}

.ag-purchase-dashboard-kpi-link {
    color: inherit;
    text-decoration: none;
    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        transform .15s ease;
}

.ag-purchase-dashboard-kpi-link:hover {
    color: inherit;
    border-color: var(--ag-blue-100, #DBEAFE);
    box-shadow: var(
        --ag-shadow-sm,
        0 1px 2px rgba(15, 23, 42, .06)
    );
    transform: translateY(-1px);
}

.ag-purchase-dashboard-row {
    color: inherit;
    text-decoration: none;
    padding: .15rem 0;
    border-radius: var(--ag-radius-sm, 8px);
}

.ag-purchase-dashboard-row:hover {
    color: inherit;
}

.ag-purchase-dashboard-row:hover
.ag-real-dashboard-chart-label span:first-child {
    color: var(--ag-blue-600, #2563EB);
}

.ag-purchase-dashboard-values {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
}

.ag-purchase-dashboard-values small {
    color: var(--ag-muted, #64748B);
    font-weight: 400;
}

.ag-purchase-dashboard-values strong {
    min-width: 2rem;
    text-align: right;
}

@media (max-width: 767.98px) {
    .ag-purchase-status-panel
    .ag-real-dashboard-chart-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ag-purchase-dashboard-values small {
        display: none;
    }
}

/* ==========================================================
   ARBORIAGEST - Cabeceras uniformes dashboard v089
   ========================================================== */

/*
 * Tickets y Compras reutilizan exactamente la estructura
 * visual de Proyectos y Ofertas.
 */

.ag-dashboard-tickets-panel,
.ag-dashboard-purchases-panel {
    overflow: hidden;
}

.ag-dashboard-tickets-panel
.ag-dashboard-business-panel__header,
.ag-dashboard-purchases-panel
.ag-dashboard-business-panel__header {
    min-height: 80px;
}

/* Icono Tickets */

.ag-dashboard-business-panel__icon--tickets {
    color: #7C3AED;
    background: #F3E8FF;
}

.ag-dashboard-business-panel__icon--tickets svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Icono Compras */

.ag-dashboard-business-panel__icon--purchases {
    color: #EA580C;
    background: #FFF7ED;
}

.ag-dashboard-business-panel__icon--purchases svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-dashboard-business-panel__icon--purchases circle {
    fill: currentColor;
    stroke: none;
}

/*
 * El contenido estadístico mantiene sus estilos actuales,
 * pero queda separado de la cabecera como en Proyectos.
 */

.ag-dashboard-tickets-panel
.ag-real-dashboard-chart-summary,
.ag-dashboard-purchases-panel
.ag-real-dashboard-chart-summary {
    margin-top: 1rem;
}

/*
 * Evita que estilos antiguos vuelvan a aplicar una cabecera
 * diferente sobre Tickets o Compras.
 */

.ag-dashboard-tickets-panel
.ag-real-dashboard-chart-head,
.ag-dashboard-purchases-panel
.ag-real-dashboard-chart-head {
    display: none !important;
}

[data-bs-theme="dark"]
.ag-dashboard-business-panel__icon--tickets {
    background: rgba(124, 58, 237, .18);
    color: #C4B5FD;
}

[data-bs-theme="dark"]
.ag-dashboard-business-panel__icon--purchases {
    background: rgba(234, 88, 12, .18);
    color: #FDBA74;
}

@media (max-width: 575.98px) {
    .ag-dashboard-tickets-panel
    .ag-dashboard-business-panel__header,
    .ag-dashboard-purchases-panel
    .ag-dashboard-business-panel__header {
        align-items: flex-start;
    }
}

/* ==========================================================
   ARBORIAGEST - Módulo Clientes v091
   ========================================================== */

.ag-client-list {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.ag-client-card {
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: var(--ag-radius-lg, 16px);
    background: var(--ag-surface, #fff);
    overflow: hidden;
}

.ag-client-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--ag-border, #e5e7eb);
}

.ag-client-card__identity {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
}

.ag-client-card__identity h3 {
    margin: 0;
    font-size: 1rem;
}

.ag-client-card__identity span {
    color: var(--ag-muted, #64748b);
    font-size: .8rem;
}

.ag-client-card__avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #dbeafe;
    color: #2563eb !important;
    font-size: 1rem !important;
    font-weight: 700;
}

.ag-client-card__actions {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.ag-client-card__body {
    padding: 1rem;
}

.ag-client-address {
    display: grid;
    gap: .2rem;
}

.ag-client-address small {
    color: var(--ag-muted, #64748b);
}

.ag-client-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .65rem;
}

.ag-client-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: .15rem .55rem;
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: 999px;
    background: var(--ag-surface-soft, #f8fafc);
    color: var(--ag-muted, #475569);
    font-size: .72rem;
    font-weight: 600;
}

.ag-client-centers-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ag-border, #e5e7eb);
}

.ag-client-centers-head h4 {
    margin: 0;
    font-size: .9rem;
}

.ag-client-centers-head span {
    color: var(--ag-muted, #64748b);
    font-size: .75rem;
}

.ag-client-centers {
    display: grid;
    gap: .65rem;
    margin-top: .75rem;
}

.ag-client-center {
    display: grid;
    grid-template-columns:
        minmax(200px, 1.1fr)
        minmax(180px, .9fr)
        minmax(220px, 1.2fr)
        auto;
    gap: .8rem;
    align-items: center;
    padding: .8rem;
    border: 1px solid var(--ag-border, #e5e7eb);
    border-radius: var(--ag-radius-md, 12px);
    background: var(--ag-surface-soft, #f8fafc);
}

.ag-client-center__main {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.ag-client-center__main > div,
.ag-client-center__contact {
    display: grid;
    gap: .15rem;
}

.ag-client-center__main span,
.ag-client-center__contact span,
.ag-client-center__address {
    color: var(--ag-muted, #64748b);
    font-size: .78rem;
}

.ag-client-center__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 30px;
    padding: 0 .5rem;
    border-radius: 8px;
    background: #ede9fe;
    color: #7c3aed !important;
    font-weight: 800;
    letter-spacing: .08em;
}

.ag-client-center-empty,
.ag-client-empty {
    padding: 1rem;
    border: 1px dashed var(--ag-border, #e5e7eb);
    border-radius: var(--ag-radius-md, 12px);
    color: var(--ag-muted, #64748b);
    text-align: center;
}

@media (max-width: 1100px) {
    .ag-client-center {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .ag-client-card__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .ag-client-card__actions {
        width: 100%;
    }

    .ag-client-center {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   ARBORIAGEST - CLIENT ICON V092C
   ========================================================== */

.ag-clients-page-heading__title {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
}

.ag-clients-page-heading__title h1 {
    margin-bottom: .15rem;
}

.ag-clients-page-heading__icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #e0f2fe;
    color: #0284c7;
}

.ag-clients-page-heading__icon i {
    font-size: 1.5rem;
}

[data-bs-theme="dark"]
.ag-clients-page-heading__icon {
    background: rgba(14, 165, 233, .18);
    color: #7dd3fc;
}

@media (max-width: 575.98px) {
    .ag-clients-page-heading__title {
        align-items: flex-start;
    }
}

/* ==========================================================
   ARBORIAGEST - COMPACT CLIENT CENTERS V093
   ========================================================== */

.ag-client-centers {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: .55rem;
}

.ag-client-center-compact {
    position: relative;
    flex: 0 0 auto;
    max-width: 100%;
}

.ag-client-center-compact[open] {
    flex: 1 1 100%;
    width: 100%;
}

.ag-client-center-compact__summary {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    min-height: 36px;
    padding: .3rem .55rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 999px;
    background: var(--ag-surface-soft, #f8fafc);
    cursor: pointer;
    list-style: none;
    transition:
        border-color .18s ease,
        background-color .18s ease,
        box-shadow .18s ease;
}

.ag-client-center-compact__summary::-webkit-details-marker {
    display: none;
}

.ag-client-center-compact__summary::marker {
    display: none;
    content: "";
}

.ag-client-center-compact__summary:hover {
    border-color: #93b4f5;
    background: #f4f7ff;
}

.ag-client-center-compact[open]
.ag-client-center-compact__summary {
    display: flex;
    width: 100%;
    border-radius: 12px 12px 0 0;
    border-color: #93b4f5;
    background: #f4f7ff;
}

.ag-client-center-compact__identity {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
}

.ag-client-center-compact__identity strong {
    overflow: hidden;
    max-width: 260px;
    color: var(--ag-text, #0f172a);
    font-size: .8rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-client-center-compact
.ag-client-center__code {
    min-width: auto;
    height: 24px;
    padding: 0 .45rem;
    border-radius: 999px;
    font-size: .68rem;
    line-height: 1;
}

.ag-client-center-compact__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ag-muted, #64748b);
    transition: transform .18s ease;
}

.ag-client-center-compact__chevron svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ag-client-center-compact[open]
.ag-client-center-compact__chevron {
    transform: rotate(90deg);
}

.ag-client-center-compact__content {
    padding: 1rem;
    border: 1px solid #93b4f5;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: var(--ag-surface, #fff);
}

.ag-client-center-compact__grid {
    display: grid;
    grid-template-columns:
        minmax(140px, .6fr)
        minmax(210px, 1fr)
        minmax(170px, .8fr)
        minmax(260px, 1.3fr);
    gap: 1rem;
}

.ag-client-center-detail {
    display: grid;
    align-content: start;
    gap: .22rem;
    min-width: 0;
}

.ag-client-center-detail small {
    color: var(--ag-muted, #64748b);
    font-size: .7rem;
    font-weight: 600;
}

.ag-client-center-detail span,
.ag-client-center-detail a {
    overflow-wrap: anywhere;
    color: var(--ag-text, #0f172a);
    font-size: .8rem;
}

.ag-client-center-detail a {
    color: var(--bs-primary);
    text-decoration: none;
}

.ag-client-center-detail a:hover {
    text-decoration: underline;
}

.ag-client-center-compact__actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: .8rem;
    border-top: 1px solid var(--ag-border, #e5e7eb);
}

[data-bs-theme="dark"]
.ag-client-center-compact__summary:hover,
[data-bs-theme="dark"]
.ag-client-center-compact[open]
.ag-client-center-compact__summary {
    background: rgba(37, 99, 235, .12);
}

@media (max-width: 1100px) {
    .ag-client-center-compact__grid {
        grid-template-columns: 1fr 1fr;
    }

    .ag-client-center-detail--address {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .ag-client-centers {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ag-client-center-compact {
        width: 100%;
    }

    .ag-client-center-compact__summary {
        display: flex;
        width: 100%;
    }

    .ag-client-center-compact__identity strong {
        max-width: calc(100vw - 180px);
    }

    .ag-client-center-compact__grid {
        grid-template-columns: 1fr;
    }

    .ag-client-center-detail--address {
        grid-column: auto;
    }

    .ag-client-center-compact__actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ==========================================================
   ARBORIAGEST PROJECT CLIENT PICKER V095
   ========================================================== */

.ag-project-client-picker {
    position: relative;
}

.ag-project-client-results {
    position: absolute;
    z-index: 1085;
    top: calc(100% + 5px);
    right: 0;
    left: 0;
    max-height: 280px;
    overflow-y: auto;
    padding: .35rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 12px;
    background: var(--ag-surface, #fff);
    box-shadow: 0 14px 35px rgba(15, 23, 42, .16);
}

.ag-project-client-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    text-align: left;
}

.ag-project-client-option:hover,
.ag-project-client-option:focus-visible {
    background: var(--ag-surface-soft, #f5f7fb);
    outline: none;
}

.ag-project-client-option__code {
    min-width: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .28rem .45rem;
    border-radius: 7px;
    background: #ede9fe;
    color: #6d28d9;
    font-family: monospace;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
}

.ag-project-client-option__data {
    min-width: 0;
    display: grid;
    gap: .12rem;
}

.ag-project-client-option__data strong {
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-project-client-option__data small {
    overflow: hidden;
    color: var(--ag-muted, #64748b);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-project-client-no-results {
    padding: .8rem;
    color: var(--ag-muted, #64748b);
    font-size: .78rem;
    text-align: center;
}

[data-bs-theme="dark"]
.ag-project-client-option__code {
    background: rgba(124, 58, 237, .2);
    color: #c4b5fd;
}

/* ==========================================================
   ARBORIAGEST MULTIPLE TICKET STATUS FILTER V096
   ========================================================== */

.ag-ticket-status-filter {
    flex: 0 0 auto;
}

.ag-ticket-status-filter > .btn {
    min-width: 175px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: var(--ag-surface, #fff);
}

.ag-ticket-status-filter__menu {
    min-width: 290px;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 12px;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .14);
}

.ag-ticket-status-filter__options {
    display: grid;
    gap: .25rem;
}

.ag-ticket-status-filter__option {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: .55rem;
    min-height: 36px;
    padding: .35rem .45rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: .82rem;
}

.ag-ticket-status-filter__option:hover {
    background: var(--ag-surface-soft, #f5f7fb);
}

.ag-ticket-status-filter__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(
        --ticket-status-color,
        #64748b
    );
    box-shadow: 0 0 0 3px
        color-mix(
            in srgb,
            var(--ticket-status-color, #64748b) 18%,
            transparent
        );
}

.ag-ticket-status-filter
.form-check-input {
    margin: 0;
}

@media (max-width: 767.98px) {
    .ag-ticket-status-filter,
    .ag-ticket-status-filter > .btn {
        width: 100%;
    }

    .ag-ticket-status-filter__menu {
        width: 100%;
        min-width: 260px;
    }
}

/* ==========================================================
   ARBORIAGEST OFFERS PROJECT LINK V097
   ========================================================== */

.ag-offer-project-summary {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(0, 1fr));
    gap: .75rem;
    padding: .9rem;
    border: 1px solid
        var(--ag-border, #dfe4ea);
    border-radius: 12px;
    background:
        var(--ag-surface-soft, #f8fafc);
}

.ag-offer-project-summary[hidden] {
    display: none;
}

.ag-offer-project-summary > div {
    min-width: 0;
    display: grid;
    gap: .2rem;
}

.ag-offer-project-summary small {
    color: var(--ag-muted, #64748b);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.ag-offer-project-summary strong {
    overflow: hidden;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-offer-item--typed {
    grid-template-columns:
        minmax(145px, .9fr)
        minmax(230px, 2fr)
        minmax(85px, .55fr)
        minmax(80px, .5fr)
        minmax(100px, .65fr)
        minmax(85px, .55fr)
        minmax(80px, .5fr)
        38px;
    align-items: end;
}

.ag-offer-item--typed .form-label {
    margin-bottom: .25rem;
    color: var(--ag-muted, #64748b);
    font-size: .66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ag-offer-item__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: .15rem;
}

.ag-offer-document__project {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 1rem;
    border: 1px solid
        var(--ag-border, #dfe4ea);
    border-radius: 12px;
    background:
        var(--ag-surface-soft, #f8fafc);
}

.ag-offer-document__project > div {
    display: grid;
    gap: .2rem;
}

.ag-offer-document__project small {
    color: var(--ag-muted, #64748b);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}

@media (max-width: 1199.98px) {
    .ag-offer-project-summary {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ag-offer-item--typed {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ag-offer-item__description {
        grid-column: 1 / -1;
    }

    .ag-offer-item__remove {
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .ag-offer-project-summary,
    .ag-offer-document__project,
    .ag-offer-item--typed {
        grid-template-columns: 1fr;
    }

    .ag-offer-item__description {
        grid-column: auto;
    }
}

/* ==========================================================
   ARBORIAGEST OFFER PROFIT LIVE TOTALS V098
   ========================================================== */

.ag-offer-item--profit {
    display: grid;
    grid-template-columns:
        minmax(145px, .85fr)
        minmax(230px, 1.65fr)
        minmax(82px, .48fr)
        minmax(75px, .44fr)
        minmax(125px, .72fr)
        minmax(105px, .62fr)
        minmax(110px, .64fr)
        minmax(80px, .46fr)
        minmax(75px, .44fr)
        minmax(105px, .62fr)
        minmax(100px, .58fr)
        minmax(115px, .68fr)
        38px;
    gap: .65rem;
    align-items: end;
}

.ag-offer-item--profit .form-label {
    margin-bottom: .25rem;
    color: var(--ag-muted, #64748b);
    font-size: .65rem;
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.ag-offer-calculated-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: .5rem .65rem;
    border: 1px solid
        var(--ag-border, #dfe4ea);
    border-radius: var(--bs-border-radius, .375rem);
    background:
        var(--ag-surface-soft, #f8fafc);
    color: var(--ag-text, #0f172a);
    font-size: .8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.ag-offer-calculated-value--total {
    border-color: rgba(37, 99, 235, .3);
    background: rgba(37, 99, 235, .08);
    color: #1d4ed8;
}

.ag-offer-live-summary {
    position: sticky;
    z-index: 4;
    bottom: 0;
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
    padding: .85rem;
    border: 1px solid
        var(--ag-border, #dfe4ea);
    border-radius: 14px;
    background:
        color-mix(
            in srgb,
            var(--ag-surface, #fff) 94%,
            transparent
        );
    box-shadow:
        0 -8px 26px rgba(15, 23, 42, .09);
    backdrop-filter: blur(12px);
}

.ag-offer-live-summary > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    min-width: 0;
    padding: .7rem .8rem;
    border-radius: 10px;
    background:
        var(--ag-surface-soft, #f8fafc);
}

.ag-offer-live-summary span {
    color: var(--ag-muted, #64748b);
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ag-offer-live-summary strong {
    font-size: .95rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ag-offer-live-summary .is-total {
    background: rgba(37, 99, 235, .1);
    color: #1d4ed8;
}

.ag-offer-live-summary .is-total span {
    color: inherit;
}

[data-bs-theme="dark"]
.ag-offer-calculated-value--total,
[data-bs-theme="dark"]
.ag-offer-live-summary .is-total {
    color: #93c5fd;
}

@media (max-width: 1599.98px) {
    .ag-offer-item--profit {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }

    .ag-offer-item--profit
    .ag-offer-item__description {
        grid-column: span 2;
    }

    .ag-offer-item--profit
    .ag-offer-item__remove {
        justify-content: flex-end;
    }
}

@media (max-width: 991.98px) {
    .ag-offer-item--profit {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ag-offer-item--profit
    .ag-offer-item__description {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .ag-offer-item--profit,
    .ag-offer-live-summary {
        grid-template-columns: 1fr;
    }

    .ag-offer-item--profit
    .ag-offer-item__description {
        grid-column: auto;
    }
}

@media print {
    .ag-offer-live-summary {
        position: static;
        box-shadow: none;
        backdrop-filter: none;
    }
}

/* ==========================================================
   ARBORIAGEST OFFER LINES RESPONSIVE V100
   ========================================================== */

/*
 * El panel ocupa prácticamente toda la ventana disponible,
 * pero nunca puede superar el ancho del viewport.
 */
.ag-offer-offcanvas {
    width: min(96vw, 1320px) !important;
    max-width: 96vw !important;
}

.ag-offer-offcanvas,
.ag-offer-offcanvas .offcanvas-body,
.ag-offer-offcanvas form,
.ag-offer-offcanvas [data-offer-items] {
    min-width: 0 !important;
    max-width: 100% !important;
}

.ag-offer-offcanvas .offcanvas-body {
    padding: 1.1rem;
    overflow-x: hidden !important;
    overflow-y: auto;
}

/*
 * Contenedor de líneas.
 */
[data-offer-items] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem;
    width: 100% !important;
    overflow: visible !important;
}

/*
 * Cada línea se presenta como una tarjeta.
 */
.ag-offer-item.ag-offer-item--profit {
    display: grid !important;
    grid-template-columns:
        minmax(150px, .9fr)
        minmax(180px, 1.1fr)
        minmax(180px, 1.1fr)
        minmax(180px, 1.1fr)
        42px !important;

    grid-template-areas:
        "type description description description remove"
        "quantity unit baseprice coefficient remove"
        "saleprice discount taxrate taxrate remove"
        "subtotal subtotal tax total remove" !important;

    gap: .75rem !important;
    align-items: end;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 14px;
    background: var(--ag-surface, #fff);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .06);
    overflow: hidden !important;
}

/*
 * Todos los hijos pueden encogerse dentro del grid.
 */
.ag-offer-item.ag-offer-item--profit > *,
.ag-offer-item.ag-offer-item--profit .form-control,
.ag-offer-item.ag-offer-item--profit .form-select,
.ag-offer-item.ag-offer-item--profit .input-group,
.ag-offer-item.ag-offer-item--profit .input-group > *,
.ag-offer-item.ag-offer-item--profit
.ag-offer-calculated-value {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
}

/*
 * Áreas del grid.
 */
.ag-offer-item--profit .ag-offer-field--type {
    grid-area: type;
}

.ag-offer-item--profit .ag-offer-field--description {
    grid-area: description;
}

.ag-offer-item--profit .ag-offer-field--quantity {
    grid-area: quantity;
}

.ag-offer-item--profit .ag-offer-field--unit {
    grid-area: unit;
}

.ag-offer-item--profit .ag-offer-field--base-price {
    grid-area: baseprice;
}

.ag-offer-item--profit .ag-offer-field--coefficient {
    grid-area: coefficient;
}

.ag-offer-item--profit .ag-offer-field--sale-price {
    grid-area: saleprice;
}

.ag-offer-item--profit .ag-offer-field--discount {
    grid-area: discount;
}

.ag-offer-item--profit .ag-offer-field--tax-rate {
    grid-area: taxrate;
}

.ag-offer-item--profit .ag-offer-field--subtotal {
    grid-area: subtotal;
}

.ag-offer-item--profit .ag-offer-field--tax {
    grid-area: tax;
}

.ag-offer-item--profit .ag-offer-field--total {
    grid-area: total;
}

.ag-offer-item--profit .ag-offer-item__remove {
    grid-area: remove;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px !important;
    min-width: 42px !important;
    padding: 0 !important;
}

/*
 * Etiquetas compactas y uniformes.
 */
.ag-offer-item--profit .form-label {
    display: block;
    margin-bottom: .3rem;
    color: var(--ag-muted, #64748b);
    font-size: .67rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/*
 * Campos calculados.
 */
.ag-offer-item--profit .ag-offer-calculated-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: .5rem .7rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: var(--bs-border-radius, .375rem);
    background: var(--ag-surface-soft, #f8fafc);
    color: var(--ag-text, #0f172a);
    font-size: .82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-offer-item--profit
.ag-offer-calculated-value--total {
    border-color: rgba(37, 99, 235, .3);
    background: rgba(37, 99, 235, .09);
    color: #1d4ed8;
}

/*
 * Evitar que Bootstrap u otras reglas anteriores introduzcan
 * ancho mínimo o desplazamiento horizontal.
 */
.ag-offer-offcanvas .row,
.ag-offer-offcanvas .col,
.ag-offer-offcanvas [class*="col-"] {
    min-width: 0;
}

.ag-offer-offcanvas input,
.ag-offer-offcanvas select,
.ag-offer-offcanvas textarea {
    max-width: 100%;
}

/*
 * Resumen global siempre dentro del ancho disponible.
 */
.ag-offer-live-summary {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
}

.ag-offer-live-summary > *,
.ag-offer-live-summary__amounts,
.ag-offer-live-summary__amounts > div {
    min-width: 0;
}

.ag-offer-live-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Portátiles y pantallas medianas.
 */
@media (max-width: 1199.98px) {
    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            repeat(3, minmax(0, 1fr))
            42px !important;

        grid-template-areas:
            "type description description remove"
            "quantity unit baseprice remove"
            "coefficient saleprice discount remove"
            "taxrate subtotal tax remove"
            "total total total remove" !important;
    }
}

/*
 * Tablets.
 */
@media (max-width: 767.98px) {
    .ag-offer-offcanvas {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .ag-offer-offcanvas .offcanvas-body {
        padding: .85rem;
    }

    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            repeat(2, minmax(0, 1fr))
            40px !important;

        grid-template-areas:
            "type type remove"
            "description description remove"
            "quantity unit remove"
            "baseprice coefficient remove"
            "saleprice discount remove"
            "taxrate taxrate remove"
            "subtotal tax remove"
            "total total remove" !important;

        padding: .85rem;
    }

    .ag-offer-live-summary {
        position: static !important;
        grid-template-columns: 1fr !important;
    }

    .ag-offer-live-summary__amounts {
        grid-template-columns: 1fr !important;
    }
}

/*
 * Móviles.
 */
@media (max-width: 479.98px) {
    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            minmax(0, 1fr)
            40px !important;

        grid-template-areas:
            "type remove"
            "description remove"
            "quantity remove"
            "unit remove"
            "baseprice remove"
            "coefficient remove"
            "saleprice remove"
            "discount remove"
            "taxrate remove"
            "subtotal remove"
            "tax remove"
            "total remove" !important;
    }
}

/*
 * Refuerzo final: el documento nunca debe poder generar
 * desplazamiento horizontal por este formulario.
 */
body:has(.ag-offer-offcanvas.show) {
    overflow-x: hidden !important;
}

/* END ARBORIAGEST OFFER LINES RESPONSIVE V100 */

/* ==========================================================
   ARBORIAGEST OFFER COMPACT LINE V101
   ========================================================== */

/*
 * Panel de creación amplio, pero siempre limitado al viewport.
 */
.ag-offer-offcanvas {
    width: min(97vw, 1500px) !important;
    max-width: 97vw !important;
}

.ag-offer-offcanvas .offcanvas-body {
    padding: .85rem 1rem !important;
    overflow-x: hidden !important;
}

.ag-offer-offcanvas form,
.ag-offer-offcanvas [data-offer-items],
.ag-offer-offcanvas .ag-offer-item {
    min-width: 0 !important;
    max-width: 100% !important;
}

/*
 * Línea en dos filas.
 *
 * Se utilizan 12 columnas flexibles. Ninguna columna tiene
 * un ancho mínimo rígido que pueda generar scroll horizontal.
 */
.ag-offer-item.ag-offer-item--profit {
    display: grid !important;
    grid-template-columns:
        repeat(12, minmax(0, 1fr)) !important;

    grid-template-areas:
        "type type description description description description quantity unit baseprice baseprice coefficient remove"
        "saleprice saleprice discount taxrate subtotal subtotal subtotal tax tax total total remove" !important;

    gap: .45rem .55rem !important;
    align-items: end !important;

    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: 0 !important;
    padding: .7rem !important;

    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 12px;
    background: var(--ag-surface, #fff);
    box-shadow: 0 3px 12px rgba(15, 23, 42, .05);

    overflow: hidden !important;
}

/*
 * Áreas del grid.
 */
.ag-offer-item--profit .ag-offer-field--type {
    grid-area: type;
}

.ag-offer-item--profit .ag-offer-field--description {
    grid-area: description;
}

.ag-offer-item--profit .ag-offer-field--quantity {
    grid-area: quantity;
}

.ag-offer-item--profit .ag-offer-field--unit {
    grid-area: unit;
}

.ag-offer-item--profit .ag-offer-field--base-price {
    grid-area: baseprice;
}

.ag-offer-item--profit .ag-offer-field--coefficient {
    grid-area: coefficient;
}

.ag-offer-item--profit .ag-offer-field--sale-price {
    grid-area: saleprice;
}

.ag-offer-item--profit .ag-offer-field--discount {
    grid-area: discount;
}

.ag-offer-item--profit .ag-offer-field--tax-rate {
    grid-area: taxrate;
}

.ag-offer-item--profit .ag-offer-field--subtotal {
    grid-area: subtotal;
}

.ag-offer-item--profit .ag-offer-field--tax {
    grid-area: tax;
}

.ag-offer-item--profit .ag-offer-field--total {
    grid-area: total;
}

.ag-offer-item--profit .ag-offer-item__remove {
    grid-area: remove;

    align-self: stretch !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;

    padding: 0 !important;
}

/*
 * Todos los campos pueden reducirse sin desbordar.
 */
.ag-offer-item--profit > *,
.ag-offer-item--profit .form-control,
.ag-offer-item--profit .form-select,
.ag-offer-item--profit .input-group,
.ag-offer-item--profit .ag-offer-calculated-value {
    min-width: 0 !important;
    max-width: 100% !important;
}

/*
 * Controles más compactos.
 */
.ag-offer-item--profit .form-control,
.ag-offer-item--profit .form-select {
    min-height: 34px !important;
    height: 34px !important;

    padding: .3rem .5rem !important;

    font-size: .75rem !important;
    line-height: 1.15 !important;
}

.ag-offer-item--profit .form-select {
    padding-right: 1.7rem !important;
    background-size: 11px 8px !important;
}

.ag-offer-item--profit .form-label {
    display: block;

    margin-bottom: .18rem !important;

    color: var(--ag-muted, #64748b);

    font-size: .58rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;

    text-transform: uppercase;
    letter-spacing: .035em;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/*
 * Corrección específica del símbolo de euro.
 *
 * El input ocupa el espacio flexible y el sufijo solo ocupa
 * el ancho necesario. Nunca baja a una segunda línea.
 */
.ag-offer-item--profit .input-group {
    display: flex !important;
    flex-wrap: nowrap !important;

    width: 100% !important;
    height: 34px !important;
}

.ag-offer-item--profit .input-group > .form-control {
    flex: 1 1 auto !important;

    width: 1% !important;
    min-width: 0 !important;
    height: 34px !important;
}

.ag-offer-item--profit .input-group > .input-group-text {
    flex: 0 0 auto !important;

    width: auto !important;
    min-width: 28px !important;
    max-width: none !important;
    height: 34px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    padding: .25rem .45rem !important;

    font-size: .72rem !important;
    line-height: 1 !important;

    white-space: nowrap !important;
}

/*
 * Importes calculados compactos.
 */
.ag-offer-item--profit .ag-offer-calculated-value {
    min-height: 34px !important;
    height: 34px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;

    padding: .3rem .5rem !important;

    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: var(--bs-border-radius, .375rem);

    background: var(--ag-surface-soft, #f8fafc);

    font-size: .72rem !important;
    font-weight: 700 !important;
    font-variant-numeric: tabular-nums;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-offer-item--profit
.ag-offer-calculated-value--total {
    border-color: rgba(37, 99, 235, .3);
    background: rgba(37, 99, 235, .09);
    color: #1d4ed8;
}

/*
 * Botón de eliminar compacto.
 */
.ag-offer-item--profit
.ag-offer-item__remove
.ag-user-action {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;

    padding: 0 !important;

    font-size: .8rem !important;
}

/*
 * Contenedor y resumen general.
 */
[data-offer-items] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;

    gap: .65rem !important;

    width: 100% !important;
    min-width: 0 !important;
}

.ag-offer-live-summary {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;

    margin: .75rem 0 !important;
    padding: .55rem !important;
}

.ag-offer-live-summary > div,
.ag-offer-live-summary__amounts,
.ag-offer-live-summary__amounts > div {
    min-width: 0 !important;
}

.ag-offer-live-summary span {
    font-size: .62rem !important;
}

.ag-offer-live-summary strong {
    font-size: .8rem !important;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/*
 * Pantallas medianas: tres filas.
 */
@media (max-width: 1199.98px) {
    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            repeat(6, minmax(0, 1fr))
            34px !important;

        grid-template-areas:
            "type type description description description description remove"
            "quantity unit baseprice baseprice coefficient coefficient remove"
            "saleprice discount taxrate subtotal tax total remove" !important;
    }
}

/*
 * Tablets: cuatro filas compactas.
 */
@media (max-width: 767.98px) {
    .ag-offer-offcanvas {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            repeat(4, minmax(0, 1fr))
            34px !important;

        grid-template-areas:
            "type type description description remove"
            "quantity unit baseprice coefficient remove"
            "saleprice discount taxrate taxrate remove"
            "subtotal subtotal tax total remove" !important;
    }

    .ag-offer-live-summary {
        position: static !important;
    }
}

/*
 * Móviles.
 */
@media (max-width: 520px) {
    .ag-offer-item.ag-offer-item--profit {
        grid-template-columns:
            repeat(2, minmax(0, 1fr))
            34px !important;

        grid-template-areas:
            "type type remove"
            "description description remove"
            "quantity unit remove"
            "baseprice coefficient remove"
            "saleprice discount remove"
            "taxrate taxrate remove"
            "subtotal tax remove"
            "total total remove" !important;
    }
}

/*
 * Bloqueo definitivo del desbordamiento horizontal.
 */
.ag-offer-offcanvas,
.ag-offer-offcanvas .offcanvas-body,
.ag-offer-offcanvas form,
.ag-offer-offcanvas [data-offer-items],
.ag-offer-offcanvas .ag-offer-item {
    overflow-x: hidden !important;
}

/* END ARBORIAGEST OFFER COMPACT LINE V101 */

/* ==========================================================
   ARBORIAGEST OFFER VERSIONS V103
   ========================================================== */

.ag-offer-current-version {
    display: inline-flex;
    width: fit-content;
    margin-top: .25rem;
    padding: .15rem .42rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, .11);
    color: #15803d;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.ag-offer-version-history {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 14px;
    background: var(--ag-surface, #fff);
}

.ag-offer-version-history__head h2 {
    margin: 0;
    font-size: 1rem;
}

.ag-offer-version-history__head p {
    margin: .2rem 0 0;
    color: var(--ag-muted, #64748b);
    font-size: .75rem;
}

.ag-offer-version-history__list {
    display: grid;
    gap: .45rem;
    margin-top: .85rem;
}

.ag-offer-version-history__item {
    display: grid;
    grid-template-columns:
        minmax(120px, 1fr)
        minmax(90px, .6fr)
        minmax(100px, .7fr)
        minmax(110px, .7fr);
    gap: .75rem;
    align-items: center;
    padding: .65rem .75rem;
    border: 1px solid var(--ag-border, #dfe4ea);
    border-radius: 9px;
    color: inherit;
    text-decoration: none;
}

.ag-offer-version-history__item:hover,
.ag-offer-version-history__item.is-selected {
    border-color: rgba(37, 99, 235, .35);
    background: rgba(37, 99, 235, .06);
}

.ag-offer-version-history__item > span:first-child {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.ag-offer-version-history__item small {
    padding: .12rem .38rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, .12);
    color: #15803d;
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ag-version-offer-items {
    display: grid;
    gap: .75rem;
    min-width: 0;
}

/*
 * La pantalla de versionado utiliza las mismas líneas
 * compactas del generador principal.
 */
.ag-version-offer-items
.ag-offer-item--profit {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .ag-offer-version-history__item {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

/* END ARBORIAGEST OFFER VERSIONS V103 */

/* ==========================================================
   ARBORIAGEST PROJECT OFFERS V105
   ========================================================== */

.ag-project-main-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ag-project-main-link:hover strong {
    color: #2563eb;
}

.ag-project-row {
    grid-template-columns:
        minmax(170px, 1.25fr)
        minmax(140px, .85fr)
        minmax(180px, 1.1fr)
        minmax(130px, .8fr)
        minmax(105px, .6fr)
        minmax(100px, .6fr)
        minmax(105px, .6fr)
        118px !important;
}

.ag-project-offers-summary {
    min-width: 0;
}

.ag-project-offers-toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 30px;
    padding: .25rem .5rem;
    border: 1px solid var(--ag-border);
    border-radius: 8px;
    background: var(--ag-surface-soft);
    color: inherit;
    font-size: .67rem;
}

.ag-project-offers-toggle:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.ag-project-offers-toggle strong {
    font-size: .72rem;
}

.ag-project-offers-empty {
    color: var(--ag-muted);
    font-size: .68rem;
}

.ag-project-offers-collapse {
    margin: 0 10px .6rem;
}

.ag-project-offers-panel {
    overflow: hidden;
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    background: var(--ag-surface-soft);
}

.ag-project-offers-panel__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .85rem;
    border-bottom: 1px solid var(--ag-border);
    background: var(--ag-surface);
}

.ag-project-offers-panel__heading > div {
    min-width: 0;
    display: grid;
}

.ag-project-offers-panel__heading strong {
    font-size: .78rem;
}

.ag-project-offers-panel__heading span {
    color: var(--ag-muted);
    font-size: .66rem;
}

.ag-project-offers-list,
.ag-project-detail-offers {
    display: grid;
    gap: .4rem;
    padding: .55rem;
}

.ag-project-offer-row,
.ag-project-detail-offer {
    display: grid;
    grid-template-columns:
        minmax(170px, 1fr)
        minmax(220px, 1.5fr)
        minmax(105px, .65fr)
        minmax(115px, .7fr)
        22px;
    gap: .75rem;
    align-items: center;
    min-width: 0;
    padding: .65rem .75rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--ag-surface);
    color: inherit;
    text-decoration: none;
}

.ag-project-offer-row:hover,
.ag-project-detail-offer:hover {
    border-color: #bfdbfe;
    background: rgba(37, 99, 235, .045);
}

.ag-project-offer-row > *,
.ag-project-detail-offer > * {
    min-width: 0;
}

.ag-project-offer-row strong,
.ag-project-detail-offer strong {
    display: block;
    font-size: .76rem;
}

.ag-project-offer-row span,
.ag-project-detail-offer span {
    display: block;
    overflow: hidden;
    color: var(--ag-muted);
    font-size: .67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ag-project-offer-row small,
.ag-project-detail-offer small {
    display: block;
    margin-bottom: .15rem;
    color: var(--ag-muted);
    font-size: .59rem;
    text-transform: uppercase;
}

.ag-project-offer-row__total,
.ag-project-detail-offer__total {
    text-align: right;
}

.ag-project-offer-current {
    display: inline-flex !important;
    width: fit-content;
    margin: .18rem 0 0 auto;
    padding: .1rem .35rem;
    border-radius: 999px;
    background: rgba(22, 163, 74, .12);
    color: #15803d !important;
    font-size: .56rem !important;
    font-weight: 700;
    text-transform: uppercase;
}

.ag-project-offer-row__arrow {
    font-size: 1.2rem !important;
    text-align: right;
}

.ag-project-detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.3fr)
        minmax(280px, .7fr);
    gap: 1rem;
}

.ag-project-detail-card {
    padding: 1rem;
    border: 1px solid var(--ag-border);
    border-radius: 14px;
    background: var(--ag-surface);
}

.ag-project-detail-card header {
    margin-bottom: 1rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--ag-border);
}

.ag-project-detail-card h2 {
    margin: 0;
    font-size: .9rem;
}

.ag-project-detail-data {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin: 0;
}

.ag-project-detail-data div {
    min-width: 0;
}

.ag-project-detail-data dt {
    margin-bottom: .15rem;
    color: var(--ag-muted);
    font-size: .62rem;
    text-transform: uppercase;
}

.ag-project-detail-data dd {
    margin: 0;
    font-size: .77rem;
}

.ag-project-detail-description {
    margin-top: 1rem;
    padding-top: .8rem;
    border-top: 1px solid var(--ag-border);
}

.ag-project-detail-description h3 {
    margin: 0 0 .4rem;
    font-size: .76rem;
}

.ag-project-detail-description p {
    margin: 0;
    color: var(--ag-muted);
    font-size: .74rem;
}

.ag-project-detail-offer {
    grid-template-columns:
        minmax(160px, 1fr)
        minmax(200px, 1.4fr)
        90px
        105px
        120px
        20px;
}

.ag-project-detail-empty {
    padding: 2rem;
    color: var(--ag-muted);
    font-size: .78rem;
    text-align: center;
}

@media (max-width: 1100px) {
    .ag-project-row {
        grid-template-columns:
            minmax(180px, 1.2fr)
            minmax(170px, 1fr)
            minmax(110px, .6fr)
            minmax(105px, .6fr)
            118px !important;
    }

    .ag-project-row > :nth-child(2),
    .ag-project-row > :nth-child(4),
    .ag-project-row > :nth-child(5) {
        display: none;
    }

    .ag-project-detail-offer {
        grid-template-columns:
            minmax(170px, 1fr)
            minmax(200px, 1.3fr)
            105px
            120px
            20px;
    }

    .ag-project-detail-offer > :nth-child(3) {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .ag-project-row {
        grid-template-columns:
            minmax(0, 1fr)
            auto
            118px !important;
    }

    .ag-project-row > :nth-child(2),
    .ag-project-row > :nth-child(3),
    .ag-project-row > :nth-child(4),
    .ag-project-row > :nth-child(5),
    .ag-project-row > :nth-child(6) {
        display: none !important;
    }

    .ag-project-offers-summary {
        display: block !important;
    }

    .ag-project-offer-row,
    .ag-project-detail-offer {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(105px, auto)
            18px;
    }

    .ag-project-offer-row > :nth-child(2),
    .ag-project-offer-row > :nth-child(3),
    .ag-project-detail-offer > :nth-child(2),
    .ag-project-detail-offer > :nth-child(3),
    .ag-project-detail-offer > :nth-child(4) {
        display: none;
    }

    .ag-project-detail-grid {
        grid-template-columns: 1fr;
    }

    .ag-project-detail-data {
        grid-template-columns: 1fr;
    }
}

/* END ARBORIAGEST PROJECT OFFERS V105 */

/* ==========================================================
   ARBORIAGEST OFFER CURRENCIES V106
   ========================================================== */

.ag-offer-currency-admin-list {
    display: grid;
    gap: .65rem;
    padding: .75rem;
}

.ag-offer-currency-admin-row {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    padding: .75rem;
    border: 1px solid var(--ag-border);
    border-radius: 11px;
    background: var(--ag-surface-soft);
}

.ag-offer-currency-admin-form {
    flex: 1;
    display: grid;
    grid-template-columns:
        90px
        minmax(150px, 1fr)
        90px
        80px
        80px
        70px
        80px;
    gap: .55rem;
    align-items: end;
}

.ag-offer-currency-admin-form .form-label {
    font-size: .62rem;
}

.ag-offer-currency-usage {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: 38px;
}

.ag-offer-currency-usage small {
    color: var(--ag-muted);
    font-size: .58rem;
}

.ag-offer-currency-usage strong {
    font-size: .78rem;
}

@media (max-width: 991.98px) {
    .ag-offer-currency-admin-row {
        align-items: stretch;
        flex-direction: column;
    }

    .ag-offer-currency-admin-form {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ag-offer-currency-admin-form {
        grid-template-columns: 1fr;
    }
}

/* END ARBORIAGEST OFFER CURRENCIES V106 */

/* ARBORIAGEST SIDEBAR TOOLTIPS V107 START */

.ag-sidebar-module-tooltip {
    position: fixed;
    z-index: 10850;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    max-width: min(280px, calc(100vw - 24px));
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid color-mix(
        in srgb,
        var(--ag-border, #d8dee9) 82%,
        transparent
    );
    border-radius: 10px;
    background:
        color-mix(
            in srgb,
            var(--ag-surface, #ffffff) 96%,
            transparent
        );
    box-shadow:
        0 12px 30px rgba(15, 23, 42, .16),
        0 3px 8px rgba(15, 23, 42, .09);
    color: var(--ag-text, #172033);
    font-size: .76rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: .01em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform:
        translate3d(-4px, 0, 0)
        scale(.98);
    transform-origin: left center;
    transition:
        opacity 140ms ease,
        transform 160ms ease,
        visibility 140ms ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ag-sidebar-module-tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -6px;
    width: 11px;
    height: 11px;
    border-bottom: 1px solid color-mix(
        in srgb,
        var(--ag-border, #d8dee9) 82%,
        transparent
    );
    border-left: 1px solid color-mix(
        in srgb,
        var(--ag-border, #d8dee9) 82%,
        transparent
    );
    background:
        color-mix(
            in srgb,
            var(--ag-surface, #ffffff) 96%,
            transparent
        );
    transform:
        translateY(-50%)
        rotate(45deg);
}

.ag-sidebar-module-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform:
        translate3d(0, 0, 0)
        scale(1);
}

.ag-sidebar-module-tooltip__icon {
    display: none;
}

.ag-sidebar-module-tooltip__label {
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .ag-sidebar-module-tooltip,
html[data-bs-theme="dark"] .ag-sidebar-module-tooltip,
body.dark-mode .ag-sidebar-module-tooltip {
    box-shadow:
        0 14px 34px rgba(0, 0, 0, .38),
        0 3px 10px rgba(0, 0, 0, .24);
}

@media (prefers-reduced-motion: reduce) {
    .ag-sidebar-module-tooltip {
        transition: none;
    }
}

/* ARBORIAGEST SIDEBAR TOOLTIPS V107 END */

/* ARBORIAGEST OFFER PRINT ONLY V109 START */

@media print {
    /*
     * Oculta toda la interfaz.
     */
    body * {
        visibility: hidden !important;
    }

    /*
     * Muestra únicamente el documento de la oferta
     * y todos sus descendientes.
     */
    .ag-offer-document,
    .ag-offer-document * {
        visibility: visible !important;
    }

    /*
     * Extrae la oferta del layout general para que ocupe
     * toda la página impresa.
     */
    .ag-offer-document {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        color: #000000 !important;
        overflow: visible !important;
        transform: none !important;
    }

    /*
     * Evita que el layout principal reserve espacio
     * para menú, cabecera o contenido oculto.
     */
    html,
    body {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    /*
     * Oculta expresamente cualquier elemento marcado
     * como no imprimible, aunque esté dentro del article.
     */
    .ag-offer-document .ag-no-print,
    .ag-offer-document .ag-no-print * {
        display: none !important;
        visibility: hidden !important;
    }

    /*
     * Mantiene las tablas completas y evita cortes
     * incorrectos dentro de filas.
     */
    .ag-offer-document table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .ag-offer-document thead {
        display: table-header-group !important;
    }

    .ag-offer-document tfoot {
        display: table-footer-group !important;
    }

    .ag-offer-document tr,
    .ag-offer-document td,
    .ag-offer-document th {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
     * Evita cortes dentro de los bloques principales.
     */
    .ag-offer-document__header,
    .ag-offer-document__project,
    .ag-offer-document__meta,
    .ag-offer-document__totals {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
     * Conserva los colores configurados en la oferta.
     */
    .ag-offer-document,
    .ag-offer-document * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        size: A4;
        margin: 12mm;
    }
}

/* ARBORIAGEST OFFER PRINT ONLY V109 END */

/* ARBORIAGEST SMTP SETTINGS V110 START */"
)

end_marker = (
    "/* ARBORIAGEST SMTP SETTINGS V110 END */

/* ARBORIAGEST SMTP DESIGN V111 START */

/*
 * Panel principal SMTP.
 * Se añade aire interior para evitar que los controles
 * queden pegados al borde de la tarjeta.
 */
.ag-smtp-config {
    padding-bottom: 0;
    overflow: hidden;
}

.ag-smtp-config .ag-module-list-panel__header {
    padding: 1.15rem 1.35rem;
}

.ag-smtp-form {
    padding:
        1.35rem
        1.35rem
        1.5rem;
}

/*
 * Mayor separación entre filas y columnas del formulario.
 */
.ag-smtp-form .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1.15rem;
}

/*
 * Separa mejor los switches de la cabecera
 * y del resto de los campos.
 */
.ag-smtp-switches {
    margin:
        0
        0
        1.35rem;
    padding:
        1rem
        1.1rem;
    gap:
        .75rem
        2rem;
}

/*
 * Inputs y select con altura uniforme.
 */
.ag-smtp-form .form-control,
.ag-smtp-form .form-select,
.ag-smtp-form .input-group-text {
    min-height: 42px;
}

.ag-smtp-form .form-label {
    display: inline-block;
    margin-bottom: .45rem;
    font-weight: 600;
}

/*
 * Texto auxiliar de la contraseña.
 */
.ag-smtp-form .form-text {
    margin-top: .45rem;
    line-height: 1.45;
}

/*
 * Bloque de verificación TLS.
 */
.ag-smtp-security-option {
    min-height: 72px;
    padding:
        .95rem
        1rem;
    align-items: flex-start;
}

.ag-smtp-security-option .form-check-input {
    flex: 0 0 auto;
    margin-top: .15rem;
}

.ag-smtp-security-option strong {
    display: block;
    margin-bottom: .2rem;
}

/*
 * Zona inferior del formulario.
 * El botón ya no queda pegado al borde.
 */
.ag-smtp-form-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 1.65rem;
    padding-top: 1.25rem;
    padding-bottom: .15rem;
    border-top: 1px solid var(--ag-border);
}

.ag-smtp-form-actions .btn {
    min-width: 190px;
    min-height: 42px;
    padding:
        .65rem
        1.25rem;
}

/*
 * Evita que el contenido toque los bordes en pantallas
 * intermedias y pequeñas.
 */
@media (max-width: 991.98px) {
    .ag-smtp-config .ag-module-list-panel__header {
        padding:
            1rem
            1.1rem;
    }

    .ag-smtp-form {
        padding:
            1.15rem
            1.1rem
            1.35rem;
    }

    .ag-smtp-form-actions {
        margin-top: 1.4rem;
        padding-top: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .ag-smtp-config .ag-module-list-panel__header {
        padding:
            .95rem
            1rem;
    }

    .ag-smtp-form {
        padding:
            1rem
            1rem
            1.25rem;
    }

    .ag-smtp-switches {
        padding:
            .9rem
            1rem;
    }

    .ag-smtp-form-actions {
        padding-top: 1rem;
    }

    .ag-smtp-form-actions .btn {
        width: 100%;
    }
}

/* ARBORIAGEST SMTP DESIGN V111 END */

/* ARBORIAGEST SMTP DESIGN V111_1 START */

/*
 * Se usan selectores específicos para evitar que las reglas
 * genéricas de formularios y paneles anulen el espaciado SMTP.
 */

.ag-smtp-layout .ag-smtp-config {
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.ag-smtp-layout .ag-smtp-config > .ag-module-list-panel__header {
    box-sizing: border-box !important;
    padding:
        18px
        24px !important;
}

.ag-smtp-layout .ag-smtp-config > form.ag-smtp-form {
    box-sizing: border-box !important;
    display: block !important;
    margin: 0 !important;
    padding:
        24px
        26px
        28px !important;
}

/*
 * Bloque superior de activación y autenticación.
 */
.ag-smtp-layout .ag-smtp-form .ag-smtp-switches {
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap:
        12px
        32px !important;
    margin:
        0
        0
        24px !important;
    padding:
        16px
        18px !important;
    border:
        1px solid
        var(--ag-border, #dfe5ee) !important;
    border-radius: 12px !important;
    background:
        var(--ag-surface-soft, #f8fafc) !important;
}

/*
 * Aumenta la separación real entre filas y columnas.
 */
.ag-smtp-layout .ag-smtp-form > .row {
    margin-right: -8px !important;
    margin-left: -8px !important;
    row-gap: 20px !important;
}

.ag-smtp-layout .ag-smtp-form > .row > [class*="col-"] {
    box-sizing: border-box !important;
    padding-right: 8px !important;
    padding-left: 8px !important;
}

/*
 * Labels e inputs.
 */
.ag-smtp-layout .ag-smtp-form .form-label {
    display: block !important;
    margin:
        0
        0
        8px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.ag-smtp-layout .ag-smtp-form .form-control,
.ag-smtp-layout .ag-smtp-form .form-select {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 44px !important;
    padding:
        9px
        12px !important;
}

.ag-smtp-layout .ag-smtp-form .input-group {
    min-height: 44px !important;
}

.ag-smtp-layout .ag-smtp-form .input-group-text {
    min-height: 44px !important;
    padding:
        9px
        14px !important;
}

.ag-smtp-layout .ag-smtp-form .form-text {
    margin-top: 7px !important;
    line-height: 1.45 !important;
}

/*
 * Bloque de seguridad TLS.
 */
.ag-smtp-layout .ag-smtp-form .ag-smtp-security-option {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 76px !important;
    margin: 0 !important;
    padding:
        15px
        17px !important;
    border:
        1px solid
        var(--ag-border, #dfe5ee) !important;
    border-radius: 11px !important;
}

.ag-smtp-layout
.ag-smtp-form
.ag-smtp-security-option
.form-check-input {
    flex:
        0
        0
        auto !important;
    margin-top: 3px !important;
}

.ag-smtp-layout
.ag-smtp-form
.ag-smtp-security-option
span {
    display: block !important;
}

.ag-smtp-layout
.ag-smtp-form
.ag-smtp-security-option
strong {
    display: block !important;
    margin-bottom: 4px !important;
}

.ag-smtp-layout
.ag-smtp-form
.ag-smtp-security-option
small {
    display: block !important;
    line-height: 1.45 !important;
}

/*
 * Zona del botón Guardar configuración.
 */
.ag-smtp-layout .ag-smtp-form .ag-smtp-form-actions {
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    margin:
        30px
        0
        0 !important;
    padding:
        22px
        0
        4px !important;
    border-top:
        1px solid
        var(--ag-border, #dfe5ee) !important;
}

.ag-smtp-layout
.ag-smtp-form
.ag-smtp-form-actions
.btn {
    min-width: 210px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding:
        10px
        18px !important;
}

/*
 * Paneles laterales.
 */
.ag-smtp-layout .ag-smtp-side > section {
    box-sizing: border-box !important;
    padding: 20px !important;
}

@media (max-width: 991.98px) {
    .ag-smtp-layout .ag-smtp-config > form.ag-smtp-form {
        padding:
            20px
            20px
            24px !important;
    }
}

@media (max-width: 575.98px) {
    .ag-smtp-layout .ag-smtp-config > .ag-module-list-panel__header {
        padding:
            16px
            18px !important;
    }

    .ag-smtp-layout .ag-smtp-config > form.ag-smtp-form {
        padding:
            18px
            16px
            22px !important;
    }

    .ag-smtp-layout .ag-smtp-form .ag-smtp-switches {
        display: grid !important;
        padding:
            14px
            15px !important;
    }

    .ag-smtp-layout
    .ag-smtp-form
    .ag-smtp-form-actions
    .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* ARBORIAGEST SMTP DESIGN V111_1 END */

/* ==========================================================
   ARBORIAGEST - Inventario utilidades v100
   ========================================================== */

.text-orange { color: #EA580C !important; }
.bg-orange { background-color: #EA580C !important; }
.bg-opacity-10.bg-orange { background-color: rgba(234, 88, 12, .10) !important; }

.table-professional { border-collapse: separate; border-spacing: 0; }
.table-professional thead th {
    background: linear-gradient(135deg, #1e293b, #334155);
    color: #fff; font-weight: 500; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .5px;
    border: none; padding: .75rem 1rem;
}
.table-professional tbody td {
    padding: .65rem 1rem; vertical-align: middle;
    border-bottom: 1px solid #f1f5f9; font-size: .875rem;
}
.table-professional tbody tr { background: #fff; transition: background .15s; }
.table-professional tbody tr:nth-child(even) { background: #f8fafc; }
.table-professional tbody tr:hover { background: #eef2ff; }

[data-bs-theme="dark"] .table-professional thead th { background: linear-gradient(135deg, #0F172A, #1E293B); }
[data-bs-theme="dark"] .table-professional tbody td { border-bottom-color: #1E293B; }
[data-bs-theme="dark"] .table-professional tbody tr { background: #111827; }
[data-bs-theme="dark"] .table-professional tbody tr:nth-child(even) { background: #0F172A; }
[data-bs-theme="dark"] .table-professional tbody tr:hover { background: #1E293B; }
