/* Helmi admin week/month calendar */
.hac {
    --hac-border: #E5E7EB;
    --hac-muted: #6B7280;
    --hac-bg: #fff;
    --hac-rail: #F8FAFC;
    background: var(--hac-bg);
    border: 1px solid var(--hac-border);
    border-radius: 16px;
    overflow: hidden;
}
.hac-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--hac-border);
    background: linear-gradient(180deg, #FBFCFD, #F7F8FA);
}
.hac-toolbar-nav { display: flex; align-items: center; gap: 6px; }
.hac-period {
    font-weight: 750;
    font-size: 0.98rem;
    min-width: 160px;
    text-transform: capitalize;
}
.hac-weekno {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 0.75rem;
    font-weight: 700;
}
.hac-views { display: flex; gap: 4px; margin-left: auto; }
.hac-views button,
.hac-toolbar-nav button {
    border: 1px solid var(--hac-border);
    background: #fff;
    border-radius: 9px;
    padding: 7px 11px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #374151;
}
.hac-views button.is-active {
    border-color: var(--primary, #0D7A4F);
    color: var(--primary, #0D7A4F);
    background: color-mix(in srgb, var(--primary, #0D7A4F) 10%, #fff);
}
.hac-body { padding: 10px; }

/* Week grid */
.hac-week {
    display: grid;
    grid-template-columns: 52px repeat(7, minmax(0, 1fr));
    gap: 0;
    min-height: 420px;
    border: 1px solid var(--hac-border);
    border-radius: 12px;
    overflow: hidden;
}
.hac-corner, .hac-dayhead {
    background: var(--hac-rail);
    border-bottom: 1px solid var(--hac-border);
    border-right: 1px solid var(--hac-border);
    padding: 8px 6px;
    text-align: center;
}
.hac-dayhead-dow { font-size: 0.68rem; font-weight: 700; color: var(--hac-muted); text-transform: uppercase; }
.hac-dayhead-num { font-size: 1.05rem; font-weight: 750; line-height: 1.2; }
.hac-dayhead.is-today .hac-dayhead-num {
    display: inline-flex;
    width: 28px; height: 28px;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--primary, #0D7A4F);
    color: #fff;
}
.hac-rail {
    border-right: 1px solid var(--hac-border);
    background: var(--hac-rail);
    position: relative;
}
.hac-rail-label {
    position: absolute;
    left: 0; right: 0;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: #9CA3AF;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.hac-daycol {
    position: relative;
    border-right: 1px solid var(--hac-border);
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--hac-hour-h) - 1px),
            #F1F5F9 calc(var(--hac-hour-h) - 1px),
            #F1F5F9 var(--hac-hour-h)
        );
    min-height: calc(var(--hac-hours) * var(--hac-hour-h));
}
.hac-daycol:last-child { border-right: 0; }
.hac-item {
    position: absolute;
    left: 3px; right: 3px;
    border-radius: 8px;
    padding: 4px 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(15,23,42,.06);
    transition: transform .12s, box-shadow .12s;
    z-index: 1;
}
.hac-cap-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.9);
    box-shadow: 0 0 0 1px rgba(15,23,42,.12);
}
.hac-cap-red { background: #DC2626; }
.hac-cap-yellow { background: #F59E0B; }
.hac-cap-green { background: #16A34A; }
.hac-item.is-selected,
.hac-mpill.is-selected {
    outline: 2px solid #0D7A4F;
    outline-offset: 1px;
    box-shadow: 0 0 0 3px rgba(13, 122, 79, 0.28);
    z-index: 3;
}
.hac-sel-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #065F46;
}
.hac-ctx-menu {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    padding: 6px;
}
.hac-ctx-menu button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #111827;
}
.hac-ctx-menu button:hover { background: #F3F4F6; }
.hac-ctx-menu button.is-danger { color: #B91C1C; }
.hac-ctx-menu button.is-danger:hover { background: #FEF2F2; }
.hac-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,23,42,.12);
    z-index: 2;
}
.hac-item-time {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    opacity: .9;
    font-variant-numeric: tabular-nums;
}
.hac-item-title {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hac-item-sub {
    display: block;
    font-size: 0.62rem;
    opacity: .85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Month */
.hac-month {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.hac-mhead {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hac-muted);
    padding: 4px;
}
.hac-mweekno {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6366F1;
    padding: 2px 4px 0;
}
.hac-mday {
    min-height: 88px;
    border: 1px solid var(--hac-border);
    border-radius: 10px;
    padding: 6px;
    background: #fff;
}
.hac-mday.is-out { opacity: .45; background: #F9FAFB; }
.hac-mday.is-today { border-color: var(--primary, #0D7A4F); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary, #0D7A4F) 35%, transparent); }
.hac-mday-num { font-size: 0.78rem; font-weight: 750; margin-bottom: 4px; }
.hac-mpill {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 6px;
    padding: 3px 5px;
    margin: 0 0 3px;
    font-size: 0.65rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hac-empty {
    color: var(--hac-muted);
    font-size: 0.9rem;
    padding: 24px;
    text-align: center;
}

@media (max-width: 860px) {
    .hac-week { grid-template-columns: 36px repeat(7, minmax(72px, 1fr)); overflow-x: auto; }
    .hac-item-sub { display: none; }
    .hac-mday { min-height: 72px; }
}
