/* =========================================================
   Agenda Rafaela 2031 - Estilos
   Todo va bajo .ar2031-wrapper para no afectar al tema
   ========================================================= */

.ar2031-wrapper {
    --ar-bg: #ffffff;
    --ar-surface: #f8fafc;
    --ar-border: #e2e8f0;
    --ar-text: #1e293b;
    --ar-text-muted: #64748b;
    --ar-primary: #0f766e;
    --ar-primary-dark: #115e59;
    --ar-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --ar-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --ar-radius: 8px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ar-text);
    box-sizing: border-box;
    line-height: 1.5;
    max-width: 100%;
}

.ar2031-wrapper *,
.ar2031-wrapper *::before,
.ar2031-wrapper *::after {
    box-sizing: border-box;
}

.ar2031-empty {
    padding: 24px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: var(--ar-radius);
    color: #78350f;
}

/* ---------- Toolbar ---------- */
.ar2031-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ar-border);
}

.ar2031-tabs {
    display: flex;
    gap: 4px;
    background: var(--ar-surface);
    padding: 4px;
    border-radius: var(--ar-radius);
}

.ar2031-tab {
    background: transparent;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ar-text-muted);
    transition: all 0.15s ease;
}

.ar2031-tab:hover {
    color: var(--ar-text);
}

.ar2031-tab.is-active {
    background: var(--ar-bg);
    color: var(--ar-primary);
    box-shadow: var(--ar-shadow);
}

.ar2031-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ar2031-filters input,
.ar2031-filters select {
    padding: 8px 12px;
    border: 1px solid var(--ar-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--ar-bg);
    color: var(--ar-text);
    min-width: 150px;
}

.ar2031-filters input:focus,
.ar2031-filters select:focus {
    outline: none;
    border-color: var(--ar-primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* ---------- Vistas: mostrar solo la activa ---------- */
.ar2031-view {
    display: none;
}
.ar2031-wrapper[data-vista="calendario"] .ar2031-view-calendario,
.ar2031-wrapper[data-vista="kanban"] .ar2031-view-kanban {
    display: block;
}

/* ---------- Calendario ---------- */
.ar2031-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ar2031-cal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--ar-text);
}

.ar2031-cal-prev,
.ar2031-cal-next {
    background: var(--ar-surface);
    border: 1px solid var(--ar-border);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    color: var(--ar-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ar2031-cal-prev:hover,
.ar2031-cal-next:hover {
    background: var(--ar-primary);
    color: white;
    border-color: var(--ar-primary);
}

.ar2031-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.ar2031-cal-weekdays > div {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--ar-text-muted);
    text-transform: uppercase;
    padding: 8px 4px;
}

.ar2031-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ar2031-cal-day {
    min-height: 100px;
    background: var(--ar-bg);
    border: 1px solid var(--ar-border);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
}

.ar2031-cal-day.is-other-month {
    background: var(--ar-surface);
    opacity: 0.45;
}

.ar2031-cal-day.is-today {
    border-color: var(--ar-primary);
    box-shadow: inset 0 0 0 1px var(--ar-primary);
}

.ar2031-cal-day-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--ar-text-muted);
    margin-bottom: 2px;
}

.ar2031-cal-day.is-today .ar2031-cal-day-num {
    color: var(--ar-primary);
}

.ar2031-cal-event {
    background: var(--ar-primary);
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: none;
    text-align: left;
    width: 100%;
    transition: transform 0.1s;
}

.ar2031-cal-event:hover {
    transform: translateX(2px);
    filter: brightness(1.1);
}

/* ---------- Kanban ---------- */
.ar2031-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    align-items: flex-start;
    scroll-behavior: smooth;
    /* Indicar visualmente que hay contenido scrolleable a la izquierda */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.ar2031-kanban-board::-webkit-scrollbar {
    height: 8px;
}

.ar2031-kanban-board::-webkit-scrollbar-track {
    background: var(--ar-surface);
    border-radius: 4px;
}

.ar2031-kanban-board::-webkit-scrollbar-thumb {
    background: var(--ar-border);
    border-radius: 4px;
}

.ar2031-kanban-board::-webkit-scrollbar-thumb:hover {
    background: var(--ar-text-muted);
}

.ar2031-kanban-col {
    flex: 0 0 280px;
    background: var(--ar-surface);
    border-radius: var(--ar-radius);
    padding: 12px;
    max-height: 700px;
    display: flex;
    flex-direction: column;
}

/* Columna "actual/próximo mes": resaltada sutilmente */
.ar2031-kanban-col[data-focus="1"] {
    background: #ecfdf5;
    box-shadow: 0 0 0 2px var(--ar-primary);
}

.ar2031-kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 12px;
    border-bottom: 1px solid var(--ar-border);
    margin-bottom: 12px;
}

.ar2031-kanban-col-title {
    font-weight: 600;
    font-size: 14px;
    text-transform: capitalize;
    color: var(--ar-text);
}

.ar2031-kanban-col-count {
    background: var(--ar-bg);
    color: var(--ar-text-muted);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

.ar2031-kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.ar2031-card {
    background: var(--ar-bg);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: var(--ar-shadow);
    cursor: pointer;
    border-left: 3px solid var(--ar-primary);
    transition: all 0.15s;
}

.ar2031-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ar2031-card-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.35;
    color: var(--ar-text);
}

.ar2031-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--ar-text-muted);
}

.ar2031-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ar2031-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--ar-surface);
    color: var(--ar-text);
    margin-top: 6px;
}

/* ---------- Modal ---------- */
.ar2031-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ar2031-modal.is-open {
    display: flex;
}

.ar2031-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
}

.ar2031-modal-content {
    position: relative;
    background: var(--ar-bg);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--ar-shadow-lg);
    animation: ar2031-modal-in 0.2s ease-out;
}

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

.ar2031-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--ar-surface);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--ar-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ar2031-modal-close:hover {
    background: var(--ar-text);
    color: white;
}

.ar2031-modal-body {
    padding: 28px 28px 24px;
}

.ar2031-modal-body h3 {
    margin: 0 0 16px;
    padding-right: 32px;
    font-size: 20px;
    font-weight: 700;
    color: var(--ar-text);
    line-height: 1.3;
}

.ar2031-modal-body .ar2031-modal-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ar2031-modal-body .ar2031-badge {
    padding: 4px 12px;
    border-radius: 999px;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.ar2031-modal-body .ar2031-descripcion {
    background: var(--ar-surface);
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    color: var(--ar-text);
    font-size: 14px;
    line-height: 1.6;
}

.ar2031-modal-body .ar2031-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ar2031-modal-body .ar2031-info-row {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--ar-border);
    font-size: 14px;
}

.ar2031-modal-body .ar2031-info-row:last-child {
    border-bottom: none;
}

.ar2031-modal-body .ar2031-info-label {
    font-weight: 600;
    color: var(--ar-text-muted);
    min-width: 90px;
}

.ar2031-modal-body .ar2031-info-value {
    color: var(--ar-text);
    flex: 1;
}

/* ---------- Responsivo ---------- */
@media (max-width: 768px) {
    .ar2031-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ar2031-filters {
        flex-direction: column;
    }

    .ar2031-filters input,
    .ar2031-filters select {
        width: 100%;
    }

    .ar2031-cal-day {
        min-height: 70px;
        font-size: 11px;
        padding: 3px;
    }

    .ar2031-cal-event {
        font-size: 9px;
        padding: 2px 4px;
    }

    .ar2031-kanban-col {
        flex: 0 0 240px;
    }
}
