/* =========================================================
   BUTTONS
========================================================= */
.btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 20px;
    min-height: 44px;
    border-radius: 8px;

    font-size: var(--font-sm);
    font-weight: 600;
    line-height: 1;

    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;

    transition: background .15s ease, transform .1s ease, border-color .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary{ background: var(--primary); color: #fff; }
.btn-primary:hover{ background: var(--primary-hover); text-decoration:none; }

.btn-success{ background: var(--success); color:#fff; }
.btn-success:hover{ background: var(--success-hover); text-decoration:none; }

.btn-danger{ background: var(--danger); color:#fff; }
.btn-danger:hover{ background: var(--danger-hover); text-decoration:none; }

.btn-outline{
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #334155;
}
.btn-outline:hover{
    background: #f1f5f9;
    text-decoration:none;
}

/* Ghost-knapper på grå sidebaggrund: hvid fyld så de er synlige.
   btn-outline-danger = nedtonet Slet (rød fylde først ved hover). */
.btn-white{
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #334155;
}
.btn-white:hover{
    background: #f1f5f9;
    text-decoration:none;
}
.btn-outline-danger{
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #b91c1c;
}
.btn-outline-danger:hover{
    background: #fdeaea;
    border-color: #f0b9b9;
    text-decoration:none;
}

/* Tilbage-knap i beskedvisning: hvid fyld + let skygge så den er tydelig
   på den grå sidebaggrund (gennemsigtig btn-outline var næsten usynlig). */
a.message-back-button{
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
a.message-back-button:hover{
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-lg{ padding: 12px 20px; font-size: var(--font-body); }
.btn-full{ width: 100%; }

@media (min-width: 769px){
    .btn-group .btn.btn-full{ width: auto; }
}

.btn-group{
    display:flex;
    gap: 12px;
    align-items:center;
    flex-wrap:wrap;
    margin-top: 8px;
}
.btn-left{ justify-content:flex-start; }
.btn-right{ justify-content:flex-end; }

.admin-list-search{
    display: flex;
    gap: 10px;
    align-items: center;
    width: 400px;
    max-width: 100%;
}
.admin-list-search input[type="text"]{
    flex: 1 1 auto;
}

/* knap i tabel/kompakt */
.btn-sm{
    padding: 8px 12px;
    min-height: 36px;
    font-size: var(--font-sm);
}

.profile-toggle{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}
.profile-toggle summary{
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}
.profile-toggle summary::-webkit-details-marker{
    display: none;
}
.profile-toggle .profile-hours{
    font-weight: 500;
    color: var(--muted);
    font-size: var(--font-sm);
}
.profile-toggle[open] summary{
    margin-bottom: 8px;
}
.profile-toggle .profile-days{
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.profile-toggle .profile-day-badge{
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: var(--font-xs);
    font-weight: 600;
    background: var(--accent-light, #e8f0fe);
    color: var(--accent, #3b6ddb);
}
.profile-days-row{
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.profile-day-check{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: var(--font-sm);
    font-weight: 500;
    user-select: none;
    transition: background 0.15s, border-color 0.15s;
}
.profile-day-check:has(input:checked){
    background: var(--accent-light, #e8f0fe);
    border-color: var(--accent, #3b6ddb);
    color: var(--accent, #3b6ddb);
}
.profile-day-check input{
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}

.profile-avatar-card{
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-wrap{
    width: 88px;
    height: 88px;
    border-radius: 22px;
    border: 1px solid #dbe2f0;
    background: linear-gradient(180deg, #f8fbff, #eef3fb);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 88px;
}

.profile-avatar-image{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar-fallback{
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-2xl);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1e293b;
    text-transform: uppercase;
}

.profile-avatar-meta{
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.profile-avatar-editor{
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: flex-start;
    gap: 16px;
}

.profile-avatar-form{
    width: 100%;
    min-width: 0;
}

.profile-avatar-compact{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
}

.profile-avatar-open-btn{
    min-width: 140px;
}

.profile-avatar-editor .profile-avatar-meta{
    width: 100%;
}

.profile-avatar-meta .profile-avatar-form{
    margin-top: 10px;
}

@media (max-width: 1200px){
    .profile-avatar-card{
        align-items: flex-start;
    }
    .profile-avatar-wrap{
        width: 72px;
        height: 72px;
        border-radius: 18px;
        flex-basis: 72px;
    }
    .profile-avatar-fallback{
        font-size: var(--font-xl);
    }
    .profile-avatar-editor{
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
    }
}

/* "Fjern billede" som tekst-link under avataren (stamdata-sheeten) */
.profile-avatar-remove-link{
    display: block;
    margin: 6px auto 0;
    background: none;
    border: none;
    padding: 2px 4px;
    color: #dc2626;
    font-size: 12.5px;
    text-decoration: underline;
    cursor: pointer;
}

.profile-cropper-modal{
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    /* Over bottom-sheets (4100): beskæringen åbnes fra stamdata-sheeten */
    z-index: 4200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.profile-cropper-modal.is-open{
    display: flex;
}

.profile-cropper-dialog{
    width: min(460px, 100%);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #dbe2f0;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.3);
    padding: 16px;
}

.profile-cropper-title{
    margin: 0;
    font-size: var(--font-lg);
    color: #0f172a;
}

.profile-cropper-subtitle{
    margin: 6px 0 0;
    color: #64748b;
    font-size: var(--font-sm);
}

.profile-cropper-stage{
    margin-top: 12px;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid #dbe2f0;
    background: #0f172a;
    overflow: hidden;
    position: relative;
    touch-action: none;
    user-select: none;
}

.profile-cropper-image{
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: top left;
    will-change: transform;
    pointer-events: none;
    max-width: none;
}

.profile-cropper-frame{
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255,255,255,0.9);
    border-radius: 14px;
    box-shadow: inset 0 0 0 9999px rgba(15, 23, 42, 0.22);
    pointer-events: none;
}

.profile-cropper-controls{
    margin-top: 12px;
}

.profile-cropper-controls label{
    margin-top: 0;
}

.profile-cropper-controls input[type="range"]{
    margin-top: 8px;
}

.profile-cropper-actions{
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.profile-upload-modal{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.62);
    z-index: 3500;
    padding: 16px;
}

.profile-upload-modal.is-open{
    display: flex;
}

.profile-upload-modal[hidden]{
    display: none !important;
}

.profile-upload-dialog{
    width: min(460px, 100%);
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #dbe2f0;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.3);
    padding: 16px;
}

.profile-upload-title{
    margin: 0;
    font-size: var(--font-lg);
    color: #0f172a;
}

.profile-upload-subtitle{
    margin: 6px 0 0;
    color: #64748b;
    font-size: var(--font-sm);
}

@media (max-width: 640px){
    .profile-cropper-dialog{
        padding: 14px;
    }
    .profile-cropper-stage{
        max-width: 100%;
    }
    .profile-cropper-actions .btn{
        flex: 1 1 0;
    }
}

