:root{
    --bg:#f4f7fb;
    --card:#ffffff;
    --text:#172033;
    --muted:#667085;
    --primary:#1769e0;
    --primary-dark:#0d4fb0;
    --border:#dce3ee;
    --soft:#eef5ff;
    --success:#16a34a;
    --danger:#dc2626;
    --shadow:0 12px 35px rgba(23,32,51,.08);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;font-family:Segoe UI,Arial,sans-serif;background:linear-gradient(135deg,#eef5ff,#f7f9fc);color:var(--text);font-size:16px;line-height:1.5}
button,input,select,textarea{font:inherit}
.app-shell{min-height:100vh;padding:24px 24px 96px}
.topbar{max-width:1180px;margin:0 auto 20px;display:flex;align-items:center;justify-content:space-between;background:rgba(255,255,255,.9);border:1px solid var(--border);border-radius:22px;padding:18px 22px;box-shadow:0 10px 30px rgba(23,32,51,.06);backdrop-filter:blur(10px)}
.eyebrow{margin:0 0 4px;color:var(--primary);font-weight:700;text-transform:uppercase;font-size:12px;letter-spacing:.09em}.topbar h1{margin:0;font-size:28px;line-height:1.15}.status-pill{background:var(--soft);color:var(--primary-dark);padding:10px 14px;border-radius:999px;font-weight:700;border:1px solid #cfe2ff;white-space:nowrap}
.survey-layout{max-width:1180px;margin:0 auto;display:grid;grid-template-columns:300px 1fr;gap:22px}.section-panel,.question-card,.progress-header,.empty-state,.complete-card,.mobile-section-jump{background:var(--card);border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow)}
.section-panel{padding:18px;position:sticky;top:24px;height:max-content}.section-panel h2{font-size:16px;margin:0 0 12px}.section-item{display:flex;gap:12px;align-items:center;padding:12px;border-radius:16px;color:var(--muted);margin-bottom:8px}.section-item span{min-width:28px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#f1f5f9;font-weight:800}.section-item strong{font-size:14px}.section-item.active{background:var(--soft);color:var(--text)}.section-item.active span{background:var(--primary);color:white}
.mobile-section-jump{display:none;padding:12px 14px}.mobile-section-jump label{display:block;font-size:12px;font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px}.mobile-section-jump select{border-radius:14px;background:#fbfdff}
.question-panel{display:flex;flex-direction:column;gap:14px}.progress-header{padding:16px 18px}.progress-header>div:first-child{display:flex;justify-content:space-between;gap:14px;color:var(--muted);font-size:14px;margin-bottom:10px}.progress-header strong{color:var(--primary);white-space:nowrap}.progress-track{height:10px;border-radius:999px;background:#e8eef7;overflow:hidden}.progress-track div{height:100%;background:linear-gradient(90deg,var(--primary),#41a5ff);border-radius:999px;transition:width .25s ease}
.question-card{padding:28px}.section-title{color:var(--primary);font-weight:800;margin:0 0 10px}.question-card h2{font-size:26px;line-height:1.3;margin:0 0 10px}.help-text{color:var(--muted);margin:0 0 22px}.answer-area{margin:24px 0}input[type=text],input[type=number],input[type=date],textarea,select{width:100%;border:1px solid var(--border);border-radius:16px;padding:14px 15px;font-size:16px;background:#fbfdff;outline:none;transition:.2s;min-height:48px}textarea{min-height:130px;resize:vertical}input:focus,textarea:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(23,105,224,.12)}
.choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}.choice-card{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--border);border-radius:16px;background:#fbfdff;cursor:pointer;transition:.18s;min-height:56px}.choice-card:hover{border-color:var(--primary);transform:translateY(-1px);box-shadow:0 8px 20px rgba(23,32,51,.06)}.choice-card input{width:20px;height:20px;accent-color:var(--primary);flex:0 0 auto}.choice-card span{font-weight:700}.choice-card:has(input:checked),.choice-card.selected{border-color:var(--primary);background:var(--soft)}
.form-actions{display:flex;justify-content:flex-end;gap:10px;border-top:1px solid var(--border);padding-top:18px}.btn{border:0;border-radius:14px;padding:12px 18px;min-height:48px;text-decoration:none;font-weight:800;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-align:center}.btn-primary{background:var(--primary);color:white}.btn-primary:hover{background:var(--primary-dark)}.btn-secondary{background:#e8eef7;color:#23324d}.btn-light{background:white;color:#344054;border:1px solid var(--border)}.btn:disabled{opacity:.45;cursor:not-allowed}
.complete-card,.empty-state{max-width:720px;margin:80px auto;padding:40px;text-align:center}.complete-icon{width:72px;height:72px;margin:0 auto 18px;border-radius:50%;background:#dcfce7;color:var(--success);display:grid;place-items:center;font-size:42px;font-weight:900}.complete-card h1,.empty-state h1{margin:0 0 10px}.complete-card p,.empty-state p{color:var(--muted)}
.table-hint{display:none;color:var(--muted);font-size:13px;margin:0 0 8px}.table-wrap{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;border:1px solid #e5e7eb;border-radius:14px;background:#fff;box-shadow:inset -16px 0 18px -18px rgba(15,23,42,.45)}.survey-table{width:100%;border-collapse:separate;border-spacing:0;min-width:680px}.survey-table th{background:#f8fafc;color:#334155;font-size:12px;text-align:left;padding:12px;border-bottom:1px solid #e5e7eb;position:sticky;top:0;z-index:2}.survey-table td{padding:8px;border-bottom:1px solid #eef2f7;vertical-align:top}.survey-table input{width:100%;padding:10px;border:1px solid #dbe3ef;border-radius:10px;min-height:44px}.survey-table input[readonly]{background:#f8fafc;font-weight:700;color:#0f172a}.survey-table tr:last-child td{border-bottom:0}
.repeatable-list{display:flex;flex-direction:column;gap:12px}.repeat-row{display:flex;gap:12px;padding:12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:14px}.repeat-number{min-width:32px;height:32px;display:grid;place-items:center;border-radius:999px;background:#0f766e;color:#fff;font-weight:700}.repeat-fields{flex:1;display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.repeat-fields label small{display:block;margin-bottom:5px;color:#64748b;font-weight:700}.info-box{background:#ecfeff;border:1px solid #a5f3fc;padding:16px;border-radius:14px;color:#155e75}
@media(max-width:900px){
    .app-shell{padding:14px 14px 104px}.topbar{align-items:flex-start;gap:10px;flex-direction:column;border-radius:18px}.topbar h1{font-size:24px}.status-pill{font-size:14px;padding:8px 12px}.survey-layout{grid-template-columns:1fr;gap:14px}.section-panel{display:none}.mobile-section-jump{display:block}.question-card{padding:20px;border-radius:18px}.question-card h2{font-size:22px}.choice-grid{grid-template-columns:1fr}.form-actions{position:fixed;left:0;right:0;bottom:0;z-index:20;background:rgba(255,255,255,.96);border-top:1px solid var(--border);padding:10px 12px calc(10px + env(safe-area-inset-bottom));box-shadow:0 -10px 30px rgba(23,32,51,.12);display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:8px}.btn{padding:12px 10px;font-size:14px}.progress-header{position:sticky;top:8px;z-index:10;border-radius:18px}.table-hint{display:block}.survey-table{min-width:620px}.repeat-row{display:grid;grid-template-columns:36px 1fr}.repeat-fields{grid-template-columns:1fr}.complete-card,.empty-state{margin:30px auto;padding:24px}
}
@media(max-width:480px){
    body{font-size:15px}.app-shell{padding:10px 10px 106px}.topbar{padding:14px}.eyebrow{font-size:11px}.topbar h1{font-size:21px}.mobile-section-jump,.progress-header,.question-card{border-radius:16px}.question-card{padding:16px}.question-card h2{font-size:20px}.help-text{font-size:14px}.answer-area{margin:18px 0}input[type=text],input[type=number],input[type=date],textarea,select{border-radius:14px;padding:13px;font-size:16px}.choice-card{padding:13px}.form-actions{grid-template-columns:1fr 1fr;}.form-actions .btn-primary{grid-column:1 / -1;order:3}.form-actions .btn-secondary{order:2}.form-actions .btn-light{order:1}.survey-table{min-width:560px}.survey-table th,.survey-table td{padding:7px}.repeat-row{padding:10px;gap:8px}.repeat-number{min-width:28px;width:28px;height:28px}.info-box{padding:13px}
}

/* Mobile simple interview mode patch */
.mobile-survey-bar{display:none}.section-panel-head{display:block}.drawer-close{display:none}.drawer-backdrop{display:none}

@media(max-width:900px){
    body{background:#f6f8fb}
    .app-shell{padding:0 0 92px}
    .topbar{display:none}
    .mobile-survey-bar{position:sticky;top:0;z-index:80;display:grid;grid-template-columns:46px 1fr auto;align-items:center;gap:10px;background:#fff;border-bottom:1px solid var(--border);padding:10px 12px;box-shadow:0 4px 16px rgba(15,23,42,.06)}
    .mobile-menu-btn{width:42px;height:42px;border:1px solid var(--border);border-radius:14px;background:#f8fafc;color:#172033;font-size:22px;font-weight:900;line-height:1;cursor:pointer}
    .mobile-bar-title{min-width:0;display:flex;flex-direction:column;line-height:1.15}
    .mobile-bar-title strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#172033}
    .mobile-bar-title span{font-size:12px;color:var(--muted);margin-top:3px}
    .mobile-counter{font-size:15px;font-weight:900;color:var(--primary);background:var(--soft);border:1px solid #cfe2ff;border-radius:999px;padding:8px 11px;white-space:nowrap}
    .survey-layout{display:block;margin:0;max-width:none;padding:0}
    .question-panel{display:block;margin:0;padding:0}
    .progress-header{display:none}
    .question-card{border:0;border-radius:0;box-shadow:none;margin:0;min-height:calc(100vh - 150px);padding:18px 14px 24px;background:#fff}
    .question-card .section-title{display:none}
    .question-card h2{font-size:21px;line-height:1.32;margin:0 0 12px;color:#101828}
    .help-text{font-size:14px;margin:0 0 12px;color:#667085}
    .answer-area{margin:16px 0 12px}
    input[type=text],input[type=number],input[type=date],textarea,select{min-height:52px;border-radius:14px;background:#fff;font-size:16px}
    textarea{min-height:150px}
    .choice-grid{gap:10px}.choice-card{min-height:54px;border-radius:14px;background:#fff;padding:13px}
    .table-hint{display:block;background:#f8fafc;border:1px dashed #cbd5e1;border-radius:12px;padding:8px 10px}
    .table-wrap{border-radius:12px;box-shadow:inset -18px 0 18px -18px rgba(15,23,42,.55)}
    .survey-table{min-width:680px}
    .repeat-row{border-radius:12px;background:#fff}
    .form-actions{position:fixed;left:0;right:0;bottom:0;z-index:90;background:#fff;border-top:1px solid var(--border);padding:9px 10px calc(9px + env(safe-area-inset-bottom));box-shadow:0 -8px 24px rgba(15,23,42,.12);display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:8px}
    .btn{min-height:48px;border-radius:13px;font-size:14px;padding:11px 10px}

    .section-panel{display:block;position:fixed;top:0;left:0;bottom:0;width:min(86vw,330px);height:auto;z-index:110;border-radius:0 22px 22px 0;box-shadow:0 25px 60px rgba(15,23,42,.28);padding:16px;overflow-y:auto;transform:translateX(-105%);transition:transform .25s ease;background:#fff;border:0}
    body.sections-open .section-panel{transform:translateX(0)}
    .drawer-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.38);z-index:100;opacity:0;pointer-events:none;transition:opacity .2s ease;display:block}
    body.sections-open .drawer-backdrop{opacity:1;pointer-events:auto}
    .section-panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px;position:sticky;top:-16px;background:#fff;padding:16px 0 10px;z-index:2}
    .section-panel-head h2{margin:0;font-size:18px}.drawer-close{display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--border);background:#f8fafc;border-radius:12px;font-size:26px;line-height:1;cursor:pointer;color:#344054}
    .section-item{padding:13px 10px;margin-bottom:7px}.section-item strong{font-size:14px}.section-item span{min-width:30px;width:30px;height:30px}
}

@media(max-width:480px){
    .app-shell{padding:0 0 96px}.mobile-survey-bar{padding:9px 10px;grid-template-columns:44px 1fr auto}.mobile-menu-btn{width:40px;height:40px}.mobile-counter{font-size:14px;padding:7px 10px}.question-card{padding:16px 12px 22px}.question-card h2{font-size:20px}.form-actions{grid-template-columns:1fr 1fr 1.18fr}.form-actions .btn-primary{grid-column:auto;order:initial}.form-actions .btn-secondary{order:initial}.form-actions .btn-light{order:initial}.btn{font-size:13px}.survey-table{min-width:620px}
}

/* Indicative Information Form */
.indicative-shell{max-width:920px;margin:0 auto;padding:0 0 24px}.indicative-card{background:#fff;border:1px solid var(--border);border-radius:22px;box-shadow:var(--shadow);padding:28px}.indicative-card-head{border-bottom:1px solid var(--border);padding-bottom:16px;margin-bottom:20px}.indicative-card-head h2{font-size:28px;margin:8px 0 6px}.indicative-card-head p{margin:0;color:var(--muted)}.step-badge{display:inline-flex;background:var(--soft);border:1px solid #cfe2ff;color:var(--primary-dark);padding:7px 11px;border-radius:999px;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}.form-grid{display:grid;gap:16px}.form-grid.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid label span{display:block;font-size:13px;font-weight:800;color:#344054;margin-bottom:6px}.full-span{grid-column:1 / -1}.alert-error{border:1px solid #fecaca;background:#fef2f2;color:#991b1b;border-radius:14px;padding:12px 14px;margin-bottom:16px;font-weight:700}.indicative-actions{margin-top:22px}
@media(max-width:900px){.indicative-topbar{display:flex}.indicative-shell{padding:12px}.indicative-card{border-radius:18px;padding:18px}.indicative-card-head h2{font-size:23px}.form-grid.two-cols{grid-template-columns:1fr}.indicative-actions{position:sticky;bottom:0;margin-left:-32px;margin-right:-32px;margin-bottom:-32px;border-radius:0 0 18px 18px;grid-template-columns:1fr 1fr 1.2fr}}
@media(max-width:480px){.indicative-shell{padding:0}.indicative-card{border-radius:0;border-left:0;border-right:0;padding:16px}.indicative-card-head h2{font-size:21px}.indicative-actions{margin-left:-16px;margin-right:-16px;margin-bottom:-16px;grid-template-columns:1fr 1fr 1.15fr}.indicative-actions .btn-primary{grid-column:auto}}

/* Cascading Indicative Location Selectors */
.locked-input {
    background: #eef2f7 !important;
    color: #475569;
    cursor: not-allowed;
    font-weight: 700;
}
.form-grid select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d7dce5;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    font-size: 15px;
    color: #0f172a;
}
.form-grid select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}
@media (max-width: 720px) {
    .form-grid select {
        min-height: 50px;
        font-size: 16px;
    }
}


/* GPS capture field */
.gps-field .gps-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.gps-field .gps-row input {
    flex: 1;
}
.gps-detect-btn {
    white-space: nowrap;
}
.gps-status {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}
.gps-status.gps-ok {
    color: #047857;
}
.gps-status.gps-error {
    color: #b91c1c;
}
.gps-status.gps-loading {
    color: #1d4ed8;
}
@media (max-width: 640px) {
    .gps-field .gps-row {
        flex-direction: column;
    }
    .gps-detect-btn {
        width: 100%;
        min-height: 46px;
    }
}

/* Recent Surveys Page - Professional Dashboard */
.recent-page-pro {
    width: min(1240px, calc(100% - 36px));
    margin: 28px auto 96px;
}
.recent-hero-pro {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 22px;
    align-items: stretch;
    padding: 30px;
    background:
        radial-gradient(circle at 12% 16%, rgba(59, 130, 246, .32), transparent 32%),
        linear-gradient(135deg, #071a33 0%, #123b69 55%, #0f766e 140%);
    color: #fff;
    border-radius: 28px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .22);
}
.recent-hero-pro::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.recent-hero-copy { position: relative; z-index: 1; }
.recent-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bfdbfe;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
}
.recent-hero-pro h1 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}
.recent-hero-pro p {
    max-width: 720px;
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 1rem;
    line-height: 1.6;
}
.recent-hero-panel {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 22px;
    padding: 20px;
    backdrop-filter: blur(10px);
    display: grid;
    gap: 8px;
    align-content: center;
}
.recent-hero-panel span { color: #dbeafe; font-size: 13px; font-weight: 800; }
.recent-hero-panel strong { display: block; font-size: 2.6rem; line-height: 1; }
.recent-hero-panel small { color: rgba(255,255,255,.72); margin-bottom: 8px; }
.recent-stats-pro {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 18px 0;
}
.stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 3px;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px;
    text-decoration: none;
    color: #0f172a;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover,
.stat-card.active {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
}
.stat-card.muted:hover { transform: none; border-color: #e5e7eb; }
.stat-icon {
    grid-row: span 3;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}
.stat-icon.amber { background: #fef3c7; color: #92400e; }
.stat-icon.green { background: #dcfce7; color: #166534; }
.stat-icon.slate { background: #e2e8f0; color: #334155; }
.stat-label { color: #64748b; font-size: 13px; font-weight: 800; }
.stat-card strong { font-size: 1.75rem; line-height: 1; }
.stat-card small { color: #94a3b8; }
.recent-control-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: end;
    background: rgba(255,255,255,.92);
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.recent-filter-pro {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px auto auto;
    gap: 10px;
    align-items: end;
}
.search-field,
.status-field { display: grid; gap: 6px; }
.search-field span,
.status-field span { color: #475569; font-weight: 800; font-size: 12px; }
.recent-filter-pro input,
.recent-filter-pro select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    min-height: 46px;
    font-size: 15px;
    background: #fff;
    outline: none;
}
.recent-filter-pro input:focus,
.recent-filter-pro select:focus { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.recent-actions-pro { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn-danger-soft { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.btn-danger-soft:hover { background: #fecaca; }
.recent-list-pro {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.list-header h2 { margin: 0; color: #0f172a; font-size: 1.15rem; }
.list-header p { margin: 4px 0 0; color: #64748b; }
.list-pill {
    white-space: nowrap;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
}
.recent-table-wrap-pro { overflow-x: auto; }
.recent-table-pro {
    width: 100%;
    min-width: 1020px;
    border-collapse: collapse;
    color: #0f172a;
}
.recent-table-pro th,
.recent-table-pro td {
    padding: 16px 14px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}
.recent-table-pro th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 900;
}
.recent-table-pro tbody tr:hover td { background: #f8fafc; }
.recent-table-pro td small,
.survey-id-link + small {
    display: block;
    margin-top: 5px;
    color: #64748b;
    line-height: 1.35;
}
.survey-id-link {
    color: #0f5db8;
    font-weight: 900;
    text-decoration: none;
    font-size: 1rem;
}
.progress-cell {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    min-width: 130px;
}
.mini-progress-pro {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.mini-progress-pro span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    border-radius: inherit;
}
.badge-pro {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 900;
}
.badge-pro.pending { background: #fef3c7; color: #92400e; }
.badge-pro.complete { background: #dcfce7; color: #166534; }
.badge-pro.cancelled { background: #fee2e2; color: #991b1b; }
.row-actions-pro { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions-pro form { margin: 0; }
.btn-small { padding: 8px 10px; border-radius: 11px; font-size: 12px; }
.pagination-pro {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 18px 0 22px;
    flex-wrap: wrap;
}
.pagination-pro a {
    padding: 9px 12px;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    font-weight: 800;
}
.pagination-pro a.active { background: #0f5db8; color: #fff; }
.recent-mobile-header { display: none; }
.recent-empty-pro { margin: 24px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 22px; padding: 38px; text-align: center; }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: #e0f2fe; color: #0369a1; display: grid; place-items: center; margin: 0 auto 14px; font-weight: 900; }
.recent-modal .modal-content { max-width: 420px; }
.desktop-only { display: inline-flex; }
.fab {
    position: fixed;
    right: 26px;
    bottom: 26px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    background: #16a34a;
    color: #fff;
    font-size: 34px;
    text-decoration: none;
    box-shadow: 0 16px 34px rgba(22, 163, 74, .35);
    z-index: 50;
}

@media (max-width: 980px) {
    .recent-hero-pro { grid-template-columns: 1fr; }
    .recent-stats-pro { grid-template-columns: repeat(2, 1fr); }
    .recent-control-panel { grid-template-columns: 1fr; }
    .recent-filter-pro { grid-template-columns: 1fr 180px auto auto; }
    .recent-actions-pro { justify-content: flex-start; }
}

@media (max-width: 768px) {
    body { padding-top: 72px; }
    .recent-mobile-header {
        position: fixed;
        inset: 0 0 auto 0;
        height: 64px;
        background: #0f2a4c;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        z-index: 1000;
        box-shadow: 0 8px 20px rgba(15, 23, 42, .22);
    }
    .recent-mobile-title span { display: block; font-size: 12px; color: rgba(255,255,255,.72); }
    .recent-menu-btn, .recent-plus {
        width: 42px;
        height: 42px;
        border-radius: 13px;
        border: 1px solid rgba(255,255,255,.2);
        background: rgba(255,255,255,.1);
        color: #fff;
        display: inline-flex;
        justify-content: center;
        text-decoration: none;
        font-size: 24px;
    }
    .recent-menu-btn.active { background: rgba(255,255,255,.22); }
    .recent-page-pro { width: min(100% - 20px, 640px); margin-top: 12px; }
    .recent-hero-pro { display: none; }
    .recent-stats-pro { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 13px; border-radius: 17px; grid-template-columns: 1fr; }
    .stat-icon { width: 34px; height: 34px; border-radius: 12px; }
    .stat-card strong { font-size: 1.4rem; }
    .stat-card small { display: none; }
    .recent-control-panel {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        border-radius: 0 0 20px 20px;
        display: block;
        transform: translateY(-115%);
        opacity: 0;
        pointer-events: none;
        transition: transform .25s ease, opacity .25s ease;
        z-index: 999;
        padding: 14px;
    }
    .recent-control-panel.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .recent-filter-pro { grid-template-columns: 1fr; }
    .recent-actions-pro { display: grid; grid-template-columns: 1fr; margin-top: 10px; }
    .recent-actions-pro .btn, .recent-filter-pro .btn { width: 100%; justify-content: center; text-align: center; }
    .list-header { padding: 15px; align-items: flex-start; }
    .list-header p { font-size: 13px; }
    .list-pill { display: none; }
    .recent-list-pro { border-radius: 20px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .recent-table-wrap-pro { overflow: visible; }
    .recent-table-pro, .recent-table-pro thead, .recent-table-pro tbody, .recent-table-pro th, .recent-table-pro td, .recent-table-pro tr { display: block; min-width: 0; }
    .recent-table-pro thead { display: none; }
    .recent-table-pro tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 20px;
        padding: 13px;
        margin-bottom: 12px;
        box-shadow: 0 9px 24px rgba(15, 23, 42, .08);
    }
    .recent-table-pro td {
        border: 0;
        padding: 9px 0 9px 116px;
        min-height: 38px;
        position: relative;
    }
    .recent-table-pro td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        top: 9px;
        width: 102px;
        color: #64748b;
        font-size: 12px;
        font-weight: 900;
    }
    .progress-cell { min-width: 0; }
    .row-actions-pro { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .row-actions-pro .btn, .row-actions-pro form, .row-actions-pro button { width: 100%; text-align: center; justify-content: center; }
    .fab { display: none; }
}

@media (max-width: 420px) {
    .recent-stats-pro { grid-template-columns: 1fr 1fr; }
    .recent-table-pro td { padding-left: 102px; }
    .recent-table-pro td::before { width: 92px; }
    .row-actions-pro { grid-template-columns: 1fr; }
}

/* Clean Import Saved Survey Modal */
body.modal-open { overflow: hidden; }
.recent-import-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 3000;
}
.recent-import-modal.show { display: flex; }
.recent-import-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
    backdrop-filter: blur(4px);
}
.recent-import-card {
    position: relative;
    width: min(100%, 480px);
    background: #fff;
    color: #0f172a;
    border-radius: 26px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
    border: 1px solid rgba(226, 232, 240, .9);
    animation: importModalIn .18s ease-out;
}
@keyframes importModalIn {
    from { transform: translateY(12px) scale(.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
.recent-import-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 14px;
    background: #f1f5f9;
    color: #334155;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.recent-import-close:hover { background: #e2e8f0; }
.recent-import-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dbeafe, #dcfce7);
    color: #0f5db8;
    font-size: 30px;
    font-weight: 900;
    margin-bottom: 14px;
}
.recent-import-card h2 { margin: 0 42px 8px 0; font-size: 1.35rem; }
.recent-import-lead { margin: 0 0 18px; color: #64748b; line-height: 1.5; }
.recent-import-dropzone {
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    padding: 26px 18px;
    border: 2px dashed #cbd5e1;
    border-radius: 22px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.recent-import-dropzone:hover,
.recent-import-dropzone.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
}
.recent-import-dropzone.has-file {
    border-color: #16a34a;
    background: #f0fdf4;
}
.recent-import-dropzone input { display: none !important; }
.recent-import-dropzone strong { font-size: 1rem; color: #0f172a; }
.recent-import-dropzone span { color: #64748b; font-size: 14px; }
.recent-import-dropzone small {
    display: inline-flex;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.recent-import-progress { margin-top: 16px; }
.recent-import-progress-bar {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}
.recent-import-progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #14b8a6);
    transition: width .2s ease;
}
.recent-import-progress p { margin: 8px 0 0; color: #475569; font-size: 14px; }
.recent-import-note {
    margin-top: 16px;
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
}
.recent-import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}
@media (max-width: 520px) {
    .recent-import-modal { padding: 10px; align-items: flex-end; }
    .recent-import-card { border-radius: 24px 24px 0 0; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); }
    .recent-import-actions { display: grid; grid-template-columns: 1fr; }
    .recent-import-actions .btn { width: 100%; }
}

/* Smart Sync UI */
.sync-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: 8px;
    padding: 0 7px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.sync-card {
    max-width: 620px;
}

.sync-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0;
}

.sync-summary-grid > div {
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    text-align: center;
}

.sync-summary-grid span {
    display: block;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 4px;
}

.sync-summary-grid strong {
    font-size: 28px;
    color: #0f172a;
}

.sync-list {
    margin: 14px 0;
    max-height: 260px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}

.sync-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
}

.sync-list-item:last-child {
    border-bottom: 0;
}

.sync-list-item strong,
.sync-list-item span {
    display: block;
}

.sync-list-item strong {
    color: #0f172a;
    font-size: 14px;
}

.sync-list-item span {
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    word-break: break-all;
}

.sync-list-item em {
    white-space: nowrap;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
    border-radius: 999px;
}

.sync-list-item.pending em {
    background: #fff7ed;
    color: #c2410c;
}

.sync-list-item.failed em {
    background: #fef2f2;
    color: #b91c1c;
}

.sync-list-item.synced em {
    background: #ecfdf5;
    color: #047857;
}

.sync-empty {
    padding: 20px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 768px) {
    .sync-summary-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .sync-summary-grid > div {
        padding: 10px 6px;
    }

    .sync-summary-grid strong {
        font-size: 22px;
    }

    .sync-list-item {
        align-items: flex-start;
        flex-direction: column;
    }
}


.alert-success {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 600;
}

/* Base Data Management Module */
.admin-page{background:#f4f7fb;color:#172033;min-height:100vh}.admin-topbar{background:linear-gradient(135deg,#0b1e3b,#174a8b);color:#fff;padding:24px;display:flex;justify-content:space-between;gap:20px;align-items:center}.admin-topbar h1{margin:.1rem 0;font-size:28px}.admin-topbar p{margin:.25rem 0;color:#dbeafe}.admin-topbar nav{display:flex;gap:10px;flex-wrap:wrap}.admin-shell{max-width:1240px;margin:24px auto;padding:0 18px}.base-data-shell{display:grid;grid-template-columns:310px 1fr;gap:18px}.admin-panel,.base-category-panel{background:#fff;border:1px solid #dce5f2;border-radius:22px;box-shadow:0 14px 35px rgba(15,23,42,.07);padding:18px}.base-category-panel h2,.admin-panel h2{margin-top:0}.base-cat{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:center;text-decoration:none;color:#1e293b;padding:12px;border:1px solid #e2e8f0;border-radius:14px;margin-bottom:8px;background:#f8fafc}.base-cat:hover,.base-cat.active{background:#eaf3ff;border-color:#93c5fd}.base-cat span{background:#0b6bcb;color:white;width:30px;height:30px;border-radius:10px;display:grid;place-items:center;font-weight:900}.base-cat em{font-style:normal;color:#64748b;font-weight:800}.panel-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.panel-head h2{margin:0}.panel-head p{margin:4px 0 0;color:#64748b}.search-row{display:flex;gap:10px;margin-bottom:16px}.search-row input{flex:1}.admin-table{width:100%;border-collapse:collapse;background:#fff}.admin-table th,.admin-table td{border-bottom:1px solid #e2e8f0;padding:12px;text-align:left}.admin-table th{background:#f8fafc;text-transform:uppercase;font-size:12px;letter-spacing:.04em;color:#475569}.btn-small{padding:7px 10px;font-size:13px}.status-badge{border-radius:999px;padding:5px 10px;font-weight:900;font-size:12px}.status-badge.active{background:#dcfce7;color:#166534}.status-badge.inactive{background:#fee2e2;color:#991b1b}.alert-info{background:#e0f2fe;color:#075985;border:1px solid #7dd3fc;border-radius:14px;padding:12px 14px;margin-bottom:14px}.single-panel{max-width:1080px}.data-form{display:grid;gap:18px}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.form-grid label,.data-form label{display:grid;gap:6px;font-weight:800;color:#334155}.form-grid input,.form-grid select,.data-form textarea,.data-form input,.data-form select,.search-row input{width:100%;border:1px solid #cbd5e1;border-radius:12px;padding:11px 12px;background:#fff}.base-select-wrap{display:grid;gap:12px}.manual-base-entry{display:grid;gap:6px;margin-top:6px}.manual-base-entry small{color:#64748b}.base-warning{border:1px dashed #f59e0b;background:#fffbeb;color:#92400e;border-radius:14px;padding:12px}.base-summary{border:1px solid #bfdbfe;background:#eff6ff;border-radius:14px;padding:12px;display:grid;gap:3px;color:#1e3a8a}.base-summary span{font-size:13px;color:#475569}.base-info-box{background:#f8fafc;border:1px solid #e2e8f0;border-radius:16px;padding:16px}.base-info-box strong{display:block;color:#0f172a;margin-bottom:6px}.base-info-box p{margin:0;color:#64748b}.base-choice-grid{max-height:320px;overflow:auto;padding:4px}
@media(max-width:900px){.admin-topbar{flex-direction:column;align-items:flex-start}.base-data-shell{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr}.panel-head,.search-row{flex-direction:column}.search-row .btn{width:100%}.admin-table,.admin-table tbody,.admin-table tr,.admin-table td{display:block}.admin-table thead{display:none}.admin-table tr{border:1px solid #e2e8f0;border-radius:14px;margin-bottom:10px;padding:10px}.admin-table td{border:0;padding:8px}.admin-table td:before{content:attr(data-label);display:block;font-size:11px;text-transform:uppercase;color:#64748b;font-weight:900;margin-bottom:3px}}
