/* Brand palette (derived from logo teal) */
:root{
    --brand:#7AC1C7;          /* teal */
    --brand-dark:#5DA5AA;     /* darker teal */
    --brand-deep:#2E7E87;     /* deep accent */
    --brand-soft:#E9F6F7;     /* soft bg */
    --text:#3F5666;
}

/* Auth background */
body.auth-bg{
    background: #f2f7f8;
    min-height:100vh;
}

/* Backend background */
body.backend-bg{
    background: #f5f8fa;
    min-height: 100vh;
    display:flex;
    flex-direction:column;
}

/* Auth container helpers */
.auth-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 16px; }
.brand-logo{ max-width:128px; }

/* Auth card */
.auth-card{ border:1px solid #dce6ea; border-radius:14px; overflow:hidden; box-shadow:0 12px 32px rgba(23,49,58,.08); }
.auth-card .card-header{ background:#fff; color:var(--app-ink); border-bottom:1px solid #e3ebee; font-size:1.05rem; font-weight:700; text-align:center; padding:1.1rem; }
.auth-card .card-body{ background:#fff; }

/* Inputs */
.form-control:focus{ border-color:var(--brand); box-shadow:0 0 0 .25rem rgba(122,193,199,.25); }

/* Make primary auth button more distinct from background */
.btn-brand{
    background: var(--brand-deep);
    color:#fff; 
    border:1px solid var(--brand-deep);
    font-weight:700;
}
.btn-brand:hover{ background: #276b74; color:#fff; }
.btn-brand:active{ background: #276b74; }
.btn-brand:focus{ box-shadow:0 0 0 .25rem rgba(46,126,135,.35);}

/* Shared helper text */
.text-muted-small{ color:#6b7a82 !important; font-size:.875rem; }

/* Shared operation feedback modal */
.operation-feedback-dialog{
    max-width: 420px;
}

.operation-feedback-content{
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(35, 50, 58, .22);
}

.operation-feedback-icon{
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.operation-feedback-icon.is-success{ background: #198754; }
.operation-feedback-icon.is-error{ background: #dc3545; }
.operation-feedback-icon.is-warning{ background: #f6c343; color: #212529; }
.operation-feedback-icon.is-info{ background: var(--brand-deep); }

.operation-feedback-message{
    white-space: pre-line;
    overflow-wrap: anywhere;
}

body.operation-feedback-busy .operation-feedback-content{
    cursor: wait;
}

/* Staff edit page */
.staff-filter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: .75rem 1rem; align-items: end; }
.staff-title-filter .form-label { display: block; }
.staff-title-filter-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 2.4rem; text-align: left; font-weight: 500; }
.staff-title-filter-menu { width: 100%; min-width: 17rem; padding: .5rem; border-color: var(--app-line); box-shadow: 0 .6rem 1.5rem #17313a20; }
.staff-title-filter-options { max-height: 15rem; overflow-y: auto; }
.staff-title-filter-option { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.35rem; padding: .35rem .55rem; border-radius: .4rem; cursor: pointer; }
.staff-title-filter-option:hover, .staff-title-filter-option:has(input:checked) { background: #edf6f7; }
.staff-title-filter-option .form-check-input { flex: none; margin: 0; }
.staff-title-filter-actions { display: flex; justify-content: flex-end; gap: .5rem; padding: .6rem .3rem .15rem; border-top: 1px solid var(--app-line); }

.staff-state-badge,
.staff-role-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 1.65rem;
    padding: .15rem .55rem;
    border: 1px solid transparent;
    border-radius: .4rem;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}
.staff-state-badge .ti,
.staff-role-badge .ti { font-size: 1rem; }
.staff-state-badge.is-active { background: #d9f1ed; border-color: #a8d9cf; color: #155e51; }
.staff-state-badge.is-inactive { background: #e8ecef; border-color: #cbd6dc; color: #3f5666; }
.staff-role-badge.is-admin { background: #3f5666; color: #fff; }
.staff-role-badge.is-regular { background: #f0f4f5; border-color: #dce6ea; color: #536b79; }

.staff-edit-page {
    --staff-ink: var(--app-ink);
    --staff-muted: var(--app-muted);
    --staff-line: var(--app-line);
    width: 100%;
    padding: 0 0 2rem;
    color: var(--staff-ink);
}
.staff-edit-card {
    margin-bottom: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--staff-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(24, 74, 82, .055);
}
.staff-edit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--staff-line);
    background: #f8fcfc;
}
.staff-edit-card-title { display: flex; align-items: center; gap: .75rem; }
.staff-edit-step {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 10px;
    background: #e3f2f3;
    color: var(--brand-deep);
    font-size: .85rem;
    font-weight: 800;
}
.staff-edit-card h2 { margin: 0; font-size: 1.1rem; font-weight: 750; }
.staff-edit-card-header p {
    margin: .25rem 0 0 2.75rem;
    color: var(--staff-muted);
    font-size: .88rem;
}
.staff-edit-card-body { padding: 1.5rem; }
.staff-edit-page .form-label,
.staff-edit-page .staff-edit-legend {
    margin-bottom: .55rem;
    color: var(--staff-ink);
    font-weight: 700;
}
.staff-edit-page .form-control {
    min-height: 44px;
    border-color: #cbdcdf;
    border-radius: 9px;
}
.staff-edit-page .form-text {
    margin-top: .45rem;
    color: var(--staff-muted);
    font-size: .82rem;
}
.staff-edit-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.staff-edit-legend { float: none; width: auto; padding: 0; font-size: 1rem; }
.staff-edit-choice-grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.staff-edit-choice {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    min-height: 42px;
    margin: 0;
    padding: .5rem .75rem;
    border: 1px solid var(--staff-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.staff-edit-choice:hover { border-color: var(--brand); }
.staff-edit-choice:has(input:checked) { border-color: #79b9bf; background: #f0f9f9; }
.staff-edit-choice:focus-within { outline: 3px solid rgba(46, 126, 135, .2); outline-offset: 2px; }
.staff-edit-choice .form-check-input { flex: 0 0 auto; margin: 0; }
.staff-edit-choice-copy { display: block; min-width: 0; }
.staff-edit-choice-name { display: block; line-height: 1.4; font-weight: 650; white-space: nowrap; }
.staff-edit-titles .staff-edit-choice { min-width: 9.5rem; }
.staff-edit-permissions .staff-edit-choice { min-width: 9.75rem; }
.staff-edit-permission-notes { margin-top: .9rem; color: var(--staff-muted); font-size: .83rem; }
.staff-edit-permission-notes summary { width: fit-content; color: var(--brand-deep); font-weight: 700; cursor: pointer; }
.staff-edit-permission-notes dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem .8rem; margin: .7rem 0 0; }
.staff-edit-permission-notes dt { color: var(--staff-ink); }
.staff-edit-permission-notes dd { margin: 0; }
.staff-edit-status {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--staff-line);
    border-radius: 11px;
    background: #f8fcfc;
}
.staff-edit-status .form-check-input { margin-top: .27rem; }
.staff-edit-status .form-check-label { font-weight: 700; }
.staff-edit-status .form-text { margin-top: .2rem; }
.staff-edit-status:has(input:checked) { border-color: #83c4ba; background: #eaf8f5; }
.staff-edit-status:has(input:not(:checked)) { border-color: #cbd6dc; background: #f3f5f6; }
.staff-edit-state-label,
.staff-edit-admin-label { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: .35rem; font-size: .76rem; font-weight: 700; }
.staff-edit-state-label { background: #e8ecef; color: #3f5666; }
.staff-edit-status:has(input:checked) .staff-edit-state-label { background: #ccebe5; color: #155e51; }
.staff-edit-admin-label { background: #e1e9ec; color: #3f5666; }
.staff-edit-admin:has(input:checked) .staff-edit-admin-label { background: #3f5666; color: #fff; }
.staff-edit-state-label .when-on,
.staff-edit-admin-label .when-on { display: none; }
.staff-edit-status:has(input:checked) .when-on,
.staff-edit-admin:has(input:checked) .when-on { display: inline; }
.staff-edit-status:has(input:checked) .when-off,
.staff-edit-admin:has(input:checked) .when-off { display: none; }
.staff-edit-password {
    margin-top: 1.25rem;
    border: 1px solid var(--staff-line);
    border-radius: 11px;
    background: #fbfdfd;
}
.staff-edit-password summary {
    padding: .9rem 1.1rem;
    color: var(--brand-deep);
    font-weight: 700;
    cursor: pointer;
}
.staff-edit-password[open] summary { border-bottom: 1px solid var(--staff-line); }
.staff-edit-password-body { padding: 1rem 1.1rem 1.15rem; }
.staff-edit-password-body .form-control { max-width: 420px; }
.staff-edit-admin {
    padding: 1.1rem 1.2rem;
    border: 1px solid #bfdde0;
    border-radius: 12px;
    background: #eff8f8;
}
.staff-edit-admin:has(input:checked) { border-color: #7ac1c7; background: #e7f5f5; }
.staff-edit-admin .form-check-label { color: var(--staff-ink); font-weight: 750; }
.staff-edit-admin p {
    margin: .4rem 0 0 1.55rem;
    color: #3d6067;
    font-size: .84rem;
    line-height: 1.55;
}
.staff-edit-admin-access {
    margin-top: .7rem !important;
    padding-top: .7rem;
    border-top: 1px solid #cde5e7;
}
.staff-edit-permissions { margin-top: 1.55rem; }
.staff-edit-permissions-intro { margin: 0 0 1rem; color: var(--staff-muted); font-size: .88rem; }
.staff-edit-actions {
    position: sticky;
    z-index: 5;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .7rem;
    margin-top: 1.5rem;
    padding: .85rem 1rem;
    border: 1px solid var(--staff-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -4px 20px rgba(24, 74, 82, .08);
    backdrop-filter: blur(8px);
}
.staff-edit-actions .btn { min-width: 100px; }
@media (max-width: 767.98px) {
    .staff-filter-row { grid-template-columns: minmax(0, 1fr); }
    .staff-title-filter-menu { min-width: min(17rem, calc(100vw - 2rem)); }
    .staff-edit-page { padding-bottom: 2rem; }
    .staff-edit-card-header, .staff-edit-card-body { padding: 1rem; }
    .staff-edit-choice { flex: 1 1 calc(50% - .55rem); }
    .staff-edit-permission-notes dl { grid-template-columns: 1fr; }
    .staff-edit-permission-notes dd { margin-bottom: .45rem; }
    .staff-edit-actions { border-radius: 10px 10px 0 0; }
}
