@charset 'utf-8';

/* ============================================================
   Wow Logbook Portal — Z.ai Theme (Light + Dark)
   ============================================================ */

:root,
.theme-zai-light {
    --color-background:        #f8f8f8;
    --color-background-alt:    #ececee;
    --color-brand:             #000000;
    --color-accent:            #ebf4ff;
    --color-header:            #ffffff;
    --color-panel:             #ffffff;
    --color-sidebar:           #f0f0f0;
    --color-surface:           rgba(13, 13, 13, 0.03);
    --color-surface-hover:     rgba(13, 13, 13, 0.05);
    --color-card:              #ffffff;
    --color-card-border:       rgba(13, 13, 13, 0.1);
    --color-popover:           #ffffff;
    --color-input:             #ffffff;
    --color-input-border:      rgba(13, 13, 13, 0.1);
    --color-input-border-hover:rgba(13, 13, 13, 0.15);

    --color-foreground:        #262626;
    --color-foreground-subtle: rgba(38, 38, 38, 0.6);
    --color-foreground-subtlest:rgba(38, 38, 38, 0.4);
    --color-foreground-inverse:#ffffff;

    --color-border:            rgba(13, 13, 13, 0.1);
    --color-border-hover:      rgba(13, 13, 13, 0.15);
    --color-hover:             rgba(13, 13, 13, 0.05);

    --color-success:           #1e8a3e;
    --color-success-surface:   #eaf7ee;
    --color-destructive:       #e03131;
    --color-destructive-surface:#fdeaea;
    --color-warning:           #e07b00;
    --color-warning-surface:   #fdf3e6;

    --color-accent-blue:       #0b7fff;
    --color-accent-blue-soft:  #ebf4ff;
    --color-accent-blue-dark:  #0066dd;

    --chart-1: #0b7fff;
    --chart-2: #1e8a3e;
    --chart-3: #9e77ed;
    --chart-4: #e03131;
    --chart-5: #e07b00;
    --chart-6: #0aa7a7;

    --shadow-sm: 0 1px 2px rgba(13, 13, 13, 0.04), 0 1px 3px rgba(13, 13, 13, 0.06);
    --shadow-md: 0 4px 8px rgba(13, 13, 13, 0.04), 0 8px 24px rgba(13, 13, 13, 0.06);
}

.theme-zai-dark {
    --color-background:        #161616;
    --color-background-alt:    #2b2b2b;
    --color-brand:             #ffffff;
    --color-accent:            #001d3d;
    --color-header:            #202020;
    --color-panel:             #202020;
    --color-sidebar:           #161616;
    --color-surface:           rgba(255, 255, 255, 0.05);
    --color-surface-hover:     rgba(255, 255, 255, 0.1);
    --color-card:              #2b2b2b;
    --color-card-border:       rgba(255, 255, 255, 0.1);
    --color-popover:           #2b2b2b;
    --color-input:             #2b2b2b;
    --color-input-border:      rgba(255, 255, 255, 0.1);
    --color-input-border-hover:rgba(255, 255, 255, 0.15);

    --color-foreground:        #d4d4d4;
    --color-foreground-subtle: rgba(212, 212, 212, 0.6);
    --color-foreground-subtlest:rgba(212, 212, 212, 0.3);
    --color-foreground-inverse:#000000;

    --color-border:            rgba(255, 255, 255, 0.1);
    --color-border-hover:      rgba(255, 255, 255, 0.15);
    --color-hover:             rgba(255, 255, 255, 0.05);

    --color-success:           #46bf72;
    --color-success-surface:   rgba(70, 191, 114, 0.16);
    --color-destructive:       #ff5c5c;
    --color-destructive-surface:rgba(255, 92, 92, 0.16);
    --color-warning:           #ff8a30;
    --color-warning-surface:   rgba(255, 138, 48, 0.16);

    --color-accent-blue:       #4099ff;
    --color-accent-blue-soft:  #001d3d;
    --color-accent-blue-dark:  #80beff;

    --chart-1: #4099ff;
    --chart-2: #46bf72;
    --chart-3: #7b5ce5;
    --chart-4: #ff5c5c;
    --chart-5: #ff8a30;
    --chart-6: #42c8c8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-foreground);
    font-family:
        ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-foreground);
}

p { margin: 0 0 0.75rem; }

a { color: var(--color-accent-blue); text-decoration: none; }
a:hover { color: var(--color-accent-blue-dark); }

code, pre, .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
                 "Liberation Mono", "Courier New", monospace;
}

/* ============================================================
   Layout shell
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.sidebar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-brand);
    color: var(--color-foreground-inverse);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.02em;
}

.sidebar__brand-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-foreground);
    line-height: 1.2;
}

.sidebar__brand-tag {
    font-size: 11px;
    color: var(--color-foreground-subtle);
    font-weight: 500;
}

.sidebar__section {
    margin-top: 14px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-foreground-subtlest);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--color-foreground);
    font-weight: 500;
    transition: background 0.12s, color 0.12s;
}
.nav-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-foreground);
    text-decoration: none;
}
.nav-item--active {
    background: var(--color-surface);
    color: var(--color-foreground);
    font-weight: 600;
}
.nav-item--active svg { color: var(--color-accent-blue); }

.nav-item__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--color-foreground-subtle);
}
.nav-item--active .nav-item__icon { color: var(--color-accent-blue); }

.sidebar__footer {
    margin-top: auto;
    padding: 10px;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar__avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--color-accent-blue-soft);
    color: var(--color-accent-blue-dark);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
}

.sidebar__user-name { font-size: 13px; font-weight: 600; }
.sidebar__user-email { font-size: 11px; color: var(--color-foreground-subtle); }

/* ============================================================
   Main column
   ============================================================ */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 56px;
    background: var(--color-header);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__title { font-size: 15px; font-weight: 600; }
.topbar__subtitle { font-size: 12px; color: var(--color-foreground-subtle); }

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar__hamburger {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-foreground);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s;
}
.topbar__hamburger:hover { background: var(--color-surface-hover); }

.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-foreground-subtle);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.theme-toggle:hover { background: var(--color-surface-hover); color: var(--color-foreground); }

.content {
    padding: 24px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.card--pad { padding: 20px; }
.card--pad-lg { padding: 24px; }

.card__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card__title { font-size: 14px; font-weight: 600; }
.card__subtitle { font-size: 12px; color: var(--color-foreground-subtle); margin-top: 2px; }

.card__body { padding: 20px; min-width: 0; }
.card__body--tight { padding: 12px 20px; min-width: 0; }

.card__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 0 0 12px 12px;
}

/* ============================================================
   KPI tiles
   ============================================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}
.kpi:hover { box-shadow: var(--shadow-md); }

.kpi__label {
    font-size: 12px;
    color: var(--color-foreground-subtle);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi__value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-foreground);
    line-height: 1.1;
}

.kpi__delta {
    font-size: 12px;
    color: var(--color-foreground-subtle);
    margin-top: 6px;
}

.kpi__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--color-accent-blue-soft);
    color: var(--color-accent-blue);
}

.kpi__icon--success { background: var(--color-success-surface); color: var(--color-success); }
.kpi__icon--warning { background: var(--color-warning-surface); color: var(--color-warning); }

/* ============================================================
   Generic grid helpers
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; max-width: 100%; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--sidebar { grid-template-columns: 2fr 1fr; }

/* ============================================================
   Table scroll utilities
   ============================================================ */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    max-width: 100%;
}
.table-scroll--limited {
    max-height: 520px;
    overflow-y: auto;
}
.table-scroll--limited .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--color-header);
    box-shadow: inset 0 -1px 0 var(--color-border);
}
.theme-zai-dark .table-scroll--limited .table thead th {
    background: var(--color-header);
}

/* ============================================================
   Filter bar
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.filter-bar__info { min-width: 0; flex: 1 1 240px; }
.filter-bar__form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1 1 320px;
    justify-content: flex-end;
}
.filter-bar__form .select {
    min-width: 220px;
    max-width: 100%;
    flex: 0 1 280px;
}

/* ============================================================
   Forms
   ============================================================ */
.field { margin-bottom: 24px; }
.field__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-foreground);
}
.field__hint {
    font-size: 12px;
    color: var(--color-foreground-subtle);
    margin-bottom: 10px;
}
.field__required { color: var(--color-destructive); margin-left: 2px; }

.input, .select, .textarea {
    width: 100%;
    background: var(--color-input);
    border: 1px solid var(--color-input-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    color: var(--color-foreground);
    font-family: inherit;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 0 3px rgba(11, 127, 255, 0.15);
}
.textarea { resize: vertical; min-height: 96px; }

.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-group--vertical { flex-direction: column; }

.radio-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--color-input-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    background: var(--color-input);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-foreground);
    min-width: 0;
}
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:hover { background: var(--color-surface-hover); }
.radio-card:has(input:checked) {
    border-color: var(--color-accent-blue);
    background: var(--color-accent-blue-soft);
    color: var(--color-accent-blue-dark);
}

.rating-row { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-pill {
    position: relative;
    width: 44px; height: 44px;
    border: 1px solid var(--color-input-border);
    background: var(--color-input);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.rating-pill input { position: absolute; opacity: 0; pointer-events: none; }
.rating-pill:hover { background: var(--color-surface-hover); }
.rating-pill:has(input:checked) {
    background: var(--color-brand);
    color: var(--color-foreground-inverse);
    border-color: var(--color-brand);
}
.rating-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--color-foreground-subtle); margin-top: 6px; }

.nps-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.nps-pill {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--color-input-border);
    background: var(--color-input);
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.12s, border-color 0.12s;
}
.nps-pill input { position: absolute; opacity: 0; pointer-events: none; }
.nps-pill:hover { background: var(--color-surface-hover); }
.nps-pill:has(input:checked) {
    background: var(--color-brand);
    color: var(--color-foreground-inverse);
    border-color: var(--color-brand);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    font-family: inherit;
    text-decoration: none;
}
.btn--primary {
    background: var(--color-brand);
    color: var(--color-foreground-inverse);
}
.btn--primary:hover { background: var(--color-brand); opacity: 0.88; color: var(--color-foreground-inverse); }
.btn--secondary {
    background: var(--color-input);
    color: var(--color-foreground);
    border-color: var(--color-border);
}
.btn--secondary:hover { background: var(--color-surface-hover); color: var(--color-foreground); }
.btn--ghost {
    background: transparent;
    color: var(--color-foreground);
    border-color: transparent;
}
.btn--ghost:hover { background: var(--color-surface-hover); color: var(--color-foreground); }
.btn--sm { padding: 5px 10px; font-size: 12px; }
.btn--lg { padding: 11px 22px; font-size: 15px; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: var(--color-surface);
    color: var(--color-foreground-subtle);
    border: 1px solid var(--color-border);
}
.badge--success { background: var(--color-success-surface); color: var(--color-success); border-color: transparent; }
.badge--warning { background: var(--color-warning-surface); color: var(--color-warning); border-color: transparent; }
.badge--destructive { background: var(--color-destructive-surface); color: var(--color-destructive); border-color: transparent; }
.badge--accent { background: var(--color-accent-blue-soft); color: var(--color-accent-blue-dark); border-color: transparent; }

/* ============================================================
   Tables
   ============================================================ */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.table th, .table td {
    text-align: left;
    padding: 11px 16px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
.table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-foreground-subtle);
    font-weight: 600;
    background: var(--color-surface);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-surface); }

/* ============================================================
   Bar / progress visualisation
   ============================================================ */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 60px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}
.bar-row__label { color: var(--color-foreground); }
.bar-row__track {
    height: 8px;
    background: var(--color-surface);
    border-radius: 999px;
    overflow: hidden;
}
.bar-row__fill {
    height: 100%;
    background: var(--color-accent-blue);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.bar-row__fill--success { background: var(--color-success); }
.bar-row__fill--warning { background: var(--color-warning); }
.bar-row__fill--destructive { background: var(--color-destructive); }
.bar-row__value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--color-foreground-subtle);
    font-size: 12px;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert--success { background: var(--color-success-surface); color: var(--color-success); }
.alert--error   { background: var(--color-destructive-surface); color: var(--color-destructive); }
.alert--info    { background: var(--color-accent-blue-soft); color: var(--color-accent-blue-dark); }

/* ============================================================
   Empty state
   ============================================================ */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-foreground-subtle);
}
.empty__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 4px;
}
.empty__icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    color: var(--color-foreground-subtlest);
}

/* ============================================================
   Public form (feedback)
   ============================================================ */
.public-shell {
    min-height: 100vh;
    background: var(--color-background);
    padding: 40px 20px;
}
.public-container {
    max-width: 720px;
    margin: 0 auto;
}
.public-header {
    text-align: center;
    margin-bottom: 24px;
}
.public-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.public-header__brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--color-brand);
    color: var(--color-foreground-inverse);
    display: grid;
    place-items: center;
    font-weight: 700;
}
.public-header__brand-name { font-size: 17px; font-weight: 600; }
.public-header__title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.public-header__subtitle { font-size: 14px; color: var(--color-foreground-subtle); }

.question-card { margin-bottom: 16px; }
.question-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--color-accent-blue-soft);
    color: var(--color-accent-blue-dark);
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    vertical-align: middle;
}

.public-header__logo {
    height: 80px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

/* ============================================================
   Helpers
   ============================================================ */
.text-subtle { color: var(--color-foreground-subtle); }
.text-subtlest { color: var(--color-foreground-subtlest); }
.text-success { color: var(--color-success); }
.text-destructive { color: var(--color-destructive); }
.text-warning { color: var(--color-warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.no-underline { text-decoration: none; }

.divider {
    height: 1px;
    background: var(--color-border);
    margin: 16px 0;
}

/* ============================================================
   Feedback page — faded banner background
   ============================================================ */
.feedback-page {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
    overflow: hidden;
}

.feedback-page__bg {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 40px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.10;
    filter: saturate(0.6);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
            mask-image: radial-gradient(ellipse at center, #000 35%, transparent 85%);
}

.feedback-page__bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.feedback-page__inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    z-index: 1;
}

.theme-zai-dark .feedback-page__bg {
    opacity: 0.08;
    filter: saturate(0.5) brightness(1.2);
}

/* ============================================================
   Responsive breakpoints
   ============================================================ */

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 85vw;
        z-index: 60;
        display: flex;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-md);
        visibility: hidden;
    }
    .sidebar.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(2px);
        z-index: 55;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    .sidebar-backdrop.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar__hamburger { display: inline-flex; }
    .topbar { padding: 0 16px; }
    .content { padding: 16px; }

    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .grid--sidebar { grid-template-columns: 1fr; }
}

/* Small tablet / large phone (≤ 768px) */
@media (max-width: 768px) {
    .grid--3 { grid-template-columns: 1fr; }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .kpi { padding: 14px 16px; }
    .kpi__value { font-size: 24px; }
    .topbar__subtitle { display: none; }
}

/* Phone (≤ 640px) */
@media (max-width: 640px) {
    /* Grid + card density */
    .grid--2, .grid--3, .grid--4, .grid--sidebar { grid-template-columns: 1fr; }
    .kpi-grid { grid-template-columns: 1fr; }
    .content { padding: 12px; }
    .topbar { padding: 0 12px; height: 52px; }
    .topbar__title { font-size: 14px; }

    .card--pad { padding: 14px; }
    .card--pad-lg { padding: 16px; }
    .card__header { padding: 12px 14px; flex-wrap: wrap; }
    .card__body { padding: 14px; }
    .card__body--tight { padding: 8px 14px; }

    .kpi__value { font-size: 22px; }
    .kpi__label { font-size: 11px; }

    /* Bar rows stack */
    .bar-row { grid-template-columns: 1fr; gap: 4px; }
    .bar-row__value { text-align: left; font-size: 11px; }

    /* Form controls stack */
    .radio-group { flex-direction: column; align-items: stretch; }
    .radio-card { width: 100%; justify-content: flex-start; }
    .nps-scale { grid-template-columns: repeat(5, 1fr); }
    .rating-row { flex-wrap: wrap; }

    /* Public form */
    .public-header__title { font-size: 22px; }
    .public-shell { padding: 20px 12px; }

    /* ----- Compact filter card on mobile ----- */
    .card--pad.mb-6 {
        padding: 10px 12px;
        margin-bottom: 14px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .filter-bar__info > div:first-child {
        font-size: 12px;
        margin-bottom: 1px;
    }

    .filter-bar__info > div:last-child {
        font-size: 11px;
        line-height: 1.25;
    }

    .filter-bar__form {
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
    }

    .filter-bar__form .select {
        flex: 1 1 auto;
        min-width: 0;
        height: 34px;
        font-size: 13px;
        padding: 4px 10px;
    }

    .filter-bar__form .btn {
        flex: 0 0 auto;
        height: 34px;
        padding: 4px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* ----- Mobile scroll: tables + referral list ----- */
    .table-scroll--mobile {
        max-height: 320px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
    }
    .table-scroll--mobile .table {
        min-width: 640px;
    }
    .table-scroll--mobile .table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--color-header);
        box-shadow: inset 0 -1px 0 var(--color-border);
    }
    .theme-zai-dark .table-scroll--mobile .table thead th {
        background: var(--color-header);
    }

    .bar-list-scroll {
        max-height: 320px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 4px;
    }

    .card__body--tight:has(.table-scroll--mobile) {
        padding: 0;
    }

    /* ----- Overflow guards ----- */
    .grid > * {
        min-width: 0;
        max-width: 100%;
    }

    .card {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .table-scroll,
    .table-scroll--mobile {
        min-width: 0;
        max-width: 100%;
    }

    .card__body,
    .card__body--tight {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .card__body > div[style*="position:relative"],
    .card__body > div[style*="position: relative"] {
        width: 100% !important;
        max-width: 100% !important;
    }

    .card__body canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Feedback page background */
    .feedback-page__bg {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 20px;
        opacity: 0.08;
    }
    .feedback-page__inner {
        padding: 24px 12px;
    }
}

/* ============================================================
   Pager — horizontal scroll strip of page pills
   ============================================================ */
.pager-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px;
    max-width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

/* Chrome / Safari / Edge — thin scrollbar */
.pager-strip::-webkit-scrollbar {
    height: 6px;
}
.pager-strip::-webkit-scrollbar-track {
    background: transparent;
}
.pager-strip::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}
.pager-strip::-webkit-scrollbar-thumb:hover {
    background: var(--color-foreground-subtle);
}

/* Hide scrollbar entirely on small screens (swipe still works) */
@media (max-width: 640px) {
    .pager-strip {
        scrollbar-width: none;
    }
    .pager-strip::-webkit-scrollbar {
        display: none;
    }
}

.pager-pill {
    flex: 0 0 auto;
    scroll-snap-align: center;
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-foreground);
    background: var(--color-card);
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.pager-pill:hover {
    background: var(--color-surface-hover);
    color: var(--color-foreground);
}

.pager-pill--active {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff;
    font-weight: 600;
    cursor: default;
    pointer-events: none;
}

/* ============================================================
   Confirm dialog (delete event, etc.)
   ============================================================ */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: confirm-fade-in 0.15s ease-out;
}

.confirm-modal[hidden] { display: none; }

.confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.confirm-modal__dialog {
    position: relative;
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    max-width: 440px;
    width: 100%;
    padding: 22px 22px 18px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px 16px;
    align-items: flex-start;
    animation: confirm-pop-in 0.18s ease-out;
}

.confirm-modal__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    grid-row: 1 / span 2;
}

.confirm-modal__icon--danger {
    background: var(--color-destructive-surface);
    color: var(--color-destructive);
}

.confirm-modal__content {
    min-width: 0;
    grid-column: 2;
}

.confirm-modal__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-foreground);
    margin: 0 0 6px;
}

.confirm-modal__body {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-foreground-subtle);
    margin: 0;
}

.confirm-modal__body strong {
    color: var(--color-foreground);
    font-weight: 600;
}

.confirm-modal__actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

/* Red delete button (btn--danger doesn't exist yet in the theme) */
.btn--danger {
    background: var(--color-destructive);
    color: #ffffff;
    border-color: var(--color-destructive);
}
.btn--danger:hover {
    background: var(--color-destructive);
    opacity: 0.88;
    color: #ffffff;
}

@keyframes confirm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes confirm-pop-in {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Mobile: full-width stack */
@media (max-width: 640px) {
    .confirm-modal__dialog {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    .confirm-modal__icon {
        grid-row: auto;
        width: 40px;
        height: 40px;
    }
    .confirm-modal__content { grid-column: 1; }
    .confirm-modal__actions { flex-direction: column-reverse; }
    .confirm-modal__actions .btn { width: 100%; }
}