/* Calendario interno de tareas (globo lobby) */

.sc-calendar-dock {
    top: 240px;
    left: 18px;
}

.sc-calendar-hub {
    position: relative;
    z-index: 3;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, #38bdf8 70%, transparent);
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 30%, color-mix(in srgb, #fff 16%, transparent), transparent 35%),
        radial-gradient(circle, color-mix(in srgb, #0ea5e9 50%, #05050a), #05050a 72%);
    box-shadow: 0 0 24px color-mix(in srgb, #38bdf8 40%, transparent), inset 0 0 18px rgba(255,255,255,0.08);
    cursor: grab;
    transition: transform 200ms ease, box-shadow 200ms ease;
    touch-action: none;
    user-select: none;
}

.sc-calendar-dock.is-dragging .sc-calendar-hub { cursor: grabbing; }

.sc-calendar-hub:hover {
    transform: scale(1.06);
    box-shadow: 0 0 36px color-mix(in srgb, #38bdf8 60%, transparent);
}

.sc-calendar-hub > i { font-size: 1.2rem; color: #7dd3fc; }

.sc-calendar-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 4;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font: 700 0.58rem/1 var(--font-mono);
    color: #0b1220;
    background: #fbbf24;
    box-shadow: 0 0 0 2px #05050a;
}

.sc-calendar-badge.is-urgent {
    color: #fff;
    background: #ef4444;
}

.sc-calendar-label {
    margin-top: 0.25rem;
    color: color-mix(in srgb, var(--text-primary) 75%, transparent);
    font: 700 0.55rem/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-align: center;
    pointer-events: none;
}

/* ── Modal principal ── */
.tc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12680;
    background: rgba(2, 6, 14, 0.72);
    backdrop-filter: blur(6px);
}

.tc-modal {
    position: fixed;
    inset: 3vh 2.5vw;
    z-index: 12690;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, #38bdf8 28%, transparent);
    border-radius: 16px;
    background: #111318;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    color: #e8eaed;
    font-family: "Google Sans", "Segoe UI", system-ui, sans-serif;
}

.tc-modal.hidden,
.tc-backdrop.hidden { display: none !important; }

.tc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #1b1c1f;
}

.tc-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    min-width: 10rem;
}

.tc-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 34px;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: transparent;
    color: #e8eaed;
    font-size: 0.82rem;
    cursor: pointer;
}

.tc-btn:hover { background: rgba(255, 255, 255, 0.06); }

.tc-btn-primary {
    border-color: transparent;
    background: #8ab4f8;
    color: #202124;
    font-weight: 600;
}

.tc-btn-primary:hover { filter: brightness(1.05); }

.tc-btn-icon {
    width: 34px;
    padding: 0;
    border-radius: 50%;
}

.tc-header-spacer { flex: 1; }

.tc-view-switch {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    overflow: hidden;
}

.tc-view-switch button {
    border: 0;
    background: transparent;
    color: #c4c7c5;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.tc-view-switch button.active {
    background: rgba(138, 180, 248, 0.18);
    color: #8ab4f8;
}

.tc-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 0;
    flex: 1;
}

.tc-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #16171a;
    overflow: auto;
}

.tc-mini-month {
    user-select: none;
}

.tc-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.tc-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.tc-mini-grid .dow {
    color: #9aa0a6;
    font-size: 0.65rem;
    padding: 0.2rem 0;
}

.tc-mini-day {
    border: 0;
    background: transparent;
    color: #e8eaed;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    margin: 0 auto;
    font-size: 0.72rem;
    cursor: pointer;
}

.tc-mini-day.muted { color: #5f6368; }
.tc-mini-day.today {
    outline: 1px solid #8ab4f8;
}
.tc-mini-day.selected {
    background: #8ab4f8;
    color: #202124;
    font-weight: 700;
}
.tc-mini-day.has-tasks::after {
    content: "";
    display: block;
    width: 4px;
    height: 4px;
    margin: -2px auto 0;
    border-radius: 50%;
    background: #fdd663;
}

.tc-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #c4c7c5;
}

.tc-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.tc-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.tc-dot-urgent { background: #f28b82; }
.tc-dot-on_time { background: #81c995; }
.tc-dot-ahead { background: #8ab4f8; }

.tc-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #111318;
}

.tc-week-head {
    display: grid;
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #1b1c1f;
}

.tc-week-head .gutter {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.65rem;
    color: #9aa0a6;
    display: grid;
    place-items: end;
    padding: 0.35rem 0.4rem;
}

.tc-day-head {
    padding: 0.45rem 0.35rem 0.55rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tc-day-head small {
    display: block;
    color: #9aa0a6;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tc-day-head strong {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-top: 0.15rem;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 500;
}

.tc-day-head.is-today strong {
    background: #8ab4f8;
    color: #202124;
}

.tc-week-scroll {
    position: relative;
    flex: 1;
    overflow: auto;
}

.tc-week-grid {
    position: relative;
    display: grid;
    grid-template-columns: 56px repeat(7, minmax(0, 1fr));
    min-height: 1440px; /* 24h * 60px */
}

.tc-hours {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tc-hour-label {
    position: absolute;
    right: 6px;
    transform: translateY(-50%);
    color: #9aa0a6;
    font-size: 0.65rem;
}

.tc-day-col {
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 59px,
        rgba(255, 255, 255, 0.06) 59px,
        rgba(255, 255, 255, 0.06) 60px
    );
}

.tc-day-col.is-drop-target {
    background-color: rgba(138, 180, 248, 0.08);
}

.tc-now-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #f28b82;
    z-index: 5;
    pointer-events: none;
}

.tc-now-line::before {
    content: "";
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f28b82;
}

.tc-event {
    position: absolute;
    z-index: 2;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 6px;
    border-left: 3px solid #81c995;
    padding: 0.25rem 0.4rem 0.35rem;
    background: color-mix(in srgb, #81c995 28%, #1b1c1f);
    color: #e8eaed;
    font-size: 0.72rem;
    line-height: 1.25;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.tc-event[data-commitment="urgent"] {
    border-left-color: #f28b82;
    background: color-mix(in srgb, #f28b82 30%, #1b1c1f);
}

.tc-event[data-commitment="ahead"] {
    border-left-color: #8ab4f8;
    background: color-mix(in srgb, #8ab4f8 28%, #1b1c1f);
}

.tc-event[data-commitment="daily"] {
    border-left-color: #fdd663;
    background: color-mix(in srgb, #fdd663 26%, #1b1c1f);
}

.tc-event.is-completed {
    opacity: 0.55;
    text-decoration: line-through;
}

.tc-event.is-dragging,
.tc-event.is-resizing {
    opacity: 0.92;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    cursor: grabbing;
}

.tc-event-title {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 18px;
}

.tc-event-meta {
    display: block;
    color: rgba(232, 234, 237, 0.75);
    font-size: 0.65rem;
}

.tc-event-check {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 6;
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: grid;
    place-items: center;
    pointer-events: auto;
}

.tc-event-check:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.tc-event-check.done {
    background: #81c995;
    border-color: #81c995;
    color: #0b1220;
    font-weight: 700;
}

.tc-duplicate-panel {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-dup-days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tc-dup-day {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 0.75rem;
    color: #e8eaed;
    cursor: pointer;
    user-select: none;
}

.tc-dup-day:has(input:checked) {
    border-color: #8ab4f8;
    background: rgba(138, 180, 248, 0.16);
}

.tc-dup-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.55rem;
    min-height: 1.4rem;
}

.tc-dup-chip {
    border: 1px solid rgba(138, 180, 248, 0.45);
    border-radius: 999px;
    background: rgba(138, 180, 248, 0.12);
    color: #c2d7fc;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    cursor: pointer;
}

.tc-resize-handle {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 8px;
    z-index: 4;
    cursor: ns-resize;
    touch-action: none;
}

.tc-resize-handle::after {
    content: "";
    position: absolute;
    left: 30%;
    right: 30%;
    top: 50%;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.45);
    transform: translateY(-50%);
}

.tc-resize-handle--top { top: 0; }
.tc-resize-handle--bottom { bottom: 0; }

.tc-event:hover .tc-resize-handle::after,
.tc-event.is-resizing .tc-resize-handle::after {
    background: rgba(255, 255, 255, 0.85);
}

.tc-dot-daily { background: #fdd663; }

/* Formulario crear / editar */
.tc-form-backdrop {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.45);
}

.tc-form {
    width: min(440px, 94%);
    max-height: 90%;
    overflow: auto;
    padding: 1.1rem 1.2rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #202124;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.tc-form h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.tc-form-hint {
    margin: 0 0 0.75rem;
    color: #9aa0a6;
    font-size: 0.78rem;
}

.tc-form textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.45;
}

.tc-form label {
    display: block;
    margin: 0.55rem 0 0.25rem;
    color: #c4c7c5;
    font-size: 0.75rem;
}

.tc-form input,
.tc-form textarea,
.tc-form select {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: #303134;
    color: #e8eaed;
    font-size: 0.9rem;
}

.tc-form .is-atlas-slot {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
    outline: none;
}

.tc-form.is-atlas-intake {
    border-color: color-mix(in srgb, #38bdf8 45%, transparent);
}

.tc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.tc-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.tc-btn-danger {
    margin-right: auto;
    border-color: color-mix(in srgb, #f28b82 50%, transparent);
    color: #f28b82;
}

@media (max-width: 860px) {
    .tc-modal { inset: 0; border-radius: 0; }
    .tc-body { grid-template-columns: 1fr; }
    .tc-sidebar { display: none; }
    .tc-week-grid { min-width: 720px; }
}
