/* ==========================================================================
   Test The App — design system
   ========================================================================== */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --brand-50: #eef2ff;
    --brand-100: #e0e7ff;
    --brand-200: #c7d2fe;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-700: #334155;
    --ink-500: #64748b;
    --ink-400: #94a3b8;

    --surface: #f6f7fb;
    --card: #ffffff;
    --border: #e6e9f2;
    --border-soft: #eef0f6;

    --success: #10b981;
    --success-soft: #e7f9f1;
    --warning: #f59e0b;
    --warning-soft: #fef6e7;
    --danger: #ef4444;
    --danger-soft: #fdeceb;
    --info: #0ea5e9;
    --info-soft: #e6f6fd;
    --secondary-soft: #eef0f6;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);
}

* {
    -webkit-font-smoothing: antialiased;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--surface);
    color: var(--ink-800);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

a {
    color: var(--brand-600);
}

a:hover {
    color: var(--brand-700);
}

/* ---------------------------------------------------------------------- */
/* App shell / layout                                                     */
/* ---------------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-main {
    padding: 1.75rem;
    flex: 1;
}

@media (max-width: 767.98px) {
    .app-main {
        padding: 1.25rem;
    }
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink-900);
    margin: 0;
}

.page-subtitle {
    color: var(--ink-500);
    font-size: 0.875rem;
    margin-top: 0.15rem;
}

/* ---------------------------------------------------------------------- */
/* Sidebar                                                                 */
/* ---------------------------------------------------------------------- */

.sidebar {
    width: 264px;
    min-height: 100vh;
    background: linear-gradient(180deg, #111827 0%, #1e2436 100%);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.15rem;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    padding: 0.25rem 0.4rem 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    height: 46px;
    width: 46px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.sidebar-nav-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-nav + .sidebar-nav {
    margin-top: 0.9rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: rgba(255, 255, 255, 0.62);
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    font-size: 1.05rem;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.sidebar-footer {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .btn {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-footer .btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.18);
}

/* ---------------------------------------------------------------------- */
/* Topbar                                                                  */
/* ---------------------------------------------------------------------- */

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.75rem;
}

@media (max-width: 767.98px) {
    .app-topbar {
        padding: 0.9rem 1.25rem;
    }
}

.app-topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink-900);
    margin: 0;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink-800);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border-radius: 999px;
    transition: background-color 0.15s ease;
}

.topbar-user:hover {
    background-color: var(--brand-50);
    color: var(--ink-800);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------- */
/* Cards                                                                   */
/* ---------------------------------------------------------------------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background-color: var(--card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.section-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background-color: var(--card);
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title-row h6 {
    font-weight: 700;
    color: var(--ink-900);
    margin: 0;
    font-size: 0.95rem;
}

/* Metric / KPI tiles */

.metric-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.15rem;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.metric-icon.icon-brand { background: var(--brand-50); color: var(--brand-600); }
.metric-icon.icon-success { background: var(--success-soft); color: var(--success); }
.metric-icon.icon-warning { background: var(--warning-soft); color: #b45309; }
.metric-icon.icon-danger { background: var(--danger-soft); color: var(--danger); }
.metric-icon.icon-info { background: var(--info-soft); color: #0369a1; }
.metric-icon.icon-slate { background: var(--secondary-soft); color: var(--ink-700); }

.metric-tile.flex-column {
    align-items: center;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--ink-900);
    line-height: 1.15;
}

.metric-label {
    color: var(--ink-500);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------------- */
/* Badges                                                                  */
/* ---------------------------------------------------------------------- */

.badge-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4em 0.85em;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-soft-success { background-color: var(--success-soft); color: #067a55; }
.badge-soft-warning { background-color: var(--warning-soft); color: #b45309; }
.badge-soft-danger { background-color: var(--danger-soft); color: #c62b2b; }
.badge-soft-info { background-color: var(--info-soft); color: #0369a1; }
.badge-soft-secondary { background-color: var(--secondary-soft); color: var(--ink-700); }
.badge-soft-brand { background-color: var(--brand-100); color: var(--brand-700); }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--brand-gradient);
    border: none;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.28);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #5457e0 0%, #7c4fe6 100%);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.34);
}

.btn-outline-primary {
    color: var(--brand-600);
    border-color: var(--brand-200);
}

.btn-outline-primary:hover {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

.btn-check:checked + .btn-outline-success,
.btn-outline-success:hover {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-check:checked + .btn-outline-danger,
.btn-outline-danger:hover {
    background-color: var(--danger);
    border-color: var(--danger);
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink-700);
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.form-check-input:checked {
    background-color: var(--brand-600);
    border-color: var(--brand-600);
}

/* ---------------------------------------------------------------------- */
/* Tables                                                                  */
/* ---------------------------------------------------------------------- */

.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    border-bottom: 1px solid var(--border);
    color: var(--ink-500);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 0.75rem;
    background-color: transparent;
}

.table-modern tbody td {
    padding: 0.85rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-800);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr {
    transition: background-color 0.12s ease;
}

.table-modern tbody tr:hover {
    background-color: var(--surface);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------- */
/* Progress                                                                */
/* ---------------------------------------------------------------------- */

.progress {
    background-color: var(--border-soft);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
}

/* ---------------------------------------------------------------------- */
/* Misc components                                                        */
/* ---------------------------------------------------------------------- */

.tester-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.accordion-button:not(.collapsed) {
    background-color: var(--brand-50);
    color: var(--ink-900);
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--border);
}

.testing-day-pill {
    background: var(--brand-50);
    color: var(--brand-700);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
}

.timeline-badge {
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-soft);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-400);
    margin-top: 0.4rem;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--ink-500);
}

.empty-state i {
    font-size: 2.25rem;
    color: var(--ink-400);
    margin-bottom: 0.75rem;
    display: block;
}

/* ---------------------------------------------------------------------- */
/* Auth (login) screen                                                    */
/* ---------------------------------------------------------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 20% 20%, #eef2ff 0%, transparent 45%),
                radial-gradient(circle at 80% 80%, #ede9fe 0%, transparent 45%),
                var(--surface);
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 2.25rem 2rem;
}

.auth-logo {
    height: 96px;
    width: 96px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.32);
}

.auth-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: var(--ink-400);
    font-size: 0.8rem;
    padding: 1rem;
}

/* ---------------------------------------------------------------------- */
/* Public pages (client tracking / tester submission)                     */
/* ---------------------------------------------------------------------- */

.public-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.public-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.public-logo {
    height: 44px;
    width: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.hero-card {
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #111827 0%, #312e81 100%);
    color: #fff;
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
}

.hero-card .text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

.hero-card h4 {
    color: #fff;
}

.hero-card .progress {
    background-color: rgba(255, 255, 255, 0.15);
}

.result-btn {
    min-height: 76px;
    font-size: 1.05rem;
    border-radius: var(--radius);
    border-width: 2px;
}

.result-btn.btn-outline-success.active,
.btn-check:checked + .result-btn.btn-outline-success {
    background-color: var(--success);
    border-color: var(--success);
    color: #fff;
}

.result-btn.btn-outline-danger.active,
.btn-check:checked + .result-btn.btn-outline-danger {
    background-color: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Error pages                                                            */
/* ---------------------------------------------------------------------- */

.error-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface);
    padding: 1.5rem;
}

.error-card {
    text-align: center;
    max-width: 420px;
}

.error-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    margin: 0 auto 1.25rem;
}

/* ---------------------------------------------------------------------- */
/* Alerts                                                                  */
/* ---------------------------------------------------------------------- */

.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.alert-success {
    background-color: var(--success-soft);
    color: #067a55;
}

.alert-danger {
    background-color: var(--danger-soft);
    color: #c62b2b;
}
