/**
 * Premium User Dashboard Styles
 * Modern, clean interface for landlord property management
 */

/* ── Dashboard Container ── */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ─── Pill Toggles — Tipo de Propiedad & Tipo de Operación ─── */
.fancy-property-type .acf-label,
.fancy-operation-type .acf-label {
    text-align: left !important;
}

.fancy-property-type .acf-label label,
.fancy-operation-type .acf-label label {
    font-size: 0.95rem !important;
    margin-bottom: 0.75rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
}

/* Remove ACF taxonomy field border/scroll */
.fancy-property-type .acf-taxonomy-field,
.fancy-property-type .acf-input,
.fancy-property-type .acf-input > div,
.fancy-property-type .acf-input > div > div {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* Pill list — works for both taxonomy (ul) and radio (.acf-radio-list) */
.fancy-property-type ul,
.fancy-property-type .acf-radio-list,
.fancy-operation-type .acf-radio-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

.fancy-property-type ul > li,
.fancy-property-type .acf-radio-list > li,
.fancy-operation-type .acf-radio-list > li {
    display: block !important;
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    min-width: 0 !important;
}

.fancy-property-type ul > li > label,
.fancy-property-type .acf-radio-list > li > label,
.fancy-operation-type .acf-radio-list > li > label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 9px 18px !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 999px !important;
    background: #fff !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
    white-space: nowrap !important;
    transition: all 0.18s ease !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 0 !important;
    width: auto !important;
    text-align: left !important;
    box-shadow: none !important;
    flex-direction: row !important;
}

.fancy-property-type ul > li > label:hover,
.fancy-property-type .acf-radio-list > li > label:hover,
.fancy-operation-type .acf-radio-list > li > label:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: rgba(31, 123, 255, 0.06) !important;
    transform: none !important;
    box-shadow: none !important;
}

.fancy-property-type ul input[type="radio"],
.fancy-property-type ul input[type="checkbox"],
.fancy-property-type .acf-radio-list input[type="radio"],
.fancy-operation-type .acf-radio-list input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

.fancy-property-type ul > li:has(input:checked) > label,
.fancy-property-type .acf-radio-list > li:has(input:checked) > label,
.fancy-operation-type .acf-radio-list > li:has(input:checked) > label {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(31, 123, 255, 0.35) !important;
    transform: none !important;
}

.fancy-property-type .acf-label .description,
.fancy-property-type .acf-required,
.fancy-operation-type .acf-label .description,
.fancy-operation-type .acf-required {
    display: none !important;
}

/* Override .publish-page constraints when the modern dashboard is rendered */
.publish-page:has(.dashboard-shell) {
    max-width: none;
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Modern Sidebar Shell ── */
.dashboard-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 0;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
}

.dashboard-sidebar {
    position: sticky;
    top: 24px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 18px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    background: var(--primary-gradient);
    box-shadow: 0 6px 14px rgba(31, 123, 255, 0.35);
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-mobile-nav {
    display: none;
}

.sidebar-mobile-nav__label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.sidebar-mobile-nav__select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    padding: 0 40px 0 12px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    position: relative;
}

.sidebar-link svg {
    flex-shrink: 0;
    color: #94a3b8;
    transition: color 0.18s ease;
}

.sidebar-link span:not(.sidebar-badge) {
    flex: 1;
}

.sidebar-link:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.sidebar-link:hover svg {
    color: var(--primary-color);
}

.sidebar-link--active {
    background: linear-gradient(135deg, rgba(31, 123, 255, 0.1) 0%, rgba(32, 214, 199, 0.08) 100%);
    color: var(--primary-color);
}

.sidebar-link--active svg {
    color: var(--primary-color);
}

.sidebar-link--active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--primary-color), #20D6C7);
}

.sidebar-link--danger {
    color: #94a3b8;
}

.sidebar-link--danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.sidebar-link--danger:hover svg {
    color: #dc2626;
}

.sidebar-link--danger.sidebar-link--active {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.sidebar-link--danger.sidebar-link--active svg {
    color: #dc2626;
}

.sidebar-link--danger.sidebar-link--active::before {
    background: #ef4444;
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 22px;
    width: auto;
    height: 22px;
    padding: 0 7px;
    background: rgba(31, 123, 255, 0.1);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-hover);
}

.sidebar-link--active .sidebar-badge {
    background: var(--primary-color);
    color: #fff;
}

.sidebar-badge--alert {
    background: #ef4444;
    color: #fff;
    animation: pulse 2s infinite;
}

/* ── Main column ── */
.dashboard-main {
    min-width: 0;
}

.dashboard-topbar {
    margin-bottom: 22px;
    padding: 26px 30px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.dashboard-topbar .dashboard-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

/* Plan chip shown after the greeting name (loaded on every dashboard tab). */
.dashboard-plan-chip {
    display: inline-block;
    vertical-align: middle;
    margin-left: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 3px 12px;
}

.dashboard-topbar .dashboard-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Stats grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.07);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card--blue .stat-card-icon { background: rgba(31, 123, 255, 0.1); color: var(--primary-color); }
.stat-card--green .stat-card-icon { background: #ecfdf5; color: #059669; }
.stat-card--amber .stat-card-icon { background: #fffbeb; color: #d97706; }
.stat-card--purple .stat-card-icon { background: rgba(32, 214, 199, 0.12); color: #20D6C7; }

.stat-card-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-card-label {
    font-size: 12px;
    color: #94a3b8;
    margin: 4px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 18px 0;
    }
    .dashboard-sidebar {
        position: static;
        min-height: auto;
        padding: 16px;
    }
    .sidebar-nav,
    .sidebar-footer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        border-top: none;
        padding-top: 0;
        margin-top: 12px;
    }
    .sidebar-link {
        padding: 9px 12px;
        font-size: 13px;
    }
    .sidebar-link--active::before { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-topbar { padding: 20px; }
}

@media (max-width: 600px) {
    .sidebar-mobile-nav {
        display: block;
        margin-top: 12px;
    }

    .sidebar-nav,
    .sidebar-footer {
        display: none;
    }
}

@media (max-width: 520px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 14px; }
    .stat-card-value { font-size: 20px; }
    .profile-danger-zone,
    .property-danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }
    .btn-danger-outline {
        width: 100%;
    }
}

/* ── Dashboard Header ── */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.dashboard-welcome {
    flex: 1;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
}

.dashboard-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
}

.dashboard-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.dashboard-logout-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

/* ── Dashboard Navigation Tabs ── */
.dashboard-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 12px;
    overflow-x: auto;
}

.nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-tab:hover {
    background: #fff;
    color: #334155;
}

.nav-tab.active {
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(31, 123, 255, 0.1);
}

.nav-tab svg {
    flex-shrink: 0;
}

.nav-tab--danger.active {
    color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--border-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.nav-tab.active .tab-badge {
    background: var(--primary-color);
    color: #fff;
}

.tab-badge--alert {
    background: #ef4444;
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ── Dashboard Content Area ── */
.dashboard-content {
    background: #fff;
    border-radius: 16px;
    /*box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);*/
    overflow: hidden;
}

.dashboard-tab-panel {
    padding: 32px 0;
}

.dashboard-tab-panel .acf-form-wrapper {
    max-width: 100%;
}

/* ACF Pro adds `border-left: 1px solid #eee` between adjacent multi-column
   fields, which renders as an unwanted vertical divider between input columns
   (e.g. "Precio Mensual" | "Administración"). Suppress it. */
.dashboard-tab-panel .acf-frontend-form .acf-field[data-width] + .acf-field[data-width] {
    border-left: 0 !important;
    border-right: 0 !important;
}

/* Tighten the gap between fields a bit since they no longer have a divider. */
.dashboard-tab-panel .acf-frontend-form .acf-fields > .acf-field {
    padding: 12px 14px !important;
}

/* Make prepend/append wraps a proper flex row with all children stretching to
   the same height. ACF Pro ships these styles but they're being clobbered
   (likely by Tailwind v4's preflight). Force them back. */
/* Pin all input-like controls to the same 46px height used on the registration
   form, so dropdowns and plain text inputs match the prepend/append boxes. */
.dashboard-tab-panel .acf-frontend-form input[type="text"],
.dashboard-tab-panel .acf-frontend-form input[type="number"],
.dashboard-tab-panel .acf-frontend-form input[type="email"],
.dashboard-tab-panel .acf-frontend-form input[type="tel"],
.dashboard-tab-panel .acf-frontend-form input[type="url"],
.dashboard-tab-panel .acf-frontend-form input[type="password"],
.dashboard-tab-panel .acf-frontend-form input[type="date"],
.dashboard-tab-panel .acf-frontend-form select {
    min-height: 46px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

.dashboard-tab-panel .acf-frontend-form .acf-input-wrap {
    display: flex !important;
    align-items: stretch !important;
}
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > input,
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-prepend,
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-append {
    min-height: 46px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > input {
    flex: 1 1 auto !important;
    padding: 0 14px !important;
}
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-prepend,
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-append {
    flex: 0 0 auto !important;
    padding: 0 14px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    justify-content: center !important;
}
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-prepend {
    border-right: 0 !important;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}
.dashboard-tab-panel .acf-frontend-form .acf-input-wrap > .acf-input-append {
    border-left: 0 !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.panel-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(31, 123, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(31, 123, 255, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.alert svg {
    flex-shrink: 0;
}

.alert--success {
    background: #ecfdf5;
    border: 2px solid #d1fae5;
    color: #065f46;
}

.alert--info {
    background: #eff6ff;
    border: 2px solid #dbeafe;
    color: #1e40af;
    font-weight: 500;
}

.alert--error {
    background: #fef2f2;
    border: 2px solid #fee2e2;
    color: #991b1b;
}

.alert--danger {
    background: #fef2f2;
    border: 2px solid #fee2e2;
    color: #991b1b;
}

.alert--danger strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

/* ── Properties Grid ── */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.property-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    padding: 0;
}

.property-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.property-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.property-card-image--placeholder {
    background: linear-gradient(135deg, #f1f5f9 0%, var(--border-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.property-card-content {
    padding: 20px;
}

.property-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.property-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.property-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.property-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.property-status--publish {
    background: #d1fae5;
    color: #065f46;
}

.property-status--pending {
    background: #fef3c7;
    color: #92400e;
}

.property-status--draft {
    background: var(--border-color);
    color: #475569;
}

.property-status--arrendado {
    background: #fee2e2;
    color: #991b1b;
}

.property-status--reservado {
    background: #e0e7ff;
    color: #3730a3;
}

.property-status--featured {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.property-card-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

.property-card-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.property-card-views svg {
    flex-shrink: 0;
}

.property-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 15px;
    margin: 0 0 24px 0;
}

/* ── Inbox Styles ── */
.inbox-unread-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #fef3c7;
    border: 2px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 13px;
    font-weight: 700;
}

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inbox-message-item {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.inbox-message-item:hover {
    border-color: #cbd5e1;
}

.inbox-message-item--unread {
    border-color: #fde68a;
    background: #fffbeb;
}

.inbox-message-item--active {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(31, 123, 255, 0.1);
}

.inbox-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    color: inherit;
}

.inbox-message-header:hover {
    text-decoration: none;
}

.inbox-message-meta {
    flex: 1;
    min-width: 0;
}

.inbox-message-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inbox-message-subject {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 14px;
}

.inbox-message-date {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.inbox-message-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge--unread {
    background: #fef3c7;
    color: #92400e;
}

.status-badge--read {
    background: rgba(31, 123, 255, 0.1);
    color: var(--primary-hover);
}

.status-badge--replied {
    background: #d1fae5;
    color: #065f46;
}

.inbox-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #94a3b8;
}

.inbox-chevron--open {
    transform: rotate(180deg);
}

.inbox-message-body {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f1f5f9;
}

.message-bubble {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.message-bubble--visitor {
    background: #f8fafc;
    border: 2px solid var(--border-color);
}

.message-bubble--reply {
    background: rgba(31, 123, 255, 0.06);
    border: 2px solid rgba(31, 123, 255, 0.14);
}

.message-bubble-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}

.message-bubble-header strong {
    color: var(--text-primary);
}

.message-bubble-email {
    color: var(--text-secondary);
}

.message-bubble-phone {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.message-bubble-phone:hover {
    text-decoration: underline;
}

.message-bubble-text {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.message-bubble-time {
    font-size: 12px;
    color: #94a3b8;
}

.inbox-reply-form {
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.inbox-reply-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inbox-reply-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.inbox-reply-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 123, 255, 0.1);
}

/* ── Profile & Forms ── */
.profile-form,
.delete-account-form {

}

.profile-danger-zone,
.property-danger-zone {
    margin-top: 32px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fff7f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.profile-danger-zone h3,
.property-danger-zone h3 {
    margin: 0 0 4px;
    color: #991b1b;
    font-size: 15px;
    font-weight: 800;
}

.profile-danger-zone p,
.property-danger-zone p {
    margin: 0;
    color: #7f1d1d;
    font-size: 13px;
    line-height: 1.45;
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 10px 14px;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    background: #fff;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.18s ease;
}

.btn-danger-outline:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.form-field {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 123, 255, 0.1);
}

.form-input:disabled,
.form-input[aria-disabled="true"] {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.form-label__lock svg {
    display: inline-block;
    vertical-align: middle;
}

.user-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.user-verified-badge svg {
    display: inline-block;
}

.form-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 6px 0 0 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-actions {
    margin-top: 32px;
}

/* ── ACF Form Wrapper ── */
.acf-form-wrapper {
    max-width: 900px;
}

/* ── Responsive Design ── */
@media (max-width: 768px) {
    /* Stack all 2-column ACF fields to single column.
       High specificity to outweigh publish-form.css 50% rule loaded by Vite. */
    .acf-frontend-form .acf-fields > .acf-field[data-width],
    .acf-frontend-form .form-step-container > .acf-field[data-width],
    .acf-frontend-form .acf-fields > .acf-field[data-width="50"],
    .acf-frontend-form .form-step-container > .acf-field[data-width="50"],
    .acf-frontend-form .acf-fields > .acf-field[data-width="33"],
    .acf-frontend-form .form-step-container > .acf-field[data-width="33"],
    .dashboard-content .acf-field[data-width] {
        width: 100% !important;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .dashboard-title {
        font-size: 24px;
    }

    .dashboard-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-tab-panel {
        padding: 20px 0;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .property-card-actions {
        flex-direction: column;
    }

    .property-card-actions .btn-secondary,
    .property-card-actions .btn-danger {
        width: 100%;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .inbox-message-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .inbox-message-status {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .dashboard-container {
        padding: 16px 12px;
    }

    .nav-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dashboard-shell {
        padding: 12px 0 !important;
        gap: 12px !important;
    }

    .dashboard-topbar {
        padding: 16px 20px !important;
        border-radius: 12px !important;
    }

    .dashboard-topbar .dashboard-title {
        font-size: 20px !important;
    }

    .dashboard-topbar .dashboard-subtitle {
        font-size: 13px !important;
    }

    .dashboard-content {
        border-radius: 12px !important;
    }

    .dashboard-tab-panel {
        padding: 16px 0 !important;
    }


    .dashboard-sidebar {
        padding: 12px 16px !important;
        border-radius: 12px !important;
    }

    .acf-frontend-form .acf-form,
    .acf-form {
        padding: 0 !important;
    }
}

/* ── Contact-visibility toggle switches (profile form) ── */
.contact-toggles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}
.contact-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    background: #ffffff;
    transition: background-color 0.15s;
}
.contact-toggle + .contact-toggle {
    border-top: 1px solid #f1f5f9;
}
.contact-toggle:hover {
    background: #f8fafc;
}
.contact-toggle__text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
}
/* Hide the native checkbox; the switch is drawn by the sibling span. */
.contact-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.contact-toggle__switch {
    position: relative;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background-color 0.2s ease;
}
.contact-toggle__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}
.contact-toggle input[type="checkbox"]:checked + .contact-toggle__switch {
    background: var(--primary-color, #1F7BFF);
}
.contact-toggle input[type="checkbox"]:checked + .contact-toggle__switch::after {
    transform: translateX(18px);
}
.contact-toggle input[type="checkbox"]:focus-visible + .contact-toggle__switch {
    box-shadow: 0 0 0 3px rgba(31, 123, 255, 0.30);
}

/* ── Didit identity-verification gate (publish tab) ── */
.didit-gate {
    text-align: center;
    max-width: 460px;
    margin: 8px auto;
    padding: 32px 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}
.didit-gate__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(31, 123, 255, 0.10);
    color: var(--primary-color, #1F7BFF);
}
.didit-gate__title {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
.didit-gate__text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #64748b;
}
.didit-gate__error {
    margin: 14px 0 0;
    font-size: 0.85rem;
    color: #b91c1c;
}

/* ── Verification card (Mi Perfil tab) ── */
.verification-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}
.verification-card--verified {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.verification-card--pending {
    border-color: #fde68a;
    background: #fffbeb;
}
.verification-card__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 123, 255, 0.10);
    color: var(--primary-color, #1F7BFF);
}
.verification-card--verified .verification-card__icon {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}
.verification-card--pending .verification-card__icon {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}
.verification-card__body { flex: 1; }
.verification-card__title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.verification-card__text {
    margin: 0 0 12px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #475569;
}
.verification-card__error {
    margin: 10px 0 0;
    font-size: 0.85rem;
    color: #b91c1c;
}
.verification-card__note {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #475569;
    background: rgba(31, 123, 255, 0.06);
    border-left: 3px solid var(--primary-color, #1F7BFF);
    border-radius: 6px;
}

/* ── Remove-avatar control ── */
.avatar-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #b91c1c;
    cursor: pointer;
    user-select: none;
}
.avatar-remove input[type="checkbox"] {
    accent-color: #b91c1c;
    cursor: pointer;
}
.avatar-remove svg {
    flex: 0 0 auto;
}

/* ── International phone field (country-code picker + number) ── */
.phone-field {
    position: relative;
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    overflow: visible;
}
.phone-field:focus-within {
    border-color: var(--primary-color, #1F7BFF);
    box-shadow: 0 0 0 3px rgba(31, 123, 255, 0.15);
}
.phone-field__cc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: #f8fafc;
    border: 0;
    border-right: 1px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
}
.phone-field__cc:hover {
    background: #f1f5f9;
}
.phone-field__dial {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}
.phone-field__num {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #0f172a;
    outline: none;
}
.phone-field__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
.phone-field__opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
}
.phone-field__opt:hover {
    background: #f1f5f9;
}
.phone-field__opt.is-active {
    background: rgba(31, 123, 255, 0.10);
    color: var(--primary-color, #1F7BFF);
    font-weight: 600;
}
.phone-field__opt-name {
    flex: 1 1 auto;
}
.phone-field__opt-dial {
    color: #94a3b8;
    font-weight: 600;
}

/* ── Visitas / CRM panel ──
   The global `button` rule (main.css) paints a gradient via the `background`
   shorthand. Tailwind `bg-*` utilities only set background-color, so that
   gradient image bleeds through. Strip it (and the hover lift) inside the
   Visitas panel so the intended flat colors show. */
.visitas-panel button {
    background-image: none !important;
    background-size: auto !important;
}
.visitas-panel button:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Availability-editor buttons — plain classes (Tailwind utilities don't
   reliably compile for these), forced over the theme's button styles. */
.visitas-panel .av-day {
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}
.visitas-panel .av-day.is-on {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
}
.visitas-panel .av-save {
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #2563eb !important;
    color: #fff !important;
    border: 1px solid #2563eb !important;
}
.visitas-panel .av-save:hover { background: #1d4ed8 !important; }
.visitas-panel .av-add {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff !important;
    color: #1d4ed8 !important;
    border: 1px solid #cbd5e1 !important;
}
.visitas-panel .av-add:hover { background: #f8fafc !important; }
.visitas-panel .av-toggle {
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}
.visitas-panel .av-toggle:hover { background: #dbeafe !important; }

/* ── Alertas: status badge ── */
.alerta-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.alerta-status__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.alerta-status--active {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.alerta-status--paused {
    color: #64748b;
    background: #f8fafc;
    border-color: #e2e8f0;
}
.alerta-card.is-paused { opacity: 0.92; }

/* ── Seeker conversion CTA in the dashboard nav ── */
.sidebar-link.sidebar-link--cta {
    margin-top: 4px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 700;
    border: none;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.sidebar-link.sidebar-link--cta svg { color: #ffffff; }
.sidebar-link.sidebar-link--cta:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
    transform: translateY(-1px);
}
.sidebar-link.sidebar-link--cta.sidebar-link--active {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: #ffffff;
}

/* ── Estudios/Solicitudes status badge (tone-based) ── */
.estudio-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.estudio-badge--gray  { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.estudio-badge--blue  { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.estudio-badge--amber { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.estudio-badge--green { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.estudio-badge--red   { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

/* ── Seeker CTA helper text (above "Publica tu propiedad") ── */
.sidebar-cta-text {
    margin: 14px 6px 6px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.4;
    color: #64748b;
}

/* ── Outlined sidebar action (owner "Publicar Nueva") ── */
.sidebar-link.sidebar-link--outline {
    margin-top: 4px;
    background: transparent;
    color: #1d4ed8;
    border: 1.5px solid #2563eb;
    font-weight: 600;
}
.sidebar-link.sidebar-link--outline .icon,
.sidebar-link.sidebar-link--outline svg { color: #1d4ed8; }
.sidebar-link.sidebar-link--outline:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ── Visit contact icons (after visitor name) ── */
.visit-contacts a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    line-height: 0;
    padding: 0;
    transition: filter .15s ease, transform .15s ease;
}
.visit-contacts a svg { display: block; }
.visit-contacts a:hover { filter: brightness(0.94); transform: translateY(-1px); }

/* ── Visitas property picker (global Visitas tab) ── */
.visitas-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.visitas-picker__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.visitas-picker__card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}
.visitas-picker__thumb { position: relative; aspect-ratio: 16 / 10; background: #f1f5f9; overflow: hidden; }
.visitas-picker__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visitas-picker__ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #cbd5e1; }
.visitas-picker__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.visitas-picker__badge--on { background: #16a34a; }
.visitas-picker__badge--off { background: #94a3b8; }
.visitas-picker__body { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.visitas-picker__title { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visitas-picker__meta { font-size: 13px; color: #64748b; margin-top: 3px; }
.visitas-picker__meta strong { color: #2563eb; font-weight: 700; }
.visitas-picker__arrow { flex: 0 0 auto; color: #cbd5e1; transition: color .15s ease; }
.visitas-picker__card:hover .visitas-picker__arrow { color: #64748b; }

/* ── Visits calendar (FullCalendar) ── */
.visits-fc {
    --fc-border-color: #e6eaf0;
    --fc-today-bg-color: #f0f7ff;
    --fc-now-indicator-color: #ef4444;
    font-size: 14px;
}
.visits-fc .fc .fc-toolbar.fc-header-toolbar { margin-bottom: 26px; align-items:center; flex-wrap: wrap; gap: 14px; }
.visits-fc .fc .fc-toolbar-chunk { display:flex; align-items:center; gap:10px; }
.visits-fc .fc .fc-toolbar-title { margin-left:8px; font-size: 28px; font-weight: 650; color: #111827; text-transform: none; letter-spacing:0; }
.visits-fc .fc .fc-toolbar-title::first-letter { text-transform: uppercase; }
.visits-fc .fc .fc-button {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #8a93a3;
    font-weight: 650;
    font-size: 13px;
    text-transform: capitalize;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: none;
}
.visits-fc .fc .fc-button:hover { background: #fff; color: #111827; border-color:#d1d5db; }
.visits-fc .fc .fc-button:focus { box-shadow: none; outline: none; }
.visits-fc .fc .fc-button-primary:not(:disabled).fc-button-active,
.visits-fc .fc .fc-button-primary:not(:disabled):active {
    background: #f8fafc;
    border-color: #d1d5db;
    color: #111827;
}
.visits-fc .fc .fc-prev-button,
.visits-fc .fc .fc-next-button {
    border-color:transparent;
    padding:7px 4px;
    color:#b6bdc8;
}
.visits-fc .fc .fc-prev-button:hover,
.visits-fc .fc .fc-next-button:hover { border-color:transparent; color:#111827; }
.visits-fc .fc .fc-button .fc-icon { font-size: 1.55em; }
.visits-fc .fc-theme-standard td, .visits-fc .fc-theme-standard th { border-color: #e6eaf0; }
.visits-fc .fc-theme-standard .fc-scrollgrid {
    border-color: #e6eaf0;
    border-radius: 14px;
    overflow: hidden;
    background:#fff;
    box-shadow: 0 10px 28px rgba(15,23,42,0.05);
}
.visits-fc .fc .fc-col-header-cell { background:#fff; }
.visits-fc .fc .fc-col-header-cell-cushion { color: #8a93a3; font-size: 12px; font-weight: 800; text-transform: uppercase; padding: 12px 4px; text-decoration: none; }
.visits-fc .fc .fc-daygrid-day-frame { padding: 18px 18px 14px; }
.visits-fc .fc .fc-daygrid-day-number {
    float:none;
    display:block;
    color: #111827;
    font-size:18px;
    line-height:1;
    font-weight:850;
    text-decoration: none;
    padding: 0 0 22px;
}
.visits-fc .fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: var(--primary-color, #1F7BFF); }
.visits-fc .fc .fc-daygrid-day.fc-day-today { background:#fff; }
.visits-fc .fc .fc-day-other .fc-daygrid-day-number { color:#cbd5e1; }
.visits-fc .fc .fc-timegrid-slot-label-cushion { color:#64748b; font-weight:700; font-size:12px; }
.visits-fc .fc-event { cursor: pointer; box-shadow: none; }
.visits-fc .fc-event-main,
.visits-fc .fc-event-main-frame { color:inherit; width:100%; min-width:0; }
.visits-fc .fc-daygrid-event-dot { display:none; }
/* Shared status-dot + time + title body (see dotColor()/dotTint() in the Twig). */
.visits-fc .fc-visit-item {
    display:flex;
    align-items:flex-start;
    gap:8px;
    min-width:0;
    width:100%;
    height:auto;
    padding:0;
    box-sizing:border-box;
}
.visits-fc .fc-visit-dot {
    flex:0 0 auto;
    width:9px;
    height:9px;
    margin-top:4px;
    border-radius:999px;
    background:var(--visit-color, #2563eb);
}
.visits-fc .fc-visit-body { flex:1 1 auto; min-width:0; }
.visits-fc .fc-event-time {
    display:block;
    font-size:11px;
    line-height:1.2;
    font-weight:600;
    color:#9ca3af;
    margin-bottom:2px;
}
.visits-fc .fc-event-title {
    display:block;
    min-width:0;
    font-size:15px;
    line-height:1.25;
    font-weight:650;
    color:#111827;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.visits-fc .fc-visit-stage-no_asistio .fc-event-title,
.visits-fc .fc-visit-stage-perdida .fc-event-title { color:#64748b; }
.visits-fc .fc-visit-cancelled .fc-event-time,
.visits-fc .fc-visit-cancelled .fc-event-title { color:#b91c1c; text-decoration:line-through; }
.visits-fc .fc a { text-decoration: none; }

/* Month grid: flat rows (dot + text), no block chrome. */
.visits-fc .fc-daygrid-event {
    display:block;
    margin:0 0 14px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow:visible;
}
.visits-fc .fc-daygrid-event:hover .fc-event-title { color:#111827; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }

/* Week / day (timeGrid) events: compact coloured blocks tinted by status. */
.visits-fc .fc-timegrid-event {
    border:none !important;
    background:transparent !important;
    box-shadow:none;
    border-radius:7px;
}
.visits-fc .fc-timegrid-event .fc-event-main { padding:0; }
.visits-fc .fc-timegrid-event .fc-visit-item {
    display:block;
    height:100%;
    padding:3px 8px;
    border-radius:7px;
    background:var(--visit-tint, #eff6ff);
    border-left:3px solid var(--visit-color, #2563eb);
    overflow:hidden;
}
.visits-fc .fc-timegrid-event .fc-visit-dot { display:none; }
/* The time axis already labels the row, so the block only needs the name. */
.visits-fc .fc-timegrid-event .fc-event-time { display:none; }
.visits-fc .fc-timegrid-event .fc-event-title { font-size:12.5px; font-weight:700; color:#0f172a; white-space:normal; }
.visits-fc .fc-timegrid-event.fc-visit-cancelled .fc-event-time,
.visits-fc .fc-timegrid-event.fc-visit-cancelled .fc-event-title { text-decoration:line-through; color:#b91c1c; }

/* ── Status colour key ── */
.visits-fc-legend {
    display:flex;
    flex-wrap:wrap;
    gap:10px 18px;
    margin-top:16px;
    padding:14px 16px;
    border:1px solid #eef1f6;
    border-radius:12px;
    background:#fbfcfe;
}
.visits-fc-legend__item { display:inline-flex; align-items:center; gap:7px; font-size:12.5px; font-weight:600; color:#475569; }
.visits-fc-legend__dot { width:9px; height:9px; border-radius:999px; flex:0 0 auto; }

/* ── Mobile: collapse events to status dots; tapping a day opens the day sheet ── */
@media (max-width: 640px) {
    .visits-fc .fc .fc-daygrid-day-frame { padding: 8px 3px 6px; cursor: pointer; }
    .visits-fc .fc .fc-daygrid-day-number { font-size:15px; padding:0 0 5px; text-align:center; }
    .visits-fc .fc .fc-col-header-cell-cushion { padding:10px 2px; font-size:11px; }
    /* A centred row of dots under the number; inline-block flows + wraps them. */
    .visits-fc .fc-daygrid-day-events {
        display:block;
        text-align:center;
        line-height:1;
        margin:0;
        min-height:0;
        pointer-events:none;            /* taps fall through to the day cell → dateClick */
    }
    .visits-fc .fc-daygrid-event-harness { display:inline-block; position:static !important; margin:2px !important; top:auto !important; width:auto !important; }
    .visits-fc .fc-daygrid-event { display:inline-block !important; margin:0 !important; }
    .visits-fc .fc-daygrid-event .fc-event-main, .visits-fc .fc-daygrid-event .fc-event-main-frame { display:inline-block; width:auto; }
    .visits-fc .fc-daygrid-event .fc-visit-body { display:none; }
    .visits-fc .fc-daygrid-event .fc-visit-item { display:inline-block; gap:0; width:auto; }
    .visits-fc .fc-daygrid-event .fc-visit-dot { display:inline-block; width:7px; height:7px; margin:0; vertical-align:middle; }
    .visits-fc .fc-daygrid-more-link { display:none; }  /* the day sheet lists everything */
}

/* ── Activity timeline (per-property Resumen) ── */
.ad-timeline {
    position: relative;
    padding-left: 6px;
}
.ad-timeline-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 18px 14px;
    border-left: 2px solid #e6eaf0;
}
.ad-timeline-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}
.ad-timeline-dot {
    position: absolute;
    left: -7px;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 3px #fff;
}
.ad-timeline-item--green .ad-timeline-dot { background: #16a34a; }
.ad-timeline-item--blue  .ad-timeline-dot { background: var(--primary-color, #1F7BFF); }
.ad-timeline-item--amber .ad-timeline-dot { background: #d97706; }
.ad-timeline-item--red   .ad-timeline-dot { background: #dc2626; }
.ad-timeline-item--gray  .ad-timeline-dot { background: #94a3b8; }
.ad-timeline-body { flex: 1; min-width: 0; }
.ad-timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.ad-timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: #0b2545;
    text-decoration: none;
}
a.ad-timeline-title:hover { color: var(--primary-color, #1F7BFF); text-decoration: underline; }
.ad-timeline-date {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}
.ad-timeline-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* ── Property Manager Tabs (per-property dashboard sub-nav) ── */
.pm-property-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-bottom: 20px;
}

.pm-property-header__thumb {
    width: 96px;
    height: 72px;
    border-radius: 10px;
    flex: 0 0 auto;
}

.pm-property-header__body {
    flex: 1 1 auto;
    min-width: 0;
}

.pm-property-header__title {
    margin: 0 0 6px;
}

.pm-property-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    flex: 0 0 auto;
    max-width: 380px;
}

.pm-property-header__actions .btn-secondary {
    justify-content: center;
}

.pm-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 24px;
    padding: 5px;
    background: #f1f5f9;
    border: 1px solid var(--border-color, #DCE3EA);
    border-radius: 14px;
}

.pm-tabs-mobile {
    display: none;
    margin-bottom: 18px;
}

.pm-tabs-mobile__label {
    display: block;
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.pm-tabs-mobile__select {
    width: 100%;
    min-height: 46px;
    padding: 10px 40px 10px 12px;
    border: 1px solid var(--border-color, #DCE3EA);
    border-radius: 12px;
    background: #fff;
    color: var(--text-primary, #0F172A);
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pm-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #64748B);
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

/* Count pill inside a filter tab */
.pm-tab-count {
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    opacity: 0.55;
}
.pm-tab--active .pm-tab-count { opacity: 0.8; }

.pm-tab svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    opacity: .9;
}

.pm-tab:hover {
    color: var(--text-primary, #0F172A);
    background: rgba(255, 255, 255, 0.7);
}

.pm-tab--active {
    color: var(--primary-color, #1F7BFF);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.pm-tab--active svg {
    opacity: 1;
    color: var(--primary-color, #1F7BFF);
}

/* Accent underline on the active tab */
.pm-tab--active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-gradient, linear-gradient(135deg, #20D6C7 0%, #1F7BFF 100%));
}

/* "Editar Propiedad" sits apart as a secondary action, pushed to the right */
.pm-tab--edit {
    margin-left: auto;
    color: #475569;
}
.pm-tab--edit:hover {
    background: rgba(255, 255, 255, 0.85);
    color: var(--primary-color, #1F7BFF);
}

/* Unread counter pill on a tab */
.pm-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 640px) {
    .pm-property-header {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .pm-property-header__thumb {
        width: 72px;
        height: 56px;
    }

    .pm-property-header__title {
        font-size: 18px;
        line-height: 1.25;
    }

    .pm-property-header__actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: none;
        justify-content: stretch;
    }

    .pm-property-header__actions .btn-secondary {
        width: 100%;
        min-height: 40px;
        white-space: normal;
        text-align: center;
    }

    .pm-tabs-mobile {
        display: block;
    }

    .pm-tabs {
        display: none;
    }
}

@media (max-width: 420px) {
    .pm-property-header {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .pm-property-header__thumb {
        width: 64px;
        height: 50px;
    }

    .pm-property-header__actions {
        grid-template-columns: 1fr;
    }
}

/* ── Rent payments (Pagos) panel ─────────────────────────────────────────── */
.pagos-panel { margin-bottom: 20px; }
.pagos-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.pagos-summary__item {
    flex: 1 1 160px;
    border: 1px solid #e6eaf0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #fff;
}
.pagos-summary__item span { display: block; font-size: 12px; color: #64748b; }
.pagos-summary__item strong { font-size: 18px; color: #0b2545; }
.pagos-error { color: #dc2626; font-size: 13px; margin: 0 0 10px; }

.pagos-form { display: flex; flex-direction: column; gap: 10px; }
.pagos-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #475569; }
.pagos-field input, .pagos-field select, .pagos-field textarea {
    font-weight: 400;
    padding: 9px 11px;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
}

.pagos-month__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.pagos-month__figures { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: #475569; }
.pago-status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pago-status--paid { background: #dcfce7; color: #166534; }
.pago-status--partial { background: #fef3c7; color: #92400e; }
.pago-status--pending { background: #f1f5f9; color: #475569; }

.pagos-items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pago-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 8px 10px; border: 1px solid #eef1f6; border-radius: 10px; font-size: 13px;
}
.pago-item--rejected { opacity: 0.7; }
.pago-amt { font-weight: 700; color: #0b2545; }
.pago-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pago-badge--confirmed { background: #dcfce7; color: #166534; }
.pago-badge--submitted { background: #dbeafe; color: #1e40af; }
.pago-badge--rejected { background: #fee2e2; color: #991b1b; }
.pago-src, .pago-date { font-size: 12px; color: #94a3b8; }
.pago-link { color: var(--primary-color, #1F7BFF); text-decoration: none; }
.pago-link:hover { text-decoration: underline; }
.pago-note { flex-basis: 100%; font-size: 12.5px; color: #64748b; }
.pago-note--reject { color: #b45309; }
.pago-actions { display: flex; gap: 6px; margin-left: auto; }

/* Rent schedule (increase) status badges */
.pago-badge--sched-pending { background: #fef3c7; color: #92400e; }
.pago-badge--sched-accepted { background: #dcfce7; color: #166534; }
.pago-badge--sched-rejected { background: #fee2e2; color: #991b1b; }
.pago-item--rejected .pago-amt { text-decoration: line-through; opacity: 0.7; }
