/* Gemeinsame Kalenderkomponente */

.portal-date-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.portal-date-wrapper .portal-date-input {
    width: 100%;
    min-width: 0;
    padding-right: 52px;
}

.portal-date-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 19px;
}

.portal-date-button:hover,
.portal-date-button:focus-visible {
    background: #eff6ff;
}

.portal-date-picker {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 36px;
    opacity: 0;
    pointer-events: none;
}


/* Zentraler Datumskalender */
.portal-date-calendar[hidden] { display: none !important; }

.portal-date-calendar {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    width: min(330px, 90vw);
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .16);
    color: #1e293b;
}

.portal-date-calendar-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
}

.portal-date-select {
    min-width: 0;
    flex: 1;
    padding: 7px 4px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: white;
    color: #1e293b;
    font-size: 13px;
}

.portal-date-year { flex: 0 0 76px; width: 76px; }

.portal-date-nav {
    flex: 0 0 29px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    cursor: pointer;
    font-size: 21px;
}

.portal-date-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
    text-align: center;
}

.portal-date-weekdays {
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.portal-date-weekdays span { padding: 7px 0; }

.portal-date-days button {
    min-width: 0;
    height: 35px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #1e293b;
    cursor: pointer;
    font-size: 13px;
}

.portal-date-days button:hover,
.portal-date-days button:focus-visible { background: #dbeafe; }

.portal-date-days button.is-selected {
    background: #245780;
    color: white;
}

.portal-date-days button.is-today:not(.is-selected) {
    outline: 1px solid #245780;
    outline-offset: -2px;
}

.portal-date-calendar-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.portal-date-calendar-footer button {
    border: 0;
    background: transparent;
    color: #245780;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .portal-date-calendar { width: min(310px, 88vw); }
}

/* In beiden Portalen dieselben Dichte-, Fokus- und Touchregeln. */
.portal-date-calendar { box-sizing:border-box; max-width:calc(100vw - 2rem); }
.portal-date-calendar :is(button,select,input) { min-height:var(--ui-control, 2.15rem); }
.portal-date-calendar button:disabled { opacity:.45; cursor:default; }
.portal-date-calendar :is(button,select,input):focus-visible,
.portal-date-button:focus-visible { outline:3px solid var(--primary, #245780); outline-offset:2px; }
@media (pointer:coarse), (max-width:650px) {
 .portal-date-button { width:44px; height:44px; }
 .portal-date-calendar { width:min(350px, calc(100vw - 2rem)); padding:8px; }
 .portal-date-calendar :is(button,select,input) { min-height:44px; }
 .portal-date-nav { flex-basis:36px; }
 .portal-date-days button { height:44px; }
}
