/* ═══════════════════════════════════════════
   GARÇA BRANCA — Reusable calendar widget
   ═══════════════════════════════════════════ */

.gcal {
    position: relative;
    background: var(--bg, #fff);
    border: 1.5px solid #E0E0E0;
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
    color: var(--text, #1a1a1a);
}

.gcal__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    background: var(--surface, #fafafa);
}

.gcal__nav-label {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: capitalize;
}

.gcal__nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-soft, #666);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    transition: background .2s, color .2s;
}

.gcal__nav-btn:hover {
    background: var(--accent-light, rgba(0, 0, 0, .05));
    color: var(--accent, #2563EB);
}

.gcal__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 6px 8px 2px;
}

.gcal__weekdays span {
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-soft, #666);
    padding: 2px 0;
}

.gcal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 4px 8px 8px;
    gap: 2px;
}

.gcal__day {
    aspect-ratio: 1;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    position: relative;
    padding: 0;
    transition: background .15s, color .15s;
    color: inherit;
}

.gcal__day-num {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text, #1a1a1a);
}

.gcal__day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gcal__day--empty {
    pointer-events: none;
}

.gcal__day--passado {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}
.gcal__day--passado .gcal__day-num { color: var(--text-soft, #777); }

.gcal__day--fechado {
    cursor: help;
    opacity: .55;
}
.gcal__day--fechado .gcal__day-num {
    color: #6B7280;
    text-decoration: line-through;
}
.gcal__day--fechado .gcal__day-dot { background: #6B7280; }

.gcal__day--livre:not(:disabled):hover {
    background: var(--accent-light, rgba(34, 197, 94, .12));
}

.gcal__day--parcial:not(:disabled):hover {
    background: rgba(249, 115, 22, .12);
}
.gcal__day--parcial .gcal__day-dot { background: #F97316; }

.gcal__day--lotado {
    cursor: default;
    pointer-events: none;
}
.gcal__day--lotado .gcal__day-num {
    color: #EF4444;
    text-decoration: line-through;
    opacity: .6;
}
.gcal__day--lotado .gcal__day-dot { background: #EF4444; }

.gcal__day--selected {
    background: var(--accent, #2563EB) !important;
    color: #fff;
}
.gcal__day--selected .gcal__day-num { color: #fff; }
.gcal__day--selected .gcal__day-dot { background: rgba(255, 255, 255, .85) !important; }

.gcal__day--range-start,
.gcal__day--range-end {
    background: var(--accent, #2563EB) !important;
    color: #fff;
}
.gcal__day--range-start .gcal__day-num,
.gcal__day--range-end .gcal__day-num { color: #fff; }

.gcal__day--in-range {
    background: var(--accent-light, rgba(37, 99, 235, .15));
    border-radius: 0;
}

.gcal__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(0, 0, 0, .05);
}

.gcal__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    color: var(--text-soft, #666);
    font-weight: 500;
}

.gcal__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gcal__dot--livre { background: #22C55E; }
.gcal__dot--parcial { background: #F97316; }
.gcal__dot--lotado { background: #EF4444; }
.gcal__dot--fechado { background: #6B7280; }

.gcal__tooltip {
    position: absolute;
    z-index: 50;
    background: rgba(17, 24, 39, .96);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
    font-size: .78rem;
    line-height: 1.35;
    max-width: 220px;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gcal__tooltip strong {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .8;
    font-weight: 600;
}
.gcal__tooltip span {
    font-size: .85rem;
    font-weight: 600;
}

/* ── POPOVER ──────────────────────────── */
.gcal-popover {
    position: absolute;
    z-index: 9000;
    width: 320px;
    max-width: calc(100vw - 16px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .18);
    border-radius: 14px;
    overflow: visible;
}

/* ── DATE BUTTON (visible trigger) ───── */
.gcal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #E0E0E0;
    background: var(--bg, #fff);
    color: var(--text, #1a1a1a);
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: left;
}
.gcal-trigger:hover { border-color: var(--accent, #2563EB); }
.gcal-trigger:focus-visible {
    outline: 2px solid var(--accent, #2563EB);
    outline-offset: 2px;
}
.gcal-trigger.is-empty [data-gcal-label] { color: var(--text-soft, #888); font-weight: 400; }
.gcal-trigger [data-gcal-label] {
    flex: 1;
    font-weight: 600;
}
.gcal-trigger i { color: var(--text-soft, #777); font-size: .9rem; }

.gcal-trigger--compact {
    padding: 6px 10px;
    font-size: .85rem;
    border-radius: 8px;
}
