:root {
    color-scheme: light;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: #f6f4f1; color: #26211f; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ========================= Public survey ========================= */
.salon-survey-page {
    --brand-primary: #9A7654;
    --brand-secondary: #EDE2D8;
    --brand-accent: #C8A17A;
    --page-bg: #F7F3EF;
    --surface: #FFFFFF;
    --text-main: #2D2723;
    --text-muted: #7B716A;
    --button-text: #FFFFFF;
    --button-radius: 18px;
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--brand-secondary) 70%, transparent), transparent 35%),
        radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--brand-accent) 20%, transparent), transparent 32%),
        var(--page-bg);
    color: var(--text-main);
    padding: 28px 16px;
}

.survey-ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
    opacity: .35;
}
.ambient-one { width: 280px; height: 280px; left: -110px; top: 90px; background: var(--brand-secondary); }
.ambient-two { width: 240px; height: 240px; right: -100px; bottom: 70px; background: color-mix(in srgb, var(--brand-accent) 35%, transparent); }

.salon-survey-shell {
    position: relative;
    z-index: 2;
    width: min(100%, 980px);
    margin: 0 auto;
}

.salon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 4px 26px;
}
.salon-brand-area { display: flex; align-items: center; gap: 15px; min-width: 0; }
.salon-logo {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    padding: 8px;
    box-shadow: 0 10px 28px rgba(37, 28, 22, .08);
}
.salon-name { font-size: clamp(1.25rem, 2.6vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
.salon-welcome { color: var(--text-muted); margin-top: 5px; font-size: .94rem; }
.language-switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, transparent);
    box-shadow: 0 8px 24px rgba(37, 28, 22, .05);
}
.language-switch a { padding: 8px 13px; border-radius: 999px; color: var(--text-muted); font-size: .84rem; font-weight: 700; }
.language-switch a.active { background: var(--brand-primary); color: var(--button-text); }

.survey-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto 18px;
    max-width: 650px;
    padding: 0 10px;
}
.survey-progress > i { height: 2px; flex: 1; background: color-mix(in srgb, var(--brand-primary) 18%, transparent); margin-top: 17px; }
.progress-item { display: grid; justify-items: center; gap: 6px; min-width: 68px; color: var(--text-muted); }
.progress-item b {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, transparent);
    transition: .25s ease;
}
.progress-item small { font-size: .72rem; white-space: nowrap; }
.progress-item.active, .progress-item.complete { color: var(--brand-primary); }
.progress-item.active b, .progress-item.complete b { background: var(--brand-primary); color: var(--button-text); border-color: var(--brand-primary); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand-primary) 25%, transparent); }

.salon-survey-form, .survey-complete-card {
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 10%, transparent);
    border-radius: 30px;
    box-shadow: 0 26px 70px rgba(55, 40, 28, .12);
    backdrop-filter: blur(16px);
    overflow: hidden;
}
.survey-step { display: none; padding: clamp(28px, 5vw, 58px); min-height: 520px; animation: stepIn .28s ease; }
.survey-step.active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.step-heading { text-align: center; margin: 0 auto 34px; max-width: 660px; }
.step-kicker { display: inline-block; color: var(--brand-primary); font-weight: 800; font-size: .82rem; letter-spacing: .05em; margin-bottom: 9px; }
.step-heading h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.25; letter-spacing: -.035em; }
.step-heading p { color: var(--text-muted); margin: 12px auto 0; line-height: 1.8; }

.phone-entry {
    width: min(100%, 560px);
    margin: 70px auto 22px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
}
.country-code-box, .survey-input, .survey-select, .survey-textarea {
    border: 1px solid color-mix(in srgb, var(--brand-primary) 24%, transparent);
    background: var(--surface);
    color: var(--text-main);
    border-radius: 16px;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.country-code-box { display: flex; align-items: center; gap: 9px; padding: 0 17px; min-height: 58px; }
.country-flag { font-size: 1.2rem; }
.survey-input, .survey-select { min-height: 58px; padding: 0 18px; width: 100%; }
.survey-input:focus, .survey-select:focus, .survey-textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 13%, transparent); }
.survey-textarea { width: 100%; padding: 16px; resize: vertical; line-height: 1.7; }
.field-block { width: min(100%, 560px); margin: 0 auto 24px; }
.field-block label { display: block; margin-bottom: 8px; font-weight: 700; }

.primary-action, .secondary-action {
    min-height: 54px;
    border-radius: var(--button-radius);
    padding: 0 28px;
    border: 0;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s, box-shadow .18s, opacity .18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.primary-action {
    background: var(--brand-primary);
    color: var(--button-text);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--brand-primary) 28%, transparent);
    margin: 28px auto 0;
    min-width: 190px;
}
.primary-action:hover, .secondary-action:hover { transform: translateY(-2px); }
.primary-action:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.secondary-action { background: var(--brand-secondary); color: var(--text-main); }
.step-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; }
.step-actions .primary-action { margin: 0; }
.compact-action { width: auto; min-width: 160px; }

.employees-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.employee-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 7px;
    padding: 16px 14px 18px;
    border-radius: 22px;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 14%, transparent);
    background: var(--surface);
    cursor: pointer;
    transition: .22s ease;
}
.employee-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand-primary) 45%, transparent); box-shadow: 0 16px 32px rgba(41, 31, 24, .08); }
.employee-card.selected { border-color: var(--brand-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 12%, transparent), 0 16px 32px rgba(41, 31, 24, .09); }
.employee-card input { position: absolute; opacity: 0; pointer-events: none; }
.employee-photo-wrap { width: 100%; aspect-ratio: 1 / 1.05; position: relative; overflow: hidden; border-radius: 17px; background: var(--brand-secondary); }
.employee-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.employee-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; color: var(--brand-primary); font-weight: 800; }
.employee-selected-mark { position: absolute; top: 10px; inset-inline-end: 10px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-primary); color: var(--button-text); opacity: 0; transform: scale(.8); transition: .18s; }
.employee-card.selected .employee-selected-mark { opacity: 1; transform: scale(1); }
.employee-card strong { font-size: 1.05rem; }
.employee-card small { color: var(--text-muted); }
.empty-employees { text-align: center; color: var(--text-muted); background: var(--brand-secondary); border-radius: 18px; padding: 28px; }

.selected-employee-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0 auto 34px;
    padding: 14px 18px;
    width: fit-content;
    border-radius: 999px;
    background: var(--brand-secondary);
}
.selected-employee-avatar { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; background: var(--brand-primary); color: var(--button-text); display: grid; place-items: center; background-size: cover; background-position: center; }
.selected-employee-summary div:last-child { display: grid; gap: 2px; }
.selected-employee-summary small, .selected-employee-summary span { color: var(--text-muted); }
.selected-employee-summary strong { font-size: 1.05rem; }

.question-panel { max-width: 760px; margin: 0 auto 26px; padding: 26px; border-radius: 22px; background: color-mix(in srgb, var(--brand-secondary) 32%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand-primary) 10%, transparent); }
.question-panel h2 { text-align: center; margin: 0 0 24px; font-size: clamp(1.15rem, 2.5vw, 1.55rem); }
.question-panel h2 em { color: #c33; font-style: normal; }
.rating-choice-grid { display: grid; gap: 12px; }
.rating-count-3 { grid-template-columns: repeat(3, 1fr); }
.rating-count-5 { grid-template-columns: repeat(5, 1fr); }
.rating-choice {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 17px;
    border: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent);
    background: var(--surface);
    cursor: pointer;
    transition: .2s;
}
.rating-choice input { position: absolute; opacity: 0; pointer-events: none; }
.rating-choice svg { width: 42px; height: 42px; fill: none; stroke: var(--brand-primary); stroke-width: 1.4; transition: .2s; }
.rating-choice span { color: var(--text-muted); font-weight: 700; }
.rating-choice:hover, .rating-choice.selected { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, var(--brand-primary) 12%, transparent); }
.rating-choice.selected svg { fill: var(--brand-primary); }
.rating-choice.selected span { color: var(--brand-primary); }
.single-choice-list { display: grid; gap: 10px; }
.single-choice-item { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--brand-primary) 15%, transparent); border-radius: 14px; background: var(--surface); cursor: pointer; }
.single-choice-item input { position: absolute; opacity: 0; }
.single-choice-item b { opacity: 0; color: var(--brand-primary); }
.single-choice-item.selected { border-color: var(--brand-primary); }
.single-choice-item.selected b { opacity: 1; }

.survey-alert { margin: 0 auto 14px; max-width: 760px; border: 1px solid #e6a3a3; background: #fff0f0; color: #9d2525; border-radius: 15px; padding: 13px 16px; text-align: center; font-weight: 700; }
.survey-complete-card { min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 24px; }
.complete-icon { width: 86px; height: 86px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-primary); color: var(--button-text); font-size: 2.2rem; box-shadow: 0 16px 30px color-mix(in srgb, var(--brand-primary) 28%, transparent); }
.survey-complete-card h1 { font-size: 2.2rem; margin: 24px 0 8px; }
.survey-complete-card p { max-width: 520px; color: var(--text-muted); line-height: 1.8; margin: 0; }
.survey-footer { text-align: center; color: var(--text-muted); font-size: .72rem; padding: 18px 0 0; }

/* ========================= Admin ========================= */
.admin-body { background: #f4f5f7; color: #1f2937; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; background: #171a21; color: #fff; padding: 24px 18px; display: flex; flex-direction: column; z-index: 30; }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-brand-mark, .login-brand-mark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(145deg,#b49372,#7d5c3e); display: grid; place-items: center; font-weight: 900; color: #fff; }
.admin-brand strong { display: block; font-size: 1rem; }
.admin-brand span { display: block; color: rgba(255,255,255,.55); font-size: .75rem; margin-top: 3px; }
.admin-nav { display: grid; gap: 6px; margin-top: 24px; }
.admin-nav a { padding: 12px 14px; border-radius: 11px; color: rgba(255,255,255,.72); font-weight: 650; transition: .18s; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.09); color: #fff; }
.admin-nav a.active { box-shadow: inset -3px 0 #b49372; }
.admin-logout { margin-top: auto; padding: 12px 14px; border-radius: 11px; background: rgba(239,68,68,.12); color: #fda4a4; text-align: center; }
.admin-main { min-width: 0; }
.admin-header { min-height: 98px; display: flex; align-items: center; gap: 14px; padding: 18px clamp(20px, 4vw, 46px); background: #fff; border-bottom: 1px solid #e6e8ec; }
.admin-header h1 { margin: 0; font-size: 1.65rem; }
.admin-header p { margin: 6px 0 0; color: #7a8291; }
.admin-menu-button { display: none; border: 0; background: #f1f2f4; border-radius: 10px; width: 42px; height: 42px; font-size: 1.25rem; cursor: pointer; }
.admin-content { padding: clamp(20px, 3vw, 38px); }
.admin-panel { background: #fff; border: 1px solid #e6e8ec; border-radius: 18px; box-shadow: 0 8px 28px rgba(24,32,45,.045); padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 1.12rem; }
.panel-heading p { margin: 6px 0 0; color: #848b98; font-size: .88rem; }
.text-link { color: #8f6a49; font-weight: 700; font-size: .9rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid #e6e8ec; border-radius: 17px; padding: 21px; display: grid; gap: 7px; box-shadow: 0 8px 28px rgba(24,32,45,.04); }
.stat-card span { color: #697180; font-size: .88rem; }
.stat-card strong { font-size: 2rem; letter-spacing: -.04em; }
.stat-card small { color: #9aa0ab; }
.admin-two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.top-employees-list { display: grid; gap: 10px; }
.top-employee-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: #f8f8f9; }
.top-employee-row img, .mini-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.mini-avatar { display: grid; place-items: center; background: #e9ddd2; color: #7d5c3e; font-weight: 800; }
.top-employee-info { display: grid; gap: 3px; }
.top-employee-info span, .top-employee-score small { color: #858c98; font-size: .8rem; }
.top-employee-score { text-align: left; display: grid; }
.top-employee-score b { color: #8f6a49; }
.quick-actions-grid { display: grid; gap: 10px; }
.quick-actions-grid a { display: grid; gap: 4px; padding: 14px; border: 1px solid #e8eaed; border-radius: 13px; transition: .18s; }
.quick-actions-grid a:hover { border-color: #b49372; transform: translateY(-1px); }
.quick-actions-grid span { color: #878e9a; font-size: .82rem; }

.admin-alert { border-radius: 13px; padding: 13px 16px; margin-bottom: 18px; font-weight: 650; }
.admin-alert.success { background: #edf9f0; color: #22763a; border: 1px solid #b9e4c3; }
.admin-alert.error { background: #fff0f0; color: #a62e2e; border: 1px solid #edbcbc; }
.admin-split-layout { display: grid; grid-template-columns: minmax(330px,.72fr) minmax(0,1.28fr); gap: 22px; align-items: start; }
.sticky-form-panel { position: sticky; top: 20px; }
.admin-form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 14px; }
.form-row.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.field { display: grid; gap: 7px; }
.field label { font-weight: 700; font-size: .86rem; color: #424a56; }
.field input, .field select, .field textarea, .login-form input {
    width: 100%; border: 1px solid #dcdfe4; border-radius: 11px; background: #fff; color: #20252d; padding: 11px 12px; outline: none; transition: .18s;
}
.field input, .field select { min-height: 44px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus, .login-form input:focus { border-color: #9b7654; box-shadow: 0 0 0 3px rgba(155,118,84,.12); }
.field small { color: #8b929e; font-size: .78rem; }
.check-field { display: flex; align-items: center; gap: 9px; font-weight: 650; color: #4e5663; cursor: pointer; }
.check-field input { width: 18px; height: 18px; accent-color: #8f6a49; }
.form-buttons { display: flex; gap: 10px; margin-top: 4px; }
.admin-primary-button, .admin-secondary-button {
    min-height: 43px; padding: 0 18px; border-radius: 10px; border: 0; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; cursor: pointer;
}
.admin-primary-button { background: #8f6a49; color: #fff; }
.admin-secondary-button { background: #eef0f2; color: #343a43; }
.full-button { width: 100%; margin-top: 8px; }
.file-upload-box { border: 1px dashed #cfd3d8; background: #fafafa; border-radius: 13px; padding: 12px; display: grid; gap: 8px; }
.file-upload-box img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; }
.file-upload-box span { color: #8a919b; font-size: .76rem; }

.employee-admin-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.employee-admin-card { display: grid; grid-template-columns: 76px 1fr; gap: 12px; position: relative; padding: 12px; border: 1px solid #e6e8eb; border-radius: 14px; }
.employee-admin-card.inactive { opacity: .58; background: #fafafa; }
.employee-admin-card > img, .employee-admin-placeholder { width: 76px; height: 86px; border-radius: 11px; object-fit: cover; }
.employee-admin-placeholder { display: grid; place-items: center; background: #eee3d9; color: #8f6a49; font-size: 1.5rem; font-weight: 800; }
.employee-admin-info { display: grid; align-content: start; gap: 4px; padding-inline-end: 60px; }
.employee-admin-info span, .employee-admin-info small { color: #868d98; }
.employee-admin-info small { font-size: .75rem; }
.employee-admin-actions { position: absolute; top: 11px; inset-inline-end: 11px; display: grid; gap: 5px; text-align: center; }
.employee-admin-actions a, .employee-admin-actions button, .question-admin-actions a, .question-admin-actions button { border: 0; background: #f1f2f4; color: #565e69; padding: 6px 8px; border-radius: 8px; font-size: .75rem; cursor: pointer; }
.employee-admin-actions form, .question-admin-actions form { margin: 0; }

.questions-admin-list { display: grid; gap: 12px; }
.question-admin-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: start; padding: 15px; border: 1px solid #e6e8eb; border-radius: 14px; }
.question-admin-card.inactive { opacity: .58; }
.question-order { width: 36px; height: 36px; border-radius: 10px; background: #eee3d9; color: #8f6a49; display: grid; place-items: center; font-weight: 800; }
.question-admin-content h3 { margin: 8px 0 5px; font-size: 1rem; }
.question-admin-content p { margin: 0; color: #8b929d; font-size: .82rem; }
.question-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.question-badges span { background: #f1f2f4; color: #68707b; padding: 4px 7px; border-radius: 999px; font-size: .7rem; }
.question-options-preview { color: #7e8691; font-size: .78rem; margin-top: 8px; }
.question-admin-actions { display: grid; gap: 6px; }

.appearance-layout { display: grid; grid-template-columns: 1fr 1fr .72fr; gap: 20px; align-items: start; }
.color-fields-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.color-fields-grid label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #e3e5e8; border-radius: 11px; font-size: .82rem; font-weight: 650; }
.color-fields-grid input[type="color"] { width: 42px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; }
.appearance-number-row { margin-top: 16px; }
.country-code-field { margin: 14px 0; }
.appearance-preview-wrap { position: sticky; top: 20px; }
.appearance-preview { --brand-primary:#9A7654;--brand-secondary:#EDE2D8;--brand-accent:#C8A17A;--page-bg:#F7F3EF;--surface:#fff;--text-main:#2D2723;--text-muted:#7B716A;--button-text:#fff;--button-radius:18px; min-height: 540px; border-radius: 20px; background: var(--page-bg); padding: 22px; display: grid; place-items: center; border: 1px solid #e3e5e8; }
.preview-card { width: 100%; background: var(--surface); color: var(--text-main); border-radius: 22px; padding: 24px 18px; text-align: center; box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.preview-logo { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 18px; background: var(--brand-secondary); color: var(--brand-primary); font-size: 1.5rem; font-weight: 800; }
.preview-card h3 { margin: 0 0 7px; }
.preview-card p { color: var(--text-muted); font-size: .8rem; line-height: 1.6; }
.preview-phone { border: 1px solid color-mix(in srgb,var(--brand-primary) 22%,transparent); border-radius: 12px; display: flex; gap: 8px; padding: 11px; margin: 22px 0 12px; text-align: right; }
.preview-phone i { color: var(--text-muted); font-style: normal; }
.preview-card button { width: 100%; min-height: 42px; border: 0; border-radius: var(--button-radius); background: var(--brand-primary); color: var(--button-text); font-weight: 800; }
.preview-stars { color: var(--brand-primary); font-size: 1.8rem; margin-top: 18px; letter-spacing: 6px; }

.filters-panel { margin-bottom: 20px; }
.report-filter-form { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)) auto auto; gap: 12px; align-items: end; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 880px; }
.admin-table th, .admin-table td { padding: 12px 10px; border-bottom: 1px solid #eceef1; text-align: start; font-size: .84rem; }
.admin-table th { color: #6d7581; background: #fafafa; font-weight: 800; }
.admin-table tbody tr:hover { background: #fcfcfc; }
.nowrap { white-space: nowrap; }
.comments-cell { max-width: 300px; white-space: normal; line-height: 1.55; }
.admin-empty { padding: 35px 16px; text-align: center; color: #8b929d; background: #fafafa; border-radius: 13px; }

/* Login */
.login-body { min-height: 100vh; background: radial-gradient(circle at 15% 20%, #e9ddd2, transparent 35%), #f5f2ef; }
.login-scene { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%,430px); background: #fff; border-radius: 24px; padding: 34px; box-shadow: 0 30px 70px rgba(50,37,28,.14); text-align: center; }
.login-brand-mark { margin: 0 auto 10px; width: 56px; height: 56px; border-radius: 18px; font-size: 1.3rem; }
.login-brand-name { font-weight: 850; font-size: 1.15rem; }
.login-brand-sub { color: #91877f; font-size: .75rem; margin-top: 2px; }
.login-card h1 { margin: 28px 0 7px; font-size: 1.45rem; }
.login-card > p { color: #858d98; line-height: 1.7; font-size: .88rem; }
.login-form { display: grid; text-align: start; gap: 8px; margin-top: 24px; }
.login-form label { font-weight: 700; font-size: .84rem; margin-top: 5px; }
.login-form button { min-height: 47px; margin-top: 12px; border: 0; border-radius: 12px; background: #8f6a49; color: #fff; font-weight: 800; cursor: pointer; }
.back-to-survey { display: inline-block; color: #8f6a49; font-size: .82rem; margin-top: 18px; }

@media (max-width: 1100px) {
    .appearance-layout { grid-template-columns: 1fr 1fr; }
    .appearance-preview-wrap { grid-column: 1 / -1; position: static; }
    .appearance-preview { min-height: 380px; }
    .preview-card { max-width: 420px; }
    .report-filter-form { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-105%); transition: .22s; box-shadow: 10px 0 30px rgba(0,0,0,.18); }
    [dir="rtl"] .admin-sidebar { inset: 0 0 0 auto; transform: translateX(105%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-menu-button { display: block; }
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .admin-two-column, .admin-split-layout { grid-template-columns: 1fr; }
    .sticky-form-panel { position: static; }
    .employees-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 650px) {
    .salon-survey-page { padding: 14px 10px; }
    .salon-header { align-items: flex-start; padding-bottom: 18px; }
    .salon-logo { width: 54px; height: 54px; border-radius: 16px; }
    .salon-welcome { display: none; }
    .language-switch a { padding: 7px 9px; font-size: .73rem; }
    .survey-progress { margin-bottom: 12px; }
    .progress-item { min-width: 46px; }
    .progress-item small { display: none; }
    .survey-progress > i { margin-top: 15px; }
    .progress-item b { width: 32px; height: 32px; font-size: .82rem; }
    .salon-survey-form, .survey-complete-card { border-radius: 22px; }
    .survey-step { padding: 28px 16px; min-height: 500px; }
    .phone-entry { margin-top: 45px; grid-template-columns: 104px 1fr; }
    .country-code-box { padding: 0 10px; gap: 6px; }
    .employees-grid { gap: 10px; }
    .employee-card { padding: 9px 8px 13px; border-radius: 17px; }
    .employee-photo-wrap { border-radius: 13px; }
    .employee-card strong { font-size: .92rem; }
    .employee-card small { font-size: .72rem; }
    .question-panel { padding: 18px 12px; border-radius: 17px; }
    .rating-choice-grid { gap: 7px; }
    .rating-choice { min-height: 96px; border-radius: 13px; }
    .rating-choice svg { width: 32px; height: 32px; }
    .rating-choice span { font-size: .72rem; }
    .rating-count-5 { grid-template-columns: repeat(3,1fr); }
    .step-actions { align-items: stretch; }
    .step-actions > * { flex: 1; min-width: 0; padding-inline: 12px; }
    .selected-employee-summary { width: 100%; border-radius: 17px; justify-content: flex-start; }

    .admin-header { padding: 16px; min-height: 82px; }
    .admin-header h1 { font-size: 1.25rem; }
    .admin-header p { font-size: .78rem; }
    .admin-content { padding: 14px; }
    .admin-panel { padding: 17px; border-radius: 15px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-card strong { font-size: 1.55rem; }
    .stat-card small { display: none; }
    .form-row.two-columns, .employee-admin-grid, .appearance-layout, .color-fields-grid, .report-filter-form { grid-template-columns: 1fr; }
    .question-admin-card { grid-template-columns: 36px 1fr; }
    .question-admin-actions { grid-column: 2; display: flex; }
    .appearance-preview-wrap { grid-column: auto; }
    .login-card { padding: 28px 20px; }
}

/* ========================= Survey flow refinements ========================= */
.survey-step.step-enter-forward { animation: stepForwardIn .44s cubic-bezier(.2,.8,.2,1); }
.survey-step.step-enter-back { animation: stepBackIn .44s cubic-bezier(.2,.8,.2,1); }
@keyframes stepForwardIn {
    from { opacity: 0; transform: translateX(34px) scale(.985); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes stepBackIn {
    from { opacity: 0; transform: translateX(-34px) scale(.985); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
[dir="rtl"] .survey-step.step-enter-forward { animation-name: stepForwardInRtl; }
[dir="rtl"] .survey-step.step-enter-back { animation-name: stepBackInRtl; }
@keyframes stepForwardInRtl {
    from { opacity: 0; transform: translateX(-34px) scale(.985); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes stepBackInRtl {
    from { opacity: 0; transform: translateX(34px) scale(.985); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.phone-continue-action {
    display: flex;
    width: fit-content;
    margin-inline: auto;
}
.field-message {
    min-height: 22px;
    width: min(100%, 560px);
    margin: -10px auto 4px;
    color: #a62e2e;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
}
.survey-input.input-error, .survey-select.input-error {
    border-color: #d65757;
    box-shadow: 0 0 0 4px rgba(214,87,87,.12);
    animation: fieldShake .3s ease;
}
@keyframes fieldShake {
    0%,100% { transform: translateX(0); }
    30% { transform: translateX(-5px); }
    70% { transform: translateX(5px); }
}

.employees-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 840px);
    margin-inline: auto;
    gap: 22px;
}
.employee-card {
    padding: 0 0 20px;
    gap: 0;
    overflow: hidden;
    border-radius: 25px;
    text-align: center;
}
.employee-photo-wrap {
    width: 100%;
    aspect-ratio: 4 / 5;
    min-height: 300px;
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--brand-secondary) 82%, var(--surface));
}
.employee-photo {
    object-position: center top;
    transition: transform .42s cubic-bezier(.2,.8,.2,1), filter .25s ease;
}
.employee-card:hover .employee-photo { transform: scale(1.025); }
.employee-card-details {
    width: 100%;
    display: grid;
    gap: 5px;
    padding: 16px 16px 0;
}
.employee-card-details strong { font-size: 1.12rem; }
.employee-card-details small { font-size: .86rem; }
.employee-selected-mark {
    width: 34px;
    height: 34px;
    top: 13px;
    inset-inline-end: 13px;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.employee-card-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--surface) 68%, transparent);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}
.employee-card-loading::after {
    content: "";
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--brand-primary) 24%, transparent);
    border-top-color: var(--brand-primary);
    animation: employeeSpinner .75s linear infinite;
}
.employee-card.is-checking .employee-card-loading { opacity: 1; }
.employees-grid.is-checking .employee-card:not(.is-checking) { opacity: .58; pointer-events: none; }
@keyframes employeeSpinner { to { transform: rotate(360deg); } }
.employee-card.selection-rejected { animation: employeeRejected .48s ease; }
@keyframes employeeRejected {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-9px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-5px); }
}

.salon-survey-form.enhanced-flow .employee-manual-next { display: none; }
.salon-survey-form.enhanced-flow .employee-step-actions { justify-content: center; }
.salon-survey-form.auto-service-flow .service-manual-next { display: none; }
.auto-next-note {
    width: fit-content;
    max-width: 100%;
    margin: 4px auto 0;
    padding: 9px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-secondary) 58%, var(--surface));
    color: var(--text-muted);
    font-size: .8rem;
    text-align: center;
}

.rating-choice svg { fill: transparent; }
.rating-choice.filled svg {
    fill: var(--brand-primary);
    stroke: var(--brand-primary);
    filter: drop-shadow(0 5px 8px color-mix(in srgb, var(--brand-primary) 22%, transparent));
    transform: scale(1.06);
}
.rating-choice.selected {
    background: color-mix(in srgb, var(--brand-secondary) 38%, var(--surface));
}
.rating-choice.selected span, .rating-choice.filled span { color: var(--brand-primary); }
.question-panel.question-error {
    border-color: #d65757;
    box-shadow: 0 0 0 4px rgba(214,87,87,.1);
    animation: questionPulse .55s ease;
}
@keyframes questionPulse {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.012); }
}

.survey-toast {
    position: fixed;
    z-index: 1200;
    left: 50%;
    bottom: 26px;
    width: min(calc(100% - 28px), 560px);
    transform: translate(-50%, 22px);
    opacity: 0;
    border-radius: 16px;
    padding: 14px 18px;
    text-align: center;
    font-weight: 750;
    line-height: 1.6;
    box-shadow: 0 18px 46px rgba(34,25,20,.2);
    transition: opacity .22s ease, transform .22s ease;
}
.survey-toast.error { background: #fff3f3; color: #9d2525; border: 1px solid #e9b5b5; }
.survey-toast.success { background: #effaf2; color: #23743b; border: 1px solid #b9e1c3; }
.survey-toast.visible { opacity: 1; transform: translate(-50%, 0); }

.survey-refresh-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}
.survey-refresh-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.refresh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28,22,19,.55);
    backdrop-filter: blur(8px);
}
.refresh-modal-card {
    position: relative;
    width: min(100%, 480px);
    border-radius: 26px;
    padding: 34px 28px;
    background: var(--surface);
    color: var(--text-main);
    text-align: center;
    box-shadow: 0 30px 80px rgba(20,14,11,.28);
    transform: translateY(18px) scale(.97);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.survey-refresh-modal.open .refresh-modal-card { transform: translateY(0) scale(1); }
.refresh-modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-secondary);
    color: var(--brand-primary);
    font-size: 2rem;
    font-weight: 900;
}
.refresh-modal-card h2 { margin: 0 0 10px; font-size: 1.55rem; }
.refresh-modal-card p { margin: 0; color: var(--text-muted); line-height: 1.8; }
.refresh-page-action { display: flex; width: 100%; margin-top: 24px; }

.complete-icon-wrap { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.complete-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--brand-primary) 25%, transparent);
    animation: successRing 1.8s ease-out infinite;
}
.complete-icon { position: relative; z-index: 1; }
@keyframes successRing {
    0% { transform: scale(.72); opacity: .9; }
    100% { transform: scale(1.18); opacity: 0; }
}
.success-reset-message {
    margin-top: 22px;
    color: var(--text-muted);
    font-size: .88rem;
}
.success-reset-message strong { color: var(--brand-primary); font-size: 1.05rem; }
.success-reset-progress {
    width: min(100%, 320px);
    height: 5px;
    margin-top: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
.success-reset-progress i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--brand-primary);
    transform-origin: left center;
    animation: successCountdown 4s linear forwards;
}
[dir="rtl"] .success-reset-progress i { transform-origin: right center; }
@keyframes successCountdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.survey-complete-card .compact-action { display: flex; margin-top: 26px; }

@media (max-width: 650px) {
    .employees-grid { gap: 11px; }
    .employee-card { padding: 0 0 13px; border-radius: 19px; }
    .employee-photo-wrap { min-height: 0; aspect-ratio: 4 / 5; border-radius: 18px 18px 0 0; }
    .employee-card-details { padding: 11px 8px 0; gap: 3px; }
    .employee-card-details strong { font-size: .9rem; }
    .employee-card-details small { font-size: .7rem; }
    .employee-selected-mark { width: 28px; height: 28px; top: 8px; inset-inline-end: 8px; }
    .survey-toast { bottom: 14px; font-size: .86rem; }
    .refresh-modal-card { padding: 28px 20px; border-radius: 22px; }
    .refresh-modal-card h2 { font-size: 1.35rem; }
    .success-reset-message { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .survey-step, .survey-step.step-enter-forward, .survey-step.step-enter-back,
    .employee-card, .employee-photo, .survey-toast, .survey-refresh-modal,
    .refresh-modal-card, .complete-icon-ring, .success-reset-progress i {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================= Refined survey experience v4 ========================= */
/* Keep the main card fully opaque while steps move. This avoids the bright repaint
   flashes caused by animating content over a backdrop-filtered surface. */
.salon-survey-form {
    display: grid;
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.salon-survey-form.is-transitioning {
    overflow: hidden;
    transition: height .34s cubic-bezier(.22, 1, .36, 1);
}
.survey-step {
    grid-area: 1 / 1;
    width: 100%;
    animation: none !important;
}
.survey-step.active,
.survey-step.is-entering,
.survey-step.is-leaving {
    display: block;
}
.survey-step.is-entering {
    z-index: 2;
    pointer-events: none;
}
.survey-step.is-leaving {
    z-index: 1;
    pointer-events: none;
}
.survey-step.enter-forward {
    animation: surveyEnterForward .34s cubic-bezier(.22, 1, .36, 1) both !important;
}
.survey-step.leave-forward {
    animation: surveyLeaveForward .28s cubic-bezier(.4, 0, .2, 1) both !important;
}
.survey-step.enter-back {
    animation: surveyEnterBack .34s cubic-bezier(.22, 1, .36, 1) both !important;
}
.survey-step.leave-back {
    animation: surveyLeaveBack .28s cubic-bezier(.4, 0, .2, 1) both !important;
}
@keyframes surveyEnterForward {
    from { opacity: 0; transform: translateX(26px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes surveyLeaveForward {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-18px); }
}
@keyframes surveyEnterBack {
    from { opacity: 0; transform: translateX(-26px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes surveyLeaveBack {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(18px); }
}
[dir="rtl"] .survey-step.enter-forward {
    animation-name: surveyEnterForwardRtl !important;
}
[dir="rtl"] .survey-step.leave-forward {
    animation-name: surveyLeaveForwardRtl !important;
}
[dir="rtl"] .survey-step.enter-back {
    animation-name: surveyEnterBackRtl !important;
}
[dir="rtl"] .survey-step.leave-back {
    animation-name: surveyLeaveBackRtl !important;
}
@keyframes surveyEnterForwardRtl {
    from { opacity: 0; transform: translateX(-26px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes surveyLeaveForwardRtl {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(18px); }
}
@keyframes surveyEnterBackRtl {
    from { opacity: 0; transform: translateX(26px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes surveyLeaveBackRtl {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-18px); }
}

/* Restore the employee selection cards to their original balanced layout. */
.employees-grid {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.employee-card {
    padding: 16px 14px 18px;
    gap: 7px;
    overflow: visible;
    border-radius: 22px;
    text-align: center;
}
.employee-photo-wrap {
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1.05;
    border-radius: 17px;
}
.employee-photo {
    object-position: center center;
    transition: transform .24s ease;
}
.employee-card:hover .employee-photo {
    transform: scale(1.015);
}
.employee-card-details {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 0;
}
.employee-card-details strong { font-size: 1.05rem; }
.employee-card-details small { font-size: .8rem; }
.employee-selected-mark,
.employee-card-loading {
    display: none !important;
}
.employee-card.is-checking,
.employee-card.selected {
    border-color: var(--brand-primary);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--brand-primary) 12%, transparent);
    transform: translateY(-2px);
}
.employees-grid.is-checking .employee-card:not(.is-checking) {
    opacity: 1;
    pointer-events: none;
}

/* The chosen employee is intentionally prominent on the service-rating screen. */
.selected-employee-summary {
    width: min(100%, 330px);
    display: grid;
    justify-items: center;
    gap: 12px;
    margin: 0 auto 34px;
    padding: 22px 24px 20px;
    border-radius: 26px;
    text-align: center;
    background: color-mix(in srgb, var(--brand-secondary) 72%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--brand-primary) 12%, transparent);
    box-shadow: 0 16px 36px rgba(46, 34, 27, .07);
}
.selected-employee-avatar {
    width: 118px;
    height: 132px;
    border-radius: 23px;
    background-size: cover;
    background-position: center top;
    border: 4px solid var(--surface);
    box-shadow: 0 12px 26px rgba(39, 28, 22, .14);
    font-size: 2rem;
}
.selected-employee-summary > div:last-child {
    display: grid;
    justify-items: center;
    gap: 4px;
}
.selected-employee-summary small {
    color: var(--brand-primary);
    font-size: .76rem;
    font-weight: 750;
}
.selected-employee-summary strong {
    font-size: 1.18rem;
    line-height: 1.35;
}
.selected-employee-summary span {
    color: var(--text-muted);
    font-size: .86rem;
}
.auto-next-note { display: none !important; }

@media (max-width: 900px) {
    .employees-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .employee-card { padding: 10px 9px 13px; border-radius: 18px; }
    .employee-photo-wrap { aspect-ratio: 1 / 1.05; border-radius: 14px; }
    .employee-card-details { padding: 0; }
    .employee-card-details strong { font-size: .9rem; }
    .employee-card-details small { font-size: .7rem; }
    .selected-employee-summary {
        width: min(100%, 290px);
        padding: 18px 18px 17px;
        border-radius: 22px;
        justify-content: center;
    }
    .selected-employee-avatar {
        width: 100px;
        height: 112px;
        border-radius: 20px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .salon-survey-form.is-transitioning { transition: none !important; }
    .survey-step.enter-forward,
    .survey-step.leave-forward,
    .survey-step.enter-back,
    .survey-step.leave-back { animation: none !important; }
}
