
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Nunito Sans", sans-serif;
    background: #f4f7f9;
    color: #043259;
    min-height: 100vh;
}


.agenda-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.agenda-main {
    flex: 1;
    padding: 24px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}


.agenda-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.agenda-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.agenda-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search */
.ag-search-wrap {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.ag-search-wrap input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 13px;
    font-family: "Nunito Sans", sans-serif;
    background: #fff;
    color: #043259;
    transition: all 0.2s ease;
}

.ag-search-wrap input:focus {
    outline: none;
    border-color: #036A6F;
    box-shadow: 0 0 0 3px rgba(96, 166, 153, 0.15);
}

.ag-search-wrap input::placeholder { color: #80A4AE; }

.ag-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* Location filter */
.ag-location-select {
    padding: 9px 12px;
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 13px;
    font-family: "Nunito Sans", sans-serif;
    background: #fff;
    color: #043259;
    cursor: pointer;
    min-width: 180px;
}

.ag-location-select:focus {
    outline: none;
    border-color: #036A6F;
}

/* Toolbar buttons */
.ag-btn-primary {
    padding: 9px 18px;
    background: #043259;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    font-family: "Nunito Sans", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ag-btn-primary:hover {
    background: #036A6F;
    transform: translateY(-1px);
}

.ag-btn-primary img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.ag-btn-ghost {
    padding: 9px 16px;
    background: #fff;
    color: #043259;
    border: 1px solid #E56163;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Nunito Sans", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ag-btn-ghost:hover { background: rgba(96, 166, 153, 0.1); }

.ag-btn-ghost img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Search results dropdown */
.ag-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #60A699;
    border-radius: 5px;
    box-shadow: 0 4px 16px rgba(4, 50, 89, 0.12);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.ag-search-results.show { display: block; }

.ag-search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(176, 217, 205, 0.4);
    transition: background 0.15s;
}

.ag-search-result-item:last-child { border-bottom: none; }
.ag-search-result-item:hover { background: rgba(176, 217, 205, 0.35); }

.ag-sr-name {
    font-size: 13px;
    font-weight: 700;
    color: #043259;
}

.ag-blocked-block {
    background: repeating-linear-gradient(
        45deg,
        rgba(229, 97, 99, 0.08),
        rgba(229, 97, 99, 0.08) 4px,
        rgba(229, 97, 99, 0.18) 4px,
        rgba(229, 97, 99, 0.18) 8px
    );
    cursor: pointer;
    pointer-events: all;  /* ← was none, blocking clicks */
}

.ag-sr-detail {
    font-size: 11px;
    color: #80A4AE;
    margin-top: 1px;
}

.ag-sr-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}


.ag-week-bar {
    background: #fff;
    border: 1px solid #B0D9CD;
    border-radius: 10px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.ag-week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ag-nav-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Nunito Sans", sans-serif;
    color: #043259;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ag-nav-btn:hover { background: rgba(96, 166, 153, 0.1); }

.ag-today-btn {
    padding: 6px 14px;
    background: rgba(176, 217, 205, 0.35);
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    font-family: "Nunito Sans", sans-serif;
    color: #036A6F;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ag-today-btn:hover { background: #B0D9CD; }

.ag-week-label {
    font-size: 14px;
    font-weight: 700;
    color: #043259;
}

/* Legend */
.ag-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ag-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #80A4AE;
    font-weight: 600;
}

.ag-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Summary pills */
.ag-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ag-summary-pill {
    background: rgba(176, 217, 205, 0.35);
    border: 1px solid #60A699;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #036A6F;
}

.ag-summary-pill.pending {
    background: rgba(186, 117, 23, 0.1);
    border-color: #BA7517;
    color: #BA7517;
}


.ag-calendar {
    background: #fff;
    border: 1px solid #B0D9CD;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(4, 50, 89, 0.06);
}

/* Header row */
.ag-cal-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: rgba(176, 217, 205, 0.35);
    border-bottom: 2px solid #60A699;
}

.ag-cal-header-time {
    border-right: 1px solid rgba(96, 166, 153, 0.3);
}

.ag-cal-header-day {
    padding: 10px 6px 8px;
    text-align: center;
    border-right: 1px solid rgba(96, 166, 153, 0.2);
    cursor: default;
    transition: background 0.15s;
}

.ag-cal-header-day:last-child { border-right: none; }

.ag-day-name {
    font-size: 10px;
    font-weight: 700;
    color: #036A6F;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ag-day-num {
    font-size: 18px;
    font-weight: 700;
    color: #043259;
    margin-top: 2px;
    line-height: 1;
}

.ag-cal-header-day.ag-today .ag-day-num {
    background: #036A6F;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px auto 0;
    font-size: 15px;
}

.ag-cal-header-day.ag-past {
    opacity: 0.45;
}

/* Calendar body */
.ag-cal-body {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    overflow-y: auto;
    max-height: calc(100vh - 280px);
}

.ag-time-col {
    border-right: 1px solid #e8f0f2;
}

.ag-time-slot {
    height: 60px;
    display: flex;
    align-items: flex-start;
    padding: 4px 8px 0;
    border-bottom: 1px solid #f0f5f6;
    font-size: 10px;
    color: #80A4AE;
    font-weight: 600;
}

.ag-day-col {
    border-right: 1px solid #f0f5f6;
    position: relative;
}

.ag-day-col:last-child { border-right: none; }

.ag-day-col.ag-today-col { background: rgba(176, 217, 205, 0.04); }

.ag-day-cell {
    height: 60px;
    border-bottom: 1px solid #f0f5f6;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
}

.ag-day-cell:hover { background: rgba(176, 217, 205, 0.15); }

.ag-day-cell.ag-past-cell {
    cursor: default;
    background: rgba(240, 244, 246, 0.5);
}

.ag-day-cell.ag-past-cell:hover { background: rgba(240, 244, 246, 0.5); }

/* Appointment blocks */
.ag-appt-block {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 5px;
    padding: 3px 6px 3px 10px;
    cursor: pointer;
    overflow: hidden;
    z-index: 2;
    transition: all 0.15s;
    border-left: 4px solid transparent;
}

.ag-appt-block:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(4, 50, 89, 0.15);
    z-index: 3;
}

/* Status colors */
.ag-appt-confirmed {
    background: rgba(176, 217, 205, 0.5);
    border-left-color: #036A6F;
}

.ag-appt-cancelled {
    background: #FCEBEB;
    border-left-color: #E56163;
    opacity: 0.7;
    text-decoration: line-through;
}

.ag-appt-pending {
    background: rgba(186, 117, 23, 0.12);
    border-left-color: #BA7517;
}

.ag-appt-online {
    background: rgba(24, 95, 165, 0.1);
    border-left-color: #043259;
}

.ag-appt-blocked {
    background: repeating-linear-gradient(
        45deg,
        rgba(128, 164, 174, 0.08),
        rgba(128, 164, 174, 0.08) 4px,
        transparent 4px,
        transparent 8px
    );
    border-left-color: #80A4AE;
}

.ag-appt-completed {
    background: rgba(176, 217, 205, 0.25);
    border-left-color: #B0D9CD;
    opacity: 0.7;
}

.ag-appt-name {
    font-size: 11px;
    font-weight: 700;
    color: #043259;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.ag-appt-detail {
    font-size: 10px;
    color: #4d6F8C;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 1px;
}

/* Loading state */
.ag-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    font-size: 14px;
    color: #80A4AE;
    flex-direction: column;
    gap: 12px;
}

.ag-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(176, 217, 205, 0.4);
    border-top-color: #036A6F;
    border-radius: 50%;
    animation: ag-spin 0.7s linear infinite;
}

@keyframes ag-spin { to { transform: rotate(360deg); } }

.ag-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 50, 89, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ag-modal-overlay.active { display: flex; }

.ag-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(4, 50, 89, 0.2);
    animation: ag-modal-in 0.2s ease;
}


#sc-new-service, #rs-new-date, #rs-new-time {
    width: 100%;
    padding: 12px;
    border: 1px solid #60A699;
    border-radius: 5px;
    font-family: "Nunito Sans";
    font-size: 14px;
    color: #043259;
    background: rgba(176, 217, 205, 0.15);
    box-sizing: border-box;
}

@keyframes ag-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ag-modal-top-bar {
    height: 5px;
    border-radius: 10px 10px 0 0;
    background: #036A6F;
}

.ag-modal-top-bar.amber  { background: #E7964F; }
.ag-modal-top-bar.coral  { background: #E56163; }
.ag-modal-top-bar.navy   { background: #043259; }

.ag-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
}

.ag-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #043259;
}

.ag-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #E56163;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-family: "Nunito Sans", sans-serif;
    transition: color 0.15s;
}

.ag-modal-close:hover { color: #E56163; }

.ag-modal-body { padding: 16px 20px; }


.ag-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #B0D9CD;
}

.ag-detail-accent {
    width: 5px;
    border-radius: 3px;
    align-self: stretch;
    flex-shrink: 0;
    min-height: 60px;
}

.ag-detail-name {
    font-size: 18px;
    font-weight: 800;
    color: #043259;
    line-height: 1.2;
}

.ag-detail-time-badge {
    background: rgba(176, 217, 205, 0.35);
    border: 1px solid #60A699;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    color: #036A6F;
    white-space: nowrap;
}

.ag-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-top: 6px;
}

.ag-chip-confirmed  { background: rgba(176,217,205,0.35); color: #036A6F; border: 1px solid #60A699; }
.ag-chip-pending    { background: rgba(186,117,23,0.12); color: #BA7517; border: 1px solid #EF9F27; }
.ag-chip-online     { background: rgba(24,95,165,0.1); color: #043259; border: 1px solid #043259; }
.ag-chip-completed  { background: #f4f7f9; color: #80A4AE; border: 1px solid #B0D9CD; }
.ag-chip-cancelled  { background: rgba(229,97,99,0.08); color: #E56163; border: 1px solid #F09595; }
.ag-chip-blocked    { background: #f4f7f9; color: #80A4AE; border: 1px solid #c8d0d6; }

.ag-detail-info-grid {
    background: rgba(176, 217, 205, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 2;
}

.ag-detail-info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(176, 217, 205, 0.4);
    padding: 3px 0;
}

.ag-detail-info-row:last-child { border-bottom: none; }

.ag-detail-key { color: #80A4AE; font-weight: 400; }
.ag-detail-val { color: #043259; font-weight: 600; text-align: right; }

.ag-phone-link {
    color: #036A6F;
    text-decoration: none;
    font-weight: 700;
}

.ag-phone-link:hover { text-decoration: underline; }

/* Seguimiento panel */
.ag-followup-panel {
    background: rgba(24, 95, 165, 0.06);
    border: 1px solid #85B7EB;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    display: none;
}

.ag-followup-panel.show { display: block; }

.ag-followup-panel h4 {
    font-size: 13px;
    font-weight: 700;
    color: #043259;
    margin-bottom: 8px;
}

.ag-fu-opts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ag-fu-btn {
    padding: 5px 11px;
    border: 1px solid #85B7EB;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #4d6F8C;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
}

.ag-fu-btn:hover, .ag-fu-btn.selected {
    background: #4d6F8C;
    color: #fff;
    border-color: #4d6F8C;
}

.ag-fu-result {
    font-size: 12px;
    font-weight: 700;
    color: #4d6F8C;
    background: #fff;
    border: 1px solid #85B7EB;
    border-radius: 5px;
    padding: 7px 10px;
    display: none;
    margin-bottom: 8px;
}

.ag-fu-result.show { display: block; }

.ag-fu-go-btn {
    width: 100%;
    padding: 9px;
    background: #4d6F8C;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: background 0.15s;
}

.ag-fu-go-btn:hover { background: #043259; }

/* Modal action buttons */
.ag-modal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 20px 20px;
    border-top: 1px solid rgba(176, 217, 205, 0.4);
    padding-top: 14px;
}

.ag-act-cancel {
    padding: 9px 14px;
    background: rgba(229, 97, 99, 0.1);
    border: 1px solid #F09595;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #791F1F;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
}

.ag-act-cancel:hover { background: rgba(229, 97, 99, 0.2); }

.ag-act-secondary {
    padding: 9px 14px;
    background: #fff;
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #043259;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
}

.ag-act-secondary:hover { background: rgba(176, 217, 205, 0.2); }

.ag-act-confirm {
    padding: 9px 14px;
    background: rgba(176, 217, 205, 0.35);
    border: 1px solid #60A699;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #036A6F;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
}

.ag-act-confirm:hover { background: #B0D9CD; }

.ag-act-followup {
    padding: 9px 14px;
    background: rgba(24, 95, 165, 0.08);
    border: 1px solid #85B7EB;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #4d6F8C;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
}

.ag-act-followup:hover { background: rgba(24, 95, 165, 0.15); }


.ag-form-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(176, 217, 205, 0.4);
}

.ag-form-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.ag-form-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #80A4AE;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ag-source-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ag-src-btn {
    flex: 1;
    min-width: 80px;
    padding: 7px 6px;
    border: 1px solid #B0D9CD;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    background: #fff;
    color: #4d6F8C;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.15s;
    line-height: 1.4;
}

.ag-src-btn img {
    width: 30px;
    height: 30px;
}

.ag-src-btn:hover { border-color: #60A699; }
.ag-src-btn.active {
    background: rgba(176, 217, 205, 0.35);
    border-color: #036A6F;
    color: #036A6F;
}

.ag-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.ag-field-row.full { grid-template-columns: 1fr; }

.ag-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #4d6F8C;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ag-field input,
.ag-field select,
.ag-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #B0D9CD;
    border-radius: 5px;
    font-size: 13px;
    font-family: "Nunito Sans", sans-serif;
    background: #fff;
    color: #043259;
    transition: border-color 0.15s;
}

.ag-field input:focus,
.ag-field select:focus,
.ag-field textarea:focus {
    outline: none;
    border-color: #036A6F;
    box-shadow: 0 0 0 3px rgba(96, 166, 153, 0.12);
}

.ag-field textarea {
    resize: none;
    font-size: 12px;
}

.ag-hipaa-note {
    background: rgba(176, 217, 205, 0.2);
    border-left: 3px solid #036A6F;
    border-radius: 0 5px 5px 0;
    padding: 8px 12px;
    font-size: 11px;
    color: #4d6F8C;
    line-height: 1.5;
    margin-top: 8px;
}

.ag-hipaa-note img {
    width: 16px;
    height: 16px;
    align-self: center;
}

/* Save button */
.ag-save-btn {
    width: 100%;
    padding: 13px;
    background: #043259;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.ag-save-btn:hover { background: #036A6F; transform: translateY(-1px); }
.ag-save-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }


.ag-block-notice {
    background: rgba(186, 117, 23, 0.08);
    border-left: 3px solid #E7964F;
    border-radius: 0 5px 5px 0;
    padding: 10px 12px;
    font-size: 12px;
    color: #7A4A00;
    line-height: 1.6;
    margin-bottom: 14px;
}

.ag-block-btn {
    width: 100%;
    padding: 13px;
    background: #E56163;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: "Nunito Sans", sans-serif;
    transition: all 0.2s ease;
}

.ag-block-btn:hover { background: #F09595; transform: translateY(-1px); }


.ag-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #043259;
    color: #fff;
    padding: 11px 20px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    font-family: "Nunito Sans", sans-serif;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    border-left: 4px solid #60A699;
    box-shadow: 0 4px 16px rgba(4, 50, 89, 0.2);
    white-space: nowrap;
    pointer-events: none;
}

.ag-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ag-toast.error { border-left-color: #E56163; }


.ag-modal-error {
    background: rgba(229, 97, 99, 0.08);
    border-left: 3px solid #E56163;
    border-radius: 0 5px 5px 0;
    padding: 9px 12px;
    font-size: 12px;
    color: #791F1F;
    margin-bottom: 12px;
    display: none;
}

.ag-modal-error.show { display: block; }

#modal-block-detail .ag-modal {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(4, 50, 89, 0.15);
}

#modal-block-detail .ag-modal-header {
    background: #FEF2F2;
    border-bottom: 2px solid #E56163;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#modal-block-detail .ag-modal-header h3 {
    color: #043259;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

#modal-block-detail .ag-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#modal-block-detail .ag-detail-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #043259;
}

#modal-block-detail .ag-detail-label {
    font-weight: 700;
    min-width: 70px;
    color: #60A699;
}

#modal-block-detail .ag-modal-footer {
    padding: 12px 20px 20px;
}

#modal-block-detail .ag-btn-danger {
    width: 100%;
    padding: 10px;
    background: #E56163;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#modal-block-detail .ag-btn-danger:hover {
    background: #d04f51;
}

/* ── Conflict Modal ─────────────────────────── */
#modal-conflictos .ag-modal {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(4, 50, 89, 0.15);
    max-width: 480px;
}

#modal-conflictos .ag-modal-header {
    background: #FFFBEB;
    border-bottom: 2px solid #E56163;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#modal-conflictos .ag-modal-header h3 {
    color: #E56163;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

#modal-conflictos .ag-modal-body {
    padding: 20px;
    color: #043259;
    font-size: 14px;
    line-height: 1.6;
}

#modal-conflictos .ag-modal-body ul {
    margin: 12px 0;
    padding-left: 0;
    list-style: none;
}

#modal-conflictos .ag-modal-body ul li {
    padding: 10px 14px;
    margin-bottom: 8px;
    background: rgba(176, 217, 205, 0.25);
    border-left: 3px solid #E56163;
    border-radius: 6px;
    font-size: 13px;
}

#modal-conflictos .ag-modal-body ul li strong {
    color: #043259;
}

#modal-conflictos .ag-modal-footer {
    padding: 12px 20px 20px;
    display: flex;
    gap: 10px;
}

#modal-conflictos .ag-btn-secondary {
    flex: 1;
    padding: 10px;
    background: white;
    color: #043259;
    border: 2px solid #B0D9CD;
    border-radius: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

#modal-conflictos .ag-btn-secondary:hover {
    background: rgba(176, 217, 205, 0.25);
}

#modal-conflictos .ag-btn-danger {
    flex: 1;
    padding: 10px;
    background: #E56163;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

#modal-conflictos .ag-btn-danger:hover {
    background: #d04f51;
}

.ag-inactive-col {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(176,217,205,0.15) 4px,
        rgba(176,217,205,0.15) 8px
    );
}

.ag-inactive-cell {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(176,217,205,0.15) 4px,
        rgba(176,217,205,0.15) 8px
    );
    cursor: not-allowed;
    pointer-events: none;
}

.ag-inactive-col .ag-day-cell {
    pointer-events: none;
}

@media (max-width: 1024px) {
    .agenda-main { padding: 16px; }
    .ag-cal-header { grid-template-columns: 50px repeat(7, 1fr); }
    .ag-cal-body   { grid-template-columns: 50px repeat(7, 1fr); }
}

@media (max-width: 768px) {
    .ag-cal-header { grid-template-columns: 44px repeat(5, 1fr); }
    .ag-cal-body   { grid-template-columns: 44px repeat(5, 1fr); }
    .ag-legend { display: none; }
}