.cal-frame { margin-bottom: 16px; }
.cal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.cal-header-icon {
    color: var(--hydra-light);
    display: inline-flex;
    align-items: center;
}
.cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.cal-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(5, 16, 42, 0.55);
    border: 1px solid var(--frame-border);
    color: var(--hydra-light);
    border-radius: 4px;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    transition: background 0.12s, color 0.12s;
}
.cal-nav-btn:hover { background: var(--hydra-deep); color: #fff; }
.cal-month {
    font-family: var(--font-display);
    font-size: 20px !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.cal-now {
    color: var(--text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Tabela */
.cal-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.cal-table thead th {
    background: linear-gradient(180deg, rgba(27, 58, 122, 0.35) 0%, rgba(27, 58, 122, 0.18) 100%);
    color: var(--hydra-light);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--frame-border-strong);
    letter-spacing: 0.5px;
}
.cal-table thead th.cal-th--we {
    color: #ff8993;
}

.cal-cell {
    height: 90px;
    vertical-align: top;
    padding: 4px 4px 4px 5px;
    border-right: 1px solid rgba(74, 119, 212, 0.08);
    border-bottom: 1px solid rgba(74, 119, 212, 0.08);
    background: rgba(5, 16, 42, 0.35);
    overflow: hidden;
    position: relative;
}
.cal-cell:last-child { border-right: none; }

.cal-cell--out {
    background: rgba(5, 16, 42, 0.55);
    opacity: 0.55;
}
.cal-cell--today {
    background: rgba(74, 119, 212, 0.08);
    box-shadow: inset 0 0 0 1px rgba(74, 119, 212, 0.35);
}

.cal-day-num {
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 4px;
    padding: 0 2px;
}
.cal-cell--we .cal-day-num { color: #ff8993; }
.cal-cell--out .cal-day-num { color: var(--text-muted); }
.cal-cell--today .cal-day-num { color: var(--hydra-glow); }

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-event {
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    cursor: help;
}
.cal-save-mark {
    color: #fff;
    font-size: 7px;
    margin-right: 2px;
    vertical-align: 2px;
}

.cal-footnote {
    margin: 10px 16px 14px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-style: italic;
}

/* Legenda */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    font-size: 13px;
    color: var(--text-primary);
}
.cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.cal-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Admin: bolinha de tipo */
.admin-event-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Popup de descriÃ§Ã£o dos eventos (hover no dia) â€” estilo pergaminho.
   Posicionado via JS como position:fixed, anexado ao <body>, para escapar
   do overflow do calendÃ¡rio e do backdrop-filter do content-frame. */
.cal-cell { position: relative; }
.cal-pop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9000;
  width: 300px;
  max-width: 80vw;
  padding: 14px 16px;
  background: linear-gradient(180deg, #efe7d3 0%, #e6dcc2 100%);
  border: 1px solid #c9b896;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
  text-align: left;
  pointer-events: none;
}
.cal-pop.is-open { display: block; }
.cal-pop-item + .cal-pop-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(120,95,55,0.25); }
.cal-pop-title {
  font-weight: 800;
  color: #9a6a2c;
  font-size: 13.5px;
  margin-bottom: 3px;
}
.cal-pop-title::after { content: ":"; }
.cal-pop-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: #4a3f2c;
}
