/* ================================================
   Holispace Booking — Style portalu specjalisty
   ================================================ */

/* ------------------------------------------------
   Logowanie
   ------------------------------------------------ */
.hb-login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.hb-login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.hb-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.hb-login-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
}

.hb-login-header p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.hb-login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.hb-login-field {
    margin-bottom: 16px;
}

.hb-login-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 6px;
}

.hb-login-field input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 15px;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}

.hb-login-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.hb-login-btn {
    width: 100%;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin-top: 8px;
    font-family: inherit;
}

.hb-login-btn:hover { background: #1d4ed8; }

.hb-login-forgot {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.hb-login-forgot a {
    color: #2563eb;
    text-decoration: none;
}

/* ------------------------------------------------
   Portal specjalisty
   ------------------------------------------------ */
.hb-portal {
    max-width: 1000px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1e293b;
}

.hb-portal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.hb-portal__title h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.hb-portal__title p  { margin: 0; color: #64748b; font-size: 14px; }

.hb-portal__logout {
    color: #64748b;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all .2s;
}

.hb-portal__logout:hover { background: #f8fafc; color: #1e293b; }

.hb-portal__notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

.hb-portal__notice--success { background: #dcfce7; color: #166534; }
.hb-portal__notice--error   { background: #fef2f2; color: #dc2626; }

/* Zakładki */
.hb-portal__tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.hb-portal__tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .2s, border-color .2s;
}

.hb-portal__tab:hover { color: #2563eb; }
.hb-portal__tab--active { color: #2563eb; border-bottom-color: #2563eb; }

/* Filtry */
.hb-portal__filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.hb-portal__filter-group { display: flex; flex-direction: column; gap: 4px; }
.hb-portal__filter-group label { font-size: 12px; font-weight: 600; color: #64748b; }
.hb-portal__filter-group select,
.hb-portal__filter-group input {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    background: #fff;
}

/* Lista wizyt */
.hb-portal__appointments { display: flex; flex-direction: column; gap: 12px; }

.hb-portal__appointment {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    gap: 16px;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    transition: box-shadow .2s;
}

.hb-portal__appointment:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.hb-portal__appointment-date {
    text-align: center;
    background: #eff6ff;
    border-radius: 8px;
    padding: 8px 4px;
}

.hb-portal__appointment-day {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.hb-portal__appointment-month {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    margin-top: 2px;
}

.hb-portal__appointment-patient strong { font-size: 15px; }
.hb-portal__appointment-patient span   { color: #64748b; font-size: 13px; }
.hb-portal__appointment-details        { font-size: 13px; color: #64748b; margin-top: 4px; }
.hb-portal__appointment-notes          { font-size: 13px; color: #64748b; margin-top: 4px; font-style: italic; }

.hb-portal__appointment-actions select {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    background: #fff;
}

.hb-portal__empty { text-align: center; color: #64748b; padding: 40px 0; }

/* Formularz umawiania */
.hb-portal__book-form h3 { font-size: 18px; margin-bottom: 24px; }

.hb-portal__book-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

.hb-portal__book-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.hb-portal__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.hb-portal__form-field { margin-bottom: 12px; }
.hb-portal__form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.hb-portal__form-field input,
.hb-portal__form-field select,
.hb-portal__form-field textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color .2s;
}

.hb-portal__form-field input:focus,
.hb-portal__form-field select:focus,
.hb-portal__form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
}

/* Wyszukiwarka pacjenta */
.hb-portal__search-patient {
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
}

.hb-portal__search-patient label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1e293b;
}

.hb-portal__search-wrap { position: relative; }

.hb-portal__search-wrap input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}

.hb-portal__search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.hb-portal__search-result {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}

.hb-portal__search-result:last-child { border-bottom: none; }
.hb-portal__search-result:hover      { background: #eff6ff; }
.hb-portal__search-result strong     { display: block; }
.hb-portal__search-result span       { color: #64748b; font-size: 12px; }

.hb-portal__hint { font-size: 12px; color: #64748b; margin: 8px 0 0; }

/* Sloty */
.hb-portal__slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.hb-portal__slot {
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    background: #fff;
}

.hb-portal__slot:hover        { border-color: #2563eb; background: #eff6ff; color: #2563eb; }
.hb-portal__slot.hb-selected  { border-color: #2563eb; background: #2563eb; color: #fff; }

/* Przyciski */
.hb-portal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1e293b;
    font-family: inherit;
    transition: all .2s;
}

.hb-portal__btn:hover          { background: #f8fafc; }
.hb-portal__btn--primary       { background: #2563eb; color: #fff; border-color: #2563eb; }
.hb-portal__btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.hb-portal__btn--large         { padding: 12px 32px; font-size: 16px; }

/* ================================================
   Kalendarz specjalisty
   ================================================ */
.hb-sp-cal {
    position: relative;
}

/* Toolbar */
.hb-sp-cal__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.hb-sp-cal__nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hb-sp-cal__period {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    min-width: 180px;
    text-align: center;
}

.hb-sp-cal__view-switcher {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
}

/* Przyciski kalendarza */
.hb-sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #1e293b;
    transition: all .15s;
    font-family: inherit;
}

.hb-sp-btn:hover       { background: #f8fafc; border-color: #cbd5e1; }
.hb-sp-btn--icon       { width: 32px; padding: 6px; font-size: 16px; font-weight: 700; }
.hb-sp-btn--view       { border: none; background: transparent; border-radius: 6px; }
.hb-sp-btn--view.hb-sp-btn--active {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    color: #2563eb;
    font-weight: 600;
}

/* Legenda */
.hb-sp-cal__legend {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.hb-sp-cal__legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #1e293b;
}

.hb-sp-cal__legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hb-sp-cal__legend-dot--slot {
    background: #e0f2fe;
    border: 2px solid #7dd3fc;
}

/* Kontener */
.hb-sp-cal__container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
}

.hb-sp-cal__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #64748b;
    font-size: 14px;
}

/* ---- Widok tygodniowy ---- */
.hb-sp-week {
    display: grid;
    grid-template-columns: 55px repeat(7, 1fr);
    overflow-x: auto;
}

.hb-sp-week-header-cell {
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: .04em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.hb-sp-week-header-cell.hb-sp-today-col { color: #2563eb; background: #eff6ff; }

.hb-sp-time-col { border-right: 1px solid #e2e8f0; }

.hb-sp-time-slot {
    height: 60px;
    padding: 3px 6px 0;
    font-size: 10px;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    line-height: 1;
}

.hb-sp-day-col {
    border-right: 1px solid #f1f5f9;
    position: relative;
}

.hb-sp-day-col.hb-sp-today-col { background: #fafbff; }

.hb-sp-day-cell {
    height: 60px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

/* Wizyty w tygodniowym */
.hb-sp-event {
    position: absolute;
    left: 2px;
    right: 2px;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    z-index: 5;
    overflow: hidden;
    transition: opacity .15s, transform .15s;
    line-height: 1.3;
}

.hb-sp-event:hover { opacity: .88; transform: scale(1.02); z-index: 6; }

.hb-sp-event-patient {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hb-sp-event-time {
    display: block;
    font-weight: 400;
    opacity: .85;
    font-size: 10px;
}

/* Wolne sloty w tygodniowym */
.hb-sp-slot-block {
    position: absolute;
    left: 2px;
    right: 2px;
    background: #e0f2fe;
    border: 1px dashed #7dd3fc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #0369a1;
    cursor: pointer;
    z-index: 4;
    transition: background .15s;
    overflow: hidden;
}

.hb-sp-slot-block:hover { background: #bae6fd; border-color: #38bdf8; }

/* ---- Widok miesięczny ---- */
.hb-sp-month { display: grid; grid-template-columns: repeat(7, 1fr); }

.hb-sp-month-header {
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hb-sp-month-day {
    min-height: 90px;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    padding: 5px;
    cursor: pointer;
    transition: background .1s;
    vertical-align: top;
}

.hb-sp-month-day:hover           { background: #f0f9ff; }
.hb-sp-month-day.hb-sp-other-month{ background: #fafafa; }
.hb-sp-month-day.hb-sp-today     { background: #eff6ff; }

.hb-sp-month-day-number {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 3px;
}

.hb-sp-month-day.hb-sp-today .hb-sp-month-day-number { color: #2563eb; }

.hb-sp-month-event {
    display: block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: opacity .15s;
}

.hb-sp-month-event:hover { opacity: .85; }

.hb-sp-month-slot {
    display: block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    color: #0369a1;
    background: #e0f2fe;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    border: 1px dashed #7dd3fc;
    transition: background .15s;
}

.hb-sp-month-slot:hover { background: #bae6fd; }

.hb-sp-month-more { font-size: 10px; color: #64748b; padding: 1px 3px; }

/* ---- Tooltip ---- */
.hb-sp-cal__tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    width: 270px;
    z-index: 9999;
    font-size: 13px;
}

.hb-sp-cal__tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.hb-sp-cal__tooltip-title { font-weight: 700; font-size: 14px; color: #1e293b; }

.hb-sp-cal__tooltip-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
}

.hb-sp-cal__tooltip-body { padding: 12px 16px; }

.hb-sp-cal__tooltip-row {
    display: flex;
    gap: 8px;
    margin-bottom: 7px;
    font-size: 13px;
}

.hb-sp-cal__tooltip-label { color: #64748b; flex-shrink: 0; min-width: 65px; }
.hb-sp-cal__tooltip-value { color: #1e293b; font-weight: 500; }

.hb-sp-cal__tooltip-footer {
    padding: 8px 16px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.hb-sp-cal__tooltip-hint { font-size: 11px; color: #94a3b8; }

/* ---- Modal ---- */
.hb-sp-cal__modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hb-sp-cal__modal {
    background: #fff;
    border-radius: 12px;
    width: 580px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.hb-sp-cal__modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.hb-sp-cal__modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.hb-sp-cal__modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
}

.hb-sp-cal__modal-body { padding: 18px 22px; }

.hb-sp-cal__modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 14px;
}

.hb-sp-cal__modal-slot-info {
    background: #eff6ff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
    margin-bottom: 14px;
}

.hb-sp-cal__modal-section { margin-bottom: 18px; }

.hb-sp-cal__modal-section h4 {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid #f1f5f9;
}

.hb-sp-cal__modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.hb-sp-cal__modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.hb-sp-cal__modal-field label {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.hb-sp-cal__modal-field input,
.hb-sp-cal__modal-field select,
.hb-sp-cal__modal-field textarea {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    transition: border-color .2s;
    width: 100%;
    box-sizing: border-box;
}

.hb-sp-cal__modal-field input:focus,
.hb-sp-cal__modal-field select:focus,
.hb-sp-cal__modal-field textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.hb-sp-cal__modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* Wyszukiwarka w modalu */
.hb-sp-cal__search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.hb-sp-cal__search-wrap input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 14px;
    box-sizing: border-box;
}

.hb-sp-cal__search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 100;
    max-height: 160px;
    overflow-y: auto;
    display: none;
}

.hb-sp-cal__search-result {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .1s;
}

.hb-sp-cal__search-result:last-child { border-bottom: none; }
.hb-sp-cal__search-result:hover      { background: #eff6ff; }
.hb-sp-cal__search-result strong     { display: block; color: #1e293b; }
.hb-sp-cal__search-result span       { color: #64748b; font-size: 12px; }

/* Responsive */
@media ( max-width: 640px ) {
    .hb-portal__appointment {
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto;
    }
    .hb-portal__appointment-status  { grid-column: 2; }
    .hb-portal__appointment-actions { grid-column: 1 / -1; }
    .hb-portal__book-grid           { grid-template-columns: 1fr; }
    .hb-portal__form-row            { grid-template-columns: 1fr; }
    .hb-sp-cal__modal-row           { grid-template-columns: 1fr; }
}