/* POS-LESSONS-001 — Lessons Calendar (month view + filters + create/edit modal).
   Self-contained (own class names, no reliance on session-calendar.css's
   .month-grid/.month-cell — that stylesheet's colors are undefined CSS custom
   properties in this app, since office-compat.css (which defines them) is
   never loaded here; those rules are otherwise-unused leftovers). Colors below
   match pos.css's own dark-theme palette (--primary, --border, --dark, --light
   are POS's actual :root tokens). */

#posLessonsCalendar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    overflow-y: auto;
}

.plc-layout {
    display: flex;
    gap: 16px;
    min-height: 0;
}

/* ---- Left filter panel ---- */
.plc-filters {
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px;
    align-self: flex-start;
}
.plc-filters-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.55);
    margin: 8px 0 2px;
}
.plc-filters-title:first-child { margin-top: 0; }
.plc-type-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.plc-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.plc-type-item:hover { background: rgba(255,255,255,0.06); }
.plc-type-item.active { background: var(--primary); color: #fff; }
.plc-type-count { font-size: 11.5px; opacity: 0.75; }
.plc-coach-select {
    width: 100%;
    padding: 7px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: #12121f;
    color: #fff;
    font-size: 13px;
}

/* ---- Main: nav + grid + day detail ---- */
.plc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.plc-nav { display: flex; align-items: center; gap: 8px; }
.plc-nav-btn {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
.plc-nav-btn:hover { background: rgba(255,255,255,0.08); }
.plc-nav-btn-disabled, .plc-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.plc-nav-btn-disabled:hover, .plc-nav-btn:disabled:hover { background: transparent; }
.plc-month-select, .plc-year-select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.18);
    background: #12121f;
    color: #fff;
    font-size: 13px;
}
.plc-today-btn { margin-left: auto; }

.plc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    overflow: hidden;
}
.plc-day-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.55);
    background: #12121f;
}
.plc-cell {
    min-height: 76px;
    padding: 4px;
    background: #181828;
    cursor: pointer;
}
.plc-cell:hover { background: #1f1f34; }
.plc-cell.plc-today { background: #16324f; }
.plc-cell.plc-selected { outline: 2px solid var(--primary); outline-offset: -2px; }
.plc-cell.plc-other-month { opacity: 0.35; }
.plc-cell.plc-past-day { opacity: 0.4; }
.plc-cell.plc-cell-disabled { cursor: default; }
.plc-cell-date { font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.plc-badges { display: flex; flex-wrap: wrap; gap: 3px; }
.plc-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

/* ---- Day detail ---- */
.plc-day-detail {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px;
}
.plc-day-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.plc-day-detail-header h3 { margin: 0; font-size: 14px; }
.plc-day-list { display: flex; flex-direction: column; gap: 6px; }
.plc-day-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
}
.plc-day-row-time { flex: 0 0 72px; font-size: 12.5px; font-weight: 600; }
.plc-day-row-main { flex: 1; min-width: 0; }
.plc-day-row-name { font-size: 13.5px; font-weight: 600; }
.plc-day-row-sub { font-size: 11.5px; color: rgba(255,255,255,0.6); }

.plc-modal-warn {
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.4);
    color: #ffb74d;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12.5px;
    margin: 0 0 10px;
}

/* The shared .pos-sched-confirm-body only styles <input> — extend it to the
   <select> fields this modal also uses (lesson type / lagoon / instructor). */
.pos-sched-confirm-body select {
    padding: 7px 9px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
}

/* ── Light mode (html.rs-light, per shell.css) ─────────────────────────────
   Found via manual browser testing: every rule above hardcodes a dark
   background but leaves TEXT color to inherit from body — which is white in
   dark theme (matches) but flips to #0f172a in light theme (shell.css's
   html.rs-light body.rs-reskin), so the still-dark backgrounds here ended up
   showing dark text on a dark surface. Same palette pos-builder.css already
   uses for its own html.rs-light block. */
html.rs-light .plc-filters { background: #fff; border-color: #e2e8f0; }
html.rs-light .plc-filters-title { color: #64748b; }
html.rs-light .plc-type-item { color: #0f172a; }
html.rs-light .plc-type-item:hover { background: #f1f5f9; }
html.rs-light .plc-coach-select,
html.rs-light .plc-month-select,
html.rs-light .plc-year-select {
    background: #fff; border-color: #cbd5e1; color: #0f172a;
}
html.rs-light .plc-nav-btn { border-color: #cbd5e1; color: #0f172a; }
html.rs-light .plc-nav-btn:hover { background: #f1f5f9; }
html.rs-light .plc-grid { background: #e2e8f0; border-color: #e2e8f0; }
html.rs-light .plc-day-header { background: #f8fafc; color: #64748b; }
html.rs-light .plc-cell { background: #fff; color: #0f172a; }
html.rs-light .plc-cell:hover { background: #f8fafc; }
html.rs-light .plc-cell.plc-today { background: #eff6ff; }
html.rs-light .plc-day-detail { background: #fff; border-color: #e2e8f0; }
html.rs-light .plc-day-detail-header h3 { color: #0f172a; }
html.rs-light .plc-day-row { background: #f8fafc; color: #0f172a; }
html.rs-light .plc-day-row-sub { color: #64748b; }
html.rs-light .plc-modal-warn { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
