:root {
    --brand: #70e0fa;
    --brand-dark: #0f7f9e;
    --brand-soft: #e6f9fd;
    --ink: #12263a;
    --ink-soft: #5b6b7c;
    --bg: #f4f8fa;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(18, 38, 58, 0.08);
    --shadow-lg: 0 16px 40px rgba(18, 38, 58, 0.14);
    --good: #2fa86c;
    --bad: #d24545;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-decor .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22; animation: floatBlob 20s ease-in-out infinite; }
.bg-decor .b1 { width: 320px; height: 320px; background: var(--brand); top: -90px; left: -100px; }
.bg-decor .b2 { width: 260px; height: 260px; background: var(--brand-dark); bottom: -70px; right: -80px; animation-delay: -5s; }
@keyframes floatBlob { 0%, 100% { transform: translate(0,0) scale(1); } 50% { transform: translate(14px,-16px) scale(1.03); } }

.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: var(--ink);
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}
.btn-outline-primary { color: var(--brand-dark); border-color: var(--brand); }
.btn-outline-primary:hover { background-color: var(--brand); border-color: var(--brand); color: var(--ink); }
a { color: var(--brand-dark); }
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(112, 224, 250, .35);
}

html { -webkit-text-size-adjust: 100%; }
.app-shell { max-width: 600px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.brand-mark { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .95rem; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.brand-logo { height: 34px; width: auto; vertical-align: middle; }
.survey-title { font-size: clamp(1.15rem, 3.5vw, 1.4rem); font-weight: 800; line-height: 1.25; margin: 0 0 .3rem; letter-spacing: -.01em; }
.survey-desc { max-width: 400px; margin: 0 auto; font-size: clamp(.82rem, 2vw, .9rem); line-height: 1.45; color: var(--ink-soft); }

.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.search-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem;
}
.search-card #searchInput,
.search-card #companySelect {
    font-size: 1rem;
    min-height: 46px;
    border-radius: 10px;
    border: 1.5px solid #e2edf1;
}
.search-divider { flex: 1 1 auto; height: 1px; background: #e2edf1; }

.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .7rem .85rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
.result-card:hover { box-shadow: var(--shadow-lg); }
.result-card .d-flex { flex-wrap: wrap; row-gap: .5rem; column-gap: .7rem !important; }
.table-badge {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--brand-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.table-num { font-size: .95rem; font-weight: 800; color: var(--brand-dark); }
.table-label { font-size: .52rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.result-name { font-weight: 700; font-size: .9rem; }
.result-company { margin-top: .05rem; font-size: .78rem; }
.result-info-text { min-width: 0; }
.result-action { flex: none; margin-left: auto; }
.btn-checkin {
    white-space: nowrap;
    min-height: 38px;
    padding: .4rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
}
.badge-checked-in {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(47, 168, 108, .12);
    color: var(--good);
    font-weight: 600;
    font-size: .78rem;
    padding: .4rem .8rem;
    border-radius: 99px;
    white-space: nowrap;
}

@media (max-width: 400px) {
    .result-card .d-flex { align-items: flex-start; }
    .result-name, .result-company { overflow-wrap: anywhere; }
    .result-action {
        flex: 1 0 100%;
        margin-left: 0;
        margin-top: .1rem;
    }
    .btn-checkin, .badge-checked-in { width: 100%; justify-content: center; }
}

/* ---------- Admin ---------- */
.admin-shell { background: var(--bg); min-height: 100vh; }
.admin-navbar { background: #fff; box-shadow: var(--shadow); }
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--ink); }
.stat-number.stat-good { color: var(--good); }
.stat-number.stat-bad { color: var(--bad); }
.stat-label { color: var(--ink-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }

.pct-bar-track { background: #e2edf1; border-radius: 99px; height: 10px; overflow: hidden; }
.pct-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    width: 0%;
    border-radius: 99px;
    transition: width .8s cubic-bezier(.2,.8,.2,1);
}

.data-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); border-bottom-width: 1px; }
.table td, .table th { vertical-align: middle; }
.badge-status-in { background: rgba(47, 168, 108, .12); color: var(--good); }
.badge-status-out { background: rgba(210, 69, 69, .1); color: var(--bad); }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top left, var(--brand-soft), var(--bg) 60%);
}
.login-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    animation: fadeUp .5s ease both;
}
.login-logo { height: 56px; width: auto; }

@media (max-width: 576px) {
    .search-card { padding: .9rem; }
    .login-card { padding: 1.75rem; }
    .app-shell { padding: 1rem .75rem 2.5rem; }
}
