* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Variablen */
    --basis: #205BE7;
    --accent: #25ffc9;
    --text: #464555;
    --white: #F9F8FF;
    --success: #008355;
    --error: #E6002C;
}

html,
body {
    overflow: hidden;
    touch-action: none;
    -ms-touch-action: none;

    /* Verhindern des Überscrollens/Ziehens */
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    position: fixed;
    width: 100%;
    height: 100%;
}

#app {
    height: 100dvh;
    width: 100dvw;

    color: var(--text);
    font-family: "adelphi-pe-variable", sans-serif;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 400;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;

    background-color: var(--white);
}


/* Loader: Beim Start sichtbar. */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;

    color: var(--basis);
}

.loader h1 {
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
    font-size: 3rem;
    margin: 0;
}

.loader small {
    font-size: 1rem;
    margin: 0;
}

/* PART STYLES */
.login {
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#logo {
    max-width: 200px;
    margin-bottom: 2rem;
}

.dashboard {
    width: 100%;
    height: 100%;
    padding: 1rem;
    display: grid;
    grid-template-rows: 1fr 70px;
    overflow: hidden;
}

.dashboard-main {
    overflow-y: auto;
    overflow-x: hidden;
}

.dashboard-menu {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background-color: var(--basis);
    border-radius: 1rem;
    padding: .5rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.dashboard-menu i {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--white);
}

.menu-items {
    display: flex;
    gap: 1rem;
}

.menu-items button {
    width: auto;
}

.forms {
    display: flex;
    gap: 2rem;
}

/* Generelle Styles */
p {
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 400;
    font-size: 1.2rem;
}

button {
    width: 100%;
    padding: .5rem;
    margin-top: 1rem;

    border-radius: 1rem;
    border: none;
    background-color: var(--basis);
    color: var(--white);
    font-family: "adelphi-pe-variable", sans-serif;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

button:hover {
    cursor: pointer;
    background-color: var(--accent);
    color: var(--basis);

    transition: all 1s ease-in-out;
}

input,
select {
    width: 100%;
    padding: .5rem .75rem;
    margin-top: 1rem;

    border-radius: 0.5rem;
    border: 1px solid #d0d0d0;
    background-color: white;
    color: var(--text);
    font-family: "adelphi-pe-variable", sans-serif;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 400;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--basis);
    box-shadow: 0 0 0 2px rgba(32, 91, 231, 0.15);
}

#error {
    color: var(--error);
    margin-top: 1rem;
}

hr {
    border: none;
    height: 2px;
    background-color: var(--basis);
}

.spaceleft {
    margin-left: .5rem;
}

/*Modal*/
#modal {
    border: 2px solid var(--accent);
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    min-height: 80px;
    border-radius: 1rem;
    background-color: var(--white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    justify-content: center;

    display: none;
}

.modal-header h2 {
    margin: 0;
    color: var(--basis);
    font-family: "adelphi-pe-variable", sans-serif;
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
    font-size: 1.5rem;
}

.modal-content p {
    margin: 0;
    color: var(--text);
    font-family: "adelphi-pe-variable", sans-serif;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 400;
    font-size: 1rem;
}

/* ==================== DASHBOARD CARDS ==================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    max-width: 800px;
}

.dashboard-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(32, 91, 231, 0.15);
    border: 2px solid var(--accent);
}

.dashboard-card i {
    font-size: 2.5rem;
    color: var(--basis);
    margin-bottom: 0.5rem;
}

.dashboard-card h3 {
    margin: 0.5rem 0 0.25rem;
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
}

.dashboard-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

/* ==================== NAVIGATION ==================== */
.dashboard-menu i.active {
    color: var(--accent);
}

/* ==================== ADMIN SECTION ==================== */
.admin-section {
    width: 100%;
    max-width: 1000px;
    margin-top: 1rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    margin: 0;
}

.search-bar button {
    margin: 0;
    width: auto;
    padding: 0.5rem 1rem;
}

.form-hint {
    background: #f0f4ff;
    border: 1px solid var(--basis);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--basis);
    font-size: 0.875rem;
    margin: 0.5rem 0 1rem;
}

.form-hint i {
    margin-right: 0.5rem;
}

/* ==================== DATA LIST ==================== */
.data-list {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.list-header {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 120px;
    padding: 1rem;
    background: var(--basis);
    color: white;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

.list-content {
    max-height: 400px;
    overflow-y: auto;
}

.list-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 120px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.list-row:hover {
    background: #f8f8ff;
}

.list-row:last-child {
    border-bottom: none;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #888;
}

.empty-state i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
    display: block;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background-color: var(--basis);
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--text);
}

.btn-secondary:hover {
    background-color: #d0d0d0;
    color: var(--text);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 0.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: var(--text);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--basis);
    color: white;
}

.btn-icon.btn-delete:hover {
    background: var(--error);
}

.btn-icon.btn-public.is-public {
    background: var(--success);
    color: white;
}

.btn-icon.btn-public:not(.is-public) {
    opacity: 0.4;
}

.btn-close {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    border: none;
    cursor: pointer;
}

.btn-close:hover {
    background: #f0f0f0;
    color: var(--text);
}

.org-actions {
    display: flex;
    justify-content: flex-end;
}

/* ==================== FORM OVERLAY ==================== */
.admin-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.admin-form {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.form-header h2 {
    margin: 0;
    color: var(--basis);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

.form-group input,
.form-group select {
    margin: 0;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #888;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-row .flex-1 {
    flex: 1;
}

.form-row .flex-3 {
    flex: 3;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.form-actions button {
    width: auto;
    margin: 0;
}

/* ==================== USER CARD ==================== */
.user-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 500px;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--basis);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 1.5rem;
    color: white;
}

.user-info h2 {
    margin: 0;
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
}

.user-svnr {
    display: block;
    color: #888;
    font-size: 0.9rem;
}

.user-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
    background: #e0e0e0;
    color: var(--text);
    margin-top: 0.25rem;
}

.user-badge.doctor {
    background: var(--accent);
    color: var(--basis);
}

.user-badge.staff {
    background: #ffd700;
    color: #333;
}

.user-details {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
}

.detail-label {
    color: #888;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

.user-actions {
    margin-top: 1.5rem;
}

.user-actions button {
    margin: 0;
}

/* ==================== SERVICE CARDS ==================== */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.service-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.service-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.service-header i {
    font-size: 1.5rem;
    color: var(--basis);
}

.service-header h2 {
    margin: 0.25rem 0 0;
    font-size: 1.1rem;
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
}

.service-subtitle {
    color: #888;
    font-size: 0.8rem;
}

.service-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.status-label {
    color: #888;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

.status-badge.online {
    background: var(--success);
    color: white;
}

.status-badge.maintenance {
    background: #ff9800;
    color: white;
}

.service-actions {
    text-align: center;
}

.btn-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: #e0e0e0;
    color: var(--text);
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    width: auto;
}

.btn-toggle:hover {
    background: #d0d0d0;
    color: var(--text);
}

.btn-toggle.active {
    background: #ff9800;
    color: white;
}

.btn-toggle.active:hover {
    background: #f57c00;
    color: white;
}

.service-info {
    margin-top: 0.5rem;
    text-align: center;
}

.service-info small {
    color: #888;
    font-size: 0.75rem;
}

/* ==================== SETTINGS SECTION ==================== */
.section-divider {
    margin: 1rem 0;
    border: none;
    height: 1px;
    background: #e0e0e0;
}

.settings-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--basis);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.settings-section h2 i {
    font-size: 1rem;
}

.settings-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.setting-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.setting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.setting-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text);
    font-variation-settings: "slnt" 0, "opsz" 18, "wght" 500;
}

.setting-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
}

.setting-badge.open {
    background: var(--success);
    color: white;
}

.setting-badge.restricted {
    background: #ff9800;
    color: white;
}

.setting-badge.closed {
    background: var(--error);
    color: white;
}

.setting-options {
    margin-bottom: 0.5rem;
}

.radio-option {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-option:hover {
    border-color: var(--basis);
    background: #f8f8ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked+.radio-label {
    color: var(--basis);
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: var(--basis);
    background: #f0f4ff;
}

.radio-label {
    font-variation-settings: "slnt" 0, "opsz" 6, "wght" 500;
    font-size: 0.9rem;
    color: var(--text);
}

.radio-option small {
    color: #888;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.setting-card button {
    width: 100%;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {

    .list-header,
    .list-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .list-header span:not(:first-child),
    .list-row span:not(:first-child):not(:last-child) {
        display: none;
    }

    .org-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .dashboard-main {
        overflow-y: auto;
        padding-bottom: 1rem;
    }
}