:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --surface-3: #f2f2f2;
    --border: #e6e6e6;
    --text: #141414;
    --muted: #666666;
    --primary: #ffcc00;
    --primary-strong: #f2b800;
    --primary-soft: rgba(255, 204, 0, 0.16);
    --dark: #0f0f10;
    --dark-2: #1a1a1c;
    --dark-soft: #232326;
    --success: #16794d;
    --success-soft: #ebf8f1;
    --danger: #be2f26;
    --danger-soft: #fff1ef;
    --warning: #946200;
    --warning-soft: #fff8dc;
    --shadow: 0 16px 40px rgba(15, 15, 16, 0.08);
    --shadow-sm: 0 10px 24px rgba(15, 15, 16, 0.06);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.dashboard-topbar {
    background: linear-gradient(135deg, #0f0f10 0%, #1b1b1d 100%);
    padding: 20px;
    border-radius: 20px;
}

.dashboard-topbar .page-meta h2,
.dashboard-topbar .page-meta p {
    color: #ffffff;
}
/* Dark topbar for desktop */
@media (min-width: 1025px) {
    .topbar {
        background: linear-gradient(135deg, #0f0f10 0%, #1b1b1d 100%);
        padding: 20px;
        border-radius: 20px;
    }

    .topbar .page-meta h2,
    .topbar .page-meta p {
        color: #ffffff;
    }
}
body {
    margin: 0;
    min-width: 320px;
    font-family: "Outfit", Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(255, 204, 0, 0.2), transparent 28%),
        linear-gradient(180deg, #151517 0, #151517 170px, var(--bg) 170px);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    background: linear-gradient(180deg, #0d0d0e 0%, #171719 100%);
    color: #f5f5f5;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px 20px;
    margin-bottom: 12px;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #ffe16b 100%);
    display: grid;
    place-items: center;
    color: #0d0d0e;
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 24px rgba(255, 204, 0, 0.24);
}

.brand h1 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.brand p,
.sidebar-note {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 13px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.sidebar-nav a,
.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    transition: 0.2s ease;
    font-weight: 600;
}

.sidebar-nav a {
    color: rgba(255, 255, 255, 0.82);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.22), rgba(255, 204, 0, 0.08));
    color: #fff7d1;
}

.sidebar-footer {
    margin-top: 28px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
}

.main {
    min-width: 0;
    padding: 24px;
}

.topbar,
.section-title,
.question-top,
.topbar-actions,
.inline-actions,
.action-row,
.filter-actions,
.gps-actions,
.auth-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar,
.section-title,
.question-top {
    justify-content: space-between;
}

.topbar { margin-bottom: 24px; }

.page-meta h1,
.page-meta h2 {
    margin: 0 0 8px;
    font-size: clamp(28px, 4vw, 34px);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.page-meta p,
.muted {
    margin: 0;
    color: var(--muted);
}

.panel,
.stat-card,
.auth-card,
.question-card,
.report-card,
.list-card,
.user-card,
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.panel,
.auth-card,
.report-card,
.info-card,
.list-card,
.user-card,
.stat-card,
.question-card {
    padding: 22px;
}

.panel + .panel { margin-top: 22px; }

.hero-panel,
.filter-panel,
.gps-box {
    background:
        linear-gradient(180deg, rgba(255, 204, 0, 0.12), rgba(255, 255, 255, 0) 80px),
        linear-gradient(135deg, #ffffff 0%, #fffdf2 100%);
}

.hero-grid,
.stats-grid,
.grid-2,
.grid-3,
.form-grid,
.cards-grid,
.user-grid,
.meta-grid,
.info-strip {
    display: grid;
    gap: 18px;
}

.hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cards-grid,
.user-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }

.stack,
.stack-lg,
.question-list,
.card-list {
    display: grid;
    gap: 16px;
}

.stack-lg,
.question-list,
.card-list {
    gap: 18px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: auto -18px -28px auto;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--primary-soft);
}

.stat-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    position: relative;
    z-index: 1;
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1;
    color: #111;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(255, 204, 0, 0.38), transparent 26%),
        linear-gradient(135deg, #050505 0%, #1a1a1a 100%);
}

.auth-card {
    width: min(100%, 500px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
    color: #2a2a2a;
}

input,
select,
textarea,
button,
.button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: 14px 16px;
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-strong);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.2);
    background: white;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    border: 0;
    border-radius: 16px;
    padding: 12px 18px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, #ffe16b 100%);
    color: #111;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(255, 204, 0, 0.22);
}

button:hover,
.button:hover {
    transform: translateY(-1px);
}

.button.ghost {
    background: #fff;
    color: #111;
    border: 1px solid var(--border);
    box-shadow: none;
}

.button.soft {
    background: var(--primary-soft);
    color: #6b5200;
    box-shadow: none;
}

.flash,
.alert {
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.flash-success,
.alert-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #b5e7ca;
}

.flash-danger,
.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #ffc8c1;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.badge,
.score-chip,
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.badge,
.tag {
    background: rgba(255, 204, 0, 0.18);
    color: #7a5b00;
}

.score-chip {
    background: #effaf3;
    color: #0f6b40;
}

.score-chip.warning {
    background: #fff6d8;
    color: #8a6100;
}

.info-card {
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.info-card small,
.meta-item small {
    display: block;
    color: var(--muted);
    margin-bottom: 6px;
}

.info-card strong {
    font-size: 19px;
}

.question-card {
    background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
    border-color: #f0ead1;
}

.question-top {
    align-items: stretch;
}

.question-top h4 {
    margin: 0 0 8px;
    font-size: 18px;
}

.question-top p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.points-box {
    min-width: 160px;
    max-width: 180px;
}

.location-status {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    border: 1px solid var(--border);
}

.location-status.pending {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: #f1d58c;
}

.location-status.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #b5e7ca;
}

.location-status.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #ffc8c1;
}

.report-card,
.list-card,
.user-card {
    position: relative;
    overflow: hidden;
}

.report-card::before,
.list-card::before,
.user-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, #111 100%);
}

.report-card-body,
.list-card-body,
.user-card-body {
    display: grid;
    gap: 16px;
}

.meta-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    min-width: 0;
}

.meta-item strong {
    font-size: 15px;
    overflow-wrap: anywhere;
}

.note-box {
    background: #fffef6;
    border: 1px dashed #e2d49f;
    border-radius: 16px;
    padding: 16px;
    color: #3a3a3a;
}

.footer {
    padding: 28px 0 18px;
    color: #666;
    text-align: center;
}

.mobile-topbar {
    display: none;
    margin-bottom: 14px;
    align-items: center;
    justify-content: space-between;
}

.mobile-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.mobile-nav a {
    background: #fff;
    border: 1px solid var(--border);
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.mobile-nav a.active {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.22), rgba(255, 204, 0, 0.1));
    border-color: rgba(255, 204, 0, 0.6);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

thead th {
    background: #fffdf3;
    color: #5b5b5b;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 1280px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid,
    .grid-3,
    .form-grid,
    .meta-grid,
    .info-strip { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main { padding: 18px; }
    .mobile-topbar,
    .mobile-nav { display: grid; }
    .mobile-topbar { grid-template-columns: minmax(0, 1fr) auto; }
    .topbar { align-items: flex-start; }
    .grid-2,
    .cards-grid,
    .user-grid { grid-template-columns: 1fr; }
    .form-type-grid,
    .compact-grid.two-cols,
    .compact-grid.three-cols { grid-template-columns: 1fr; }

    .mobile-nav.mobile-nav-user {
        margin-top: 32px !important;
        margin-bottom: 18px !important;
        grid-template-columns: 1fr;
    }

    .mobile-nav.mobile-nav-user a,
    .mobile-nav.mobile-nav-user a.active,
    .mobile-nav.mobile-nav-user a.user-mobile-primary,
    .mobile-nav.mobile-nav-user a.user-mobile-primary.active {
        background: linear-gradient(135deg, #ffcc00 0%, #ffe16b 100%) !important;
        color: #111 !important;
        border: none !important;
        box-shadow: 0 10px 24px rgba(255, 204, 0, 0.25) !important;
        font-weight: 800 !important;
    }
}

@media (max-width: 768px) {
    body {
        background:
            radial-gradient(circle at top right, rgba(255, 204, 0, 0.22), transparent 34%),
            linear-gradient(180deg, #151517 0, #151517 118px, var(--bg) 118px);
    }

    .main { padding: 14px; }

    .panel,
    .auth-card,
    .report-card,
    .info-card,
    .question-card,
    .list-card,
    .user-card,
    .stat-card {
        padding: 18px;
        border-radius: 20px;
    }

    .page-meta h1,
    .page-meta h2 {
        font-size: 25px;
    }

    .stats-grid,
    .info-strip,
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .question-top,
    .section-title,
    .topbar,
    .topbar-actions,
    .inline-actions,
    .action-row,
    .gps-actions,
    .filter-actions,
    .auth-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .points-box {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .topbar-actions > *,
    .inline-actions > *,
    .action-row > *,
    .gps-actions > *,
    .filter-actions > *,
    .auth-actions > * {
        width: 100%;
    }

    button,
    .button {
        width: 100%;
    }

    .mobile-nav {
        grid-template-columns: 1fr;
    }

    .question-card-mobile {
        align-items: stretch;
    }

    .yes-no-group {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .toggle-pill span {
        width: 100%;
    }

    .qa-item {
        flex-direction: column;
        align-items: stretch;
    }

    .qa-answer-wrap {
        justify-content: flex-start;
    }

    .dashboard-recent-panel {
        margin-top: 18px;
    }

    .admin-reports-filter,
    .admin-reports-summary,
    .admin-reports-details {
        margin-top: 18px;
    }

    .dashboard-topbar {
        margin-bottom: 18px;
    }

    .stats-grid-dashboard {
        margin-bottom: 18px;
    }
}

@media (max-width: 480px) {
    .auth-shell { padding: 14px; }
    .main { padding: 12px; }

    input,
    select,
    textarea,
    button,
    .button {
        font-size: 16px;
    }

    .brand h1 { font-size: 18px; }

    .info-card strong,
    .stat-card strong {
        font-size: 22px;
    }
}

.form-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
    position: relative;
    display: block;
    cursor: pointer;
}

.choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card-body {
    display: grid;
    gap: 8px;
    min-height: 100%;
    padding: 22px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.choice-card small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.choice-meta {
    display: inline-flex;
    width: fit-content;
    margin-top: 4px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 204, 0, 0.16);
    color: #7a5b00;
    font-size: 13px;
    font-weight: 800;
}

.choice-card.selected .choice-card-body,
.choice-card input:checked + .choice-card-body {
    border-color: rgba(255, 204, 0, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.18), var(--shadow);
}

.form-variant {
    display: none;
}

.form-variant.is-active {
    display: grid;
    gap: 18px;
}

.yes-no-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toggle-pill {
    position: relative;
    cursor: pointer;
}

.toggle-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.toggle-pill input:checked + span {
    background: linear-gradient(135deg, var(--primary) 0%, #ffe16b 100%);
    border-color: rgba(255, 204, 0, 0.9);
    color: #111;
}

.score-preview-panel {
    background: linear-gradient(135deg, #0f0f10 0%, #1b1b1d 100%);
    color: #fff;
}

.score-preview-panel .muted,
.score-preview-panel h3,
.score-preview-panel .tag {
    color: inherit;
}

.score-preview-panel .tag {
    background: rgba(255, 255, 255, 0.12);
}

.score-preview-box {
    display: grid;
    gap: 10px;
}

.score-preview-main {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.score-preview-main strong {
    font-size: clamp(42px, 7vw, 56px);
    line-height: 1;
    color: var(--primary);
}

.score-preview-main span {
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
}

.compact-grid {
    gap: 12px;
}

.compact-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-grid.three-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-sections {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.qa-section {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
}

.qa-section-title {
    margin-bottom: 14px;
}

.qa-section-title h4 {
    margin: 0 0 6px;
    font-size: 18px;
}

.qa-list {
    display: grid;
    gap: 12px;
}

.qa-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #fff;
}

.qa-item strong,
.qa-item small {
    display: block;
}

.qa-item small {
    margin-top: 6px;
    color: var(--muted);
}

.qa-item.is-yes {
    border-color: rgba(255, 204, 0, 0.55);
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.16) 0%, #ffffff 100%);
}

.qa-item.is-no {
    background: linear-gradient(135deg, rgba(17, 17, 17, 0.03) 0%, #ffffff 100%);
}

.qa-answer-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.answer-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid var(--border);
}

.answer-badge.yes {
    background: linear-gradient(135deg, var(--primary) 0%, #ffe16b 100%);
    color: #111;
    border-color: rgba(255, 204, 0, 0.9);
}

.answer-badge.no {
    background: #111;
    color: #fff;
    border-color: #111;
}

.qa-note {
    margin-top: 14px;
}

.basic-intro {
    margin-bottom: 14px;
}

.gps-actions-spaced {
    padding-top: 8px;
}

.delete-inline-form {
    display: flex;
    justify-content: flex-end;
}

.button.ghost.danger {
    border-color: #f1c0bb;
    color: var(--danger);
}

.button.ghost.danger:hover {
    background: var(--danger-soft);
}

.admin-reports-stats,
.admin-reports-filter,
.admin-reports-summary,
.admin-reports-details,
.dashboard-recent-panel {
    margin-top: 24px;
}

.admin-reports-stats {
    margin-top: 0;
}

.panel-equal-gap {
    display: grid;
    gap: 18px;
}

.panel-equal-gap > .section-title {
    margin: 0;
}

.stats-grid-dashboard {
    margin-bottom: 24px;
}

.filter-panel .form-grid {
    align-items: flex-end;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 100%;
}

.filter-actions button,
.filter-actions .button {
    min-height: 52px;
}
