/* ═══════════════════════════════════════════════════════════════
   Lumen Homepage — meeting-first, customers on the LEFT
   ═══════════════════════════════════════════════════════════════ */

:root {
    --hp-blue:   #32ADEE;
    --hp-rose:   #D56B7C;
    --hp-purple: #AA6ADA;
}

.hp {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 24px 80px;
    color: var(--text-body);
    font-family: 'Source Sans 3', system-ui, sans-serif;
}
.hp *, .hp *::before, .hp *::after { box-sizing: border-box; }

/* Customers (left) | Meetings + Tasks (right). Stacks below 1100px. */
.hp-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 28px;
}
@media (max-width: 1100px) {
    .hp-grid { grid-template-columns: 1fr; }
}

.hp-section { margin-bottom: 28px; }

/* Heading + optional adjacent affordance (e.g. refresh icon). */
.hp-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}
.hp-section-head .hp-section-h2 { margin: 0; }

/* Hover-revealed refresh icon next to the Meetings heading. Hidden until
   the user hovers anywhere over the section, focuses it via keyboard, or
   the icon itself is in a spinning state. No button chrome — icon only. */
.hp-refresh-icon {
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: var(--text-faint, #8A99A8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s;
    border-radius: 4px;
}
.hp-refresh-icon svg { width: 16px; height: 16px; display: block; }
.hp-refresh-icon:hover { color: var(--green, #62D84E); }
.hp-refresh-icon:focus-visible {
    outline: 2px solid var(--green, #62D84E);
    outline-offset: 2px;
    opacity: 1;
    transform: none;
}
.hp-agenda-section:hover .hp-refresh-icon,
.hp-refresh-icon.is-spinning {
    opacity: 1;
    transform: none;
}
.hp-refresh-icon.is-spinning {
    color: var(--green, #62D84E);
    pointer-events: none;
}
.hp-refresh-icon.is-spinning svg { animation: hp-refresh-spin 0.9s linear infinite; }
@keyframes hp-refresh-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Section heading. Stand-alone link variant (Customers) becomes clickable. */
.hp-section-h2 {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: color 0.15s;
}
a.hp-section-h2 { cursor: pointer; }
a.hp-section-h2:hover { color: var(--green); }

.hp-section-empty {
    color: var(--text-faint);
    font-size: 13px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    text-align: center;
}

/* ── Day tabs ─────────────────────────────────────────────────── */

.hp-daytabs {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 18px;
}
.hp-daytab {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-body);
    border-radius: 8px;
    padding: 8px 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-daytab:hover { background: var(--surface-2); border-color: var(--text-muted); }
.hp-daytab.is-active {
    background: var(--hp-blue);
    border-color: var(--hp-blue);
    color: var(--bg-darkest);
}
.hp-daytab.is-ooo {
    background: var(--hp-purple);
    border-color: var(--hp-purple);
    color: #fff;
}
.hp-daytab.is-ooo.is-active {
    box-shadow: 0 0 0 2px var(--hp-blue) inset;
}
.hp-daytab.is-weekend {
    background: transparent;
    color: var(--border);
}

/* OOO banner shown on OOO days */
.hp-ooo-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(170,106,218,0.12);
    border: 1px solid var(--hp-purple);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}
.hp-ooo-banner-tag {
    background: var(--hp-purple);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 999px;
}

/* ── Meeting rows ─────────────────────────────────────────────── */

.hp-mtg-list { display: flex; flex-direction: column; gap: 6px; }

.hp-mtg {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s;
}
.hp-mtg.is-current { border-color: var(--green); }
.hp-mtg.is-past .hp-mtg-row { opacity: 0.55; }
.hp-mtg.is-suppressed .hp-mtg-row { opacity: 0.6; }
.hp-mtg.is-expanded { border-color: var(--green); }

.hp-mtg-row {
    display: grid;
    grid-template-columns: 100px 156px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}
.hp-mtg-row:hover { background: var(--surface-2); }

.hp-mtg-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--bg-darkest);
    background: var(--text-faint);
    border: none;
    cursor: pointer;
    transition: filter 0.15s;
    min-width: 64px;
}
.hp-mtg-pill:hover { filter: brightness(1.08); }
.hp-pill-now      { background: var(--green); }
.hp-pill-past     { background: #6b8599; color: #f1f5f9; }
.hp-pill-pending  { background: var(--hp-blue); color: #fff; }
.hp-pill-excluded { background: var(--hp-rose); color: #fff; }
.hp-pill-ooo      { background: var(--hp-purple); color: #fff; }
.hp-pill-cancel   { background: #6b7280; color: #fff; }
.hp-pill-reminder { background: #E89B4A; color: #1a1a1a; }
.hp-pill-done     { background: #3d5a47; color: #a8d5b5; }

.hp-mtg-time {
    color: var(--text-body);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hp-mtg-title {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-mtg.is-cancelled .hp-mtg-title { text-decoration: line-through; color: var(--text-muted); }
.hp-pill-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 3px;
}

.hp-mtg-controls {
    display: grid;
    /* Fixed track widths so every row's controls cluster lines up regardless
       of which buttons are present. Each child uses explicit grid-column so
       missing buttons don't shift their neighbours. */
    grid-template-columns: 36px 36px 36px 90px;
    align-items: center;
    gap: 4px;
}
.hp-mtg-controls > [data-action="complete"] { grid-column: 1; justify-self: end; }
.hp-mtg-controls > [data-action="alarm"] { grid-column: 2; justify-self: end; }
.hp-mtg-controls > [data-action="notes"] { grid-column: 3; justify-self: end; }
.hp-mtg-controls > .hp-join-wrap,
.hp-mtg-controls > .hp-join-only { grid-column: 4; justify-self: stretch; }

.hp-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.hp-icon-btn:hover { background: var(--surface-3); color: var(--text-primary); border-color: var(--border); }
.hp-icon-btn.is-on { color: var(--green); }
.hp-icon-btn svg { width: 20px; height: 20px; }

/* Join split-button */
.hp-join {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 34px;
}
.hp-join-main, .hp-join-caret {
    background: var(--green);
    color: var(--bg-darkest);
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hp-join-main { flex: 1; padding: 0; border-radius: 7px 0 0 7px; }
.hp-join-main:only-child { border-radius: 7px; }
.hp-join-caret { width: 22px; flex: 0 0 22px; padding: 0; border-radius: 0 7px 7px 0; border-left: 1px solid rgba(0,0,0,0.20); }
.hp-join-caret svg { width: 12px; height: 12px; }
.hp-join-main:hover, .hp-join-caret:hover { background: var(--green-hover); }
.hp-join-only {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0;
    border-radius: 7px;
    background: var(--green);
    color: var(--bg-darkest);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    width: 100%;
    transition: background 0.15s;
}
.hp-join-only:hover { background: var(--green-hover); }
/* Dropdown is portaled to document.body via JS so the meeting card's
   overflow:hidden doesn't clip it. Positioned with fixed coords. */
.hp-join-menu {
    position: fixed;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 4px 0;
    z-index: 500;
    display: none;
    font-family: 'Source Sans 3', system-ui, sans-serif;
}
.hp-join-menu.open { display: block; }
.hp-join-wrap { display: block; width: 100%; }
.hp-join-menu-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-body);
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    text-decoration: none;
}
.hp-join-menu-item:hover { background: var(--surface-2); color: var(--text-primary); }

/* Expanded body */
.hp-mtg-body {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    background: var(--bg-panel);
    display: none;
    font-size: 13px;
}
.hp-mtg.is-expanded .hp-mtg-body { display: block; }

.hp-mtg-meta-grid {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px 14px;
    margin-bottom: 12px;
}
.hp-mtg-meta-key {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding-top: 2px;
}
.hp-mtg-meta-val { color: var(--text-body); overflow-wrap: anywhere; }

.hp-mtg-notes-block {
    margin-top: 8px;
    border-top: 1px dashed var(--border);
    padding-top: 12px;
}
.hp-mtg-notes-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}
.hp-mtg-notes-textarea {
    width: 100%;
    min-height: 84px;
    background: var(--surface);
    color: var(--text-body);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
.hp-mtg-notes-textarea:focus { border-color: var(--green); }
.hp-mtg-notes-status {
    font-size: 11px;
    color: var(--text-faint);
    margin-top: 4px;
}

.hp-mtg-reminder-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}
.hp-btn-sm {
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-body);
    transition: background 0.12s, border-color 0.12s;
}
.hp-btn-sm:hover { background: var(--surface-2); border-color: var(--text-muted); }
.hp-btn-sm-danger { color: var(--danger, #ff6b6b); border-color: var(--danger, #ff6b6b); }
.hp-btn-sm-danger:hover { background: rgba(255,107,107,0.1); }

/* ── Customers (left rail) ───────────────────────────────────── */

.hp-customers {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 4px;
}
.hp-customers::-webkit-scrollbar { width: 6px; }
.hp-customers::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.hp-customer-btn {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s, transform 0.12s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-customer-btn:hover {
    border-color: var(--green);
    background: var(--surface-2);
    transform: translateX(2px);
}

.hp-rep-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 0 4px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
}
.hp-rep-label:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

@media (max-width: 1100px) {
    .hp-customers { max-height: none; }
}

/* ── Day-tab label sizing (responsive without horizontal scroll) ── */
/* Default: full labels visible.
   Show short labels on tighter screens, single letters when tightest. */
.hp-daytab-full   { display: inline; }
.hp-daytab-short  { display: none; }
.hp-daytab-letter { display: none; }

@media (max-width: 1280px) {
    .hp-daytab-full { display: none; }
    .hp-daytab-short { display: inline; }
}
@media (max-width: 720px) {
    .hp-daytab-short { display: none; }
    .hp-daytab-letter { display: inline; }
}
