.dialog-checkbox {
    display: none;
}

.bottom-sheet-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
}

.sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

#sheet-content {
    position: relative;
    width: 100%;
    height: 80vh;
    background-color: #ffffff;
    border-top: 0.3vh solid #000000;
    border-top-left-radius: 2vh;
    border-top-right-radius: 2vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -1vh 3vh rgba(0, 0, 0, 0.15);
}

.dialog-checkbox:checked ~ .bottom-sheet-container {
    pointer-events: auto;
    visibility: visible;
}

.dialog-checkbox:checked ~ .bottom-sheet-container .sheet-backdrop {
    opacity: 1;
}

.dialog-checkbox:checked ~ .bottom-sheet-container #sheet-content {
    transform: translateY(0);
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2vh 3vh;
    border-bottom: 0.2vh solid #000000;
}

.sheet-header h2 {
    font-size: 1.3rem;
    font-weight: bold;
}

.close-sheet-btn {
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0.5vh;
}

.sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 3vh;
    font-size: 1rem;
}
/* Card Container Layout */
.profile-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    width: 100%;
}

/* Base Card Style */
.profile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 2.5vh 3vh;
    border-radius: 1.5vh;
    border: 0.2vh solid #e0e0e0;
    background-color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    box-sizing: border-box;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}




/* Selectable Profile Cards */
.select-form-card {
    width: 100%;
    margin: 0;
}

.selectable-card {
    color: #333333;
}

.selectable-card:hover {
    background-color: #f8f9fa;
    border-color: #adadad;
    transform: translateY(-0.2vh);
}

.action-arrow {
    color: #888888;
    font-size: 1.2rem;
}

/* Bottom Actions Separation */
.sheet-utility-actions {
    margin-top: 2vh;
    border-top: 0.1vh solid #eeeeee;
    padding-top: 3vh;
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
}

/* Add Member and Logout Action Cards */
.action-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2vh;
    border-radius: 1.2vh;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.add-member-card {
    border: 2px solid black;
}

.add-member-card:hover {
    background-color: #333333;
}

.logout-form-card {
    width: 100%;
}

.logout-card {
    border: 2px solid black;
}

.logout-card:hover {
    background-color: #fad2cf;
}

/* Fallback Login Styles */
.login-prompt-container {
    text-align: center;
    padding: 4vh 0;
}
.login-btn-card {
    display: inline-block;
    margin-top: 2vh;
    padding: 1.5vh 4vh;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    border-radius: 1vh;
    font-weight: bold;
}
/* --- Overlay & Layout Foundations --- */
.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s;
    z-index: 99999;
}

.sheet-backdrop-closer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default;
}

#sheet-content {
    position: relative;
    width: 100%;
    height: 80vh;
    background: #ffffff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: inherit;
}

/* --- State Open Triggers --- */
.sheet-overlay:target {
    opacity: 1;
    visibility: visible;
}
.sheet-overlay:target #sheet-content {
    transform: translateY(0);
}

/* --- Rigid Component Containers --- */
.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eaeaea;
    flex-shrink: 0;
}

.sheet-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #222222;
}

.close-btn-x {
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    color: #777777;
    padding: 0.25rem;
}

.sheet-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
    margin: 0;
}

/* --- The Isolated Scroll Area --- */
.sheet-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    box-sizing: border-box;
}

.sheet-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #eaeaea;
    background-color: #fafafa;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* --- Form Fields & Dropdown Elements --- */
.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444444;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="search"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cccccc;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #ffffff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #0066cc;
}

/* --- Chip Tags --- */
.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.no-selection-msg {
    color: #888888;
    font-style: italic;
}

.selected-chip {
    display: inline-flex;
    align-items: center;
    background-color: #f0f4f8;
    border: 1px solid #d2e3f7;
    color: #004499;
    padding: 0.25rem 0.6rem;
    border-radius: 16px;
    font-size: 0.85rem;
}

.chip-remove-btn {
    background: none;
    border: none;
    color: #ff4d4d;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    margin-left: 0.4rem;
    padding: 0;
}

/* --- Result Panel UI --- */
.dropdown-results-panel {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 0.75rem;
    background-color: #fafafa;
}

.panel-title {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777777;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f1f1f1;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
}

.result-item {
    border-bottom: 1px solid #f0f0f0;
}
.result-item:last-child {
    border-bottom: none;
}

.no-results-item {
    padding: 0.75rem;
    color: #888888;
    font-size: 0.9rem;
    text-align: center;
}

.checkbox-row-label {
    display: flex !important;
    align-items: center;
    flex-direction: row !important;
    padding: 0.65rem 0.75rem;
    margin: 0 !important;
    cursor: pointer;
    transition: background-color 0.15s;
}

.checkbox-row-label:hover {
    background-color: #eef5fc;
}

.checkbox-row-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.custom-check-text {
    font-size: 0.95rem;
    color: #333333;
}

/* --- Footer Submission Base --- */
.primary-submit-btn {
    width: 100%;
    padding: 0.85rem;
    background-color: #0066cc;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.primary-submit-btn:hover {
    background-color: #0052a3;
}

.error-banner {
    border-left: 4px solid #cc0000;
    background-color: #fff5f5;
    color: #cc0000;
    padding: 0.75rem;
    margin-top: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}
.card-wrapper.htmx-swapping .Card {
  opacity: 0;
  transition: opacity 1s ease-out;
}


#vd-member-results {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}
.result-item {
    padding: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.checkbox-row-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}
