/* =====================================================================
   DataInferix — Platform styles (auth, dashboard, admin, course pages)
   Additive layer on top of style.css. Uses the SAME design tokens.
   ===================================================================== */

/* ---------- Auth pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 2rem 1.25rem;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}
.auth-logo { justify-content: center; margin-bottom: 1.25rem; }
.auth-heading { text-align: center; font-size: 1.4rem; margin-bottom: 0.25rem; }
.auth-sub { text-align: center; font-size: 0.9rem; margin-bottom: 1.5rem; }

.form-field { margin-bottom: 1rem; }
.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.35rem;
}
.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 0;
    border-color: var(--accent);
}
.form-field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error-msg {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: var(--error);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.form-success-msg {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: var(--success);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.form-actions { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.form-actions .btn { width: 100%; }
.auth-alt { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-alt a { font-weight: 600; }
.divider-or {
    display: flex; align-items: center; gap: 0.75rem;
    color: var(--text-muted); font-size: 0.8rem; margin: 1.25rem 0;
}
.divider-or::before, .divider-or::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%; padding: 0.65rem; background: var(--background);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.95rem; color: var(--text); cursor: pointer;
}
.btn-google:hover { background: var(--surface); }

/* ---------- App shell (dashboard + admin) ---------- */
.app-shell { display: flex; min-height: 100vh; background: var(--surface); }
.app-sidebar {
    width: 240px; flex-shrink: 0; background: var(--primary);
    color: #fff; padding: 1.25rem 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.app-sidebar .logo { color: #fff; padding: 0 1.25rem; margin-bottom: 1.5rem; }
.app-sidebar .logo span { color: #fff; }
.app-nav-section { padding: 0.5rem 1.25rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.5); margin-top: 0.75rem; }
.app-nav a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 1.25rem; color: rgba(255,255,255,0.85);
    font-size: 0.9rem; font-weight: 500;
}
.app-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-nav a.active { background: rgba(255,255,255,0.12); color: #fff; border-left: 3px solid var(--accent); }
.app-main { flex: 1; min-width: 0; padding: 1.5rem; }
.app-topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.app-topbar h1 { font-size: 1.5rem; margin: 0; }
.admin-banner {
    background: var(--accent-soft); border: 1px solid var(--accent);
    color: var(--primary); border-radius: var(--radius-sm);
    padding: 0.5rem 0.9rem; font-size: 0.85rem; font-weight: 600; margin-bottom: 1rem;
}

/* ---------- Cards / panels ---------- */
.panel {
    background: var(--background); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.panel h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
    background: var(--background); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem 1.25rem;
}
.stat-card .stat-num { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Tables (responsive) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.data-table th {
    text-align: left; padding: 0.6rem 0.75rem; font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--surface); }
.data-table .actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
    font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge-green { background: #ECFDF5; color: var(--success); }
.badge-amber { background: #FFFBEB; color: var(--warning); }
.badge-red { background: #FEF2F2; color: var(--error); }
.badge-blue { background: var(--accent-soft); color: var(--accent-hover); }
.badge-gray { background: var(--surface-2); color: var(--text-muted); }
.badge-navy { background: var(--primary-soft); color: var(--primary); }

/* ---------- Progress ---------- */
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1rem; }

/* ---------- Course page ---------- */
.course-hero { background: var(--primary); color: #fff; padding: 3rem 0; }
.course-hero h1 { color: #fff; }
.course-hero .lead { color: rgba(255,255,255,0.8); }
.course-banner-img { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.price-row { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.price-current { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.price-regular { font-size: 1.1rem; color: var(--text-muted); text-decoration: line-through; }
.price-off { background: var(--accent-soft); color: var(--accent-hover); font-weight: 700; font-size: 0.85rem; padding: 0.2rem 0.6rem; border-radius: 999px; }
.course-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.course-meta-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; }
.course-meta-item .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.course-meta-item .v { font-weight: 600; color: var(--primary); margin-top: 0.15rem; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.75rem; }
.faq-item summary { padding: 0.9rem 1.1rem; font-weight: 600; color: var(--primary); cursor: pointer; }
.faq-item .faq-a { padding: 0 1.1rem 0.9rem; color: var(--text); }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding-left: 1.6rem; position: relative; margin-bottom: 0.5rem; }
.check-list li::before {
    content: ''; position: absolute; left: 0; top: 0.35rem; width: 14px; height: 14px;
    background: var(--accent-soft); border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230891B2' stroke-width='3'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: 9px; background-repeat: no-repeat; background-position: center;
}

/* ---------- Class list ---------- */
.class-item {
    display: flex; align-items: center; gap: 1rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0.9rem 1.1rem; margin-bottom: 0.6rem; background: var(--background);
}
.class-item .num {
    width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft);
    color: var(--primary); font-weight: 700; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; font-size: 0.85rem;
}
.class-item.done .num { background: var(--accent); color: #fff; }
.class-item .grow { flex: 1; min-width: 0; }
.class-item h3 { margin: 0; font-size: 0.98rem; }
.class-item .meta { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Tool embed ---------- */
.tool-embed { width: 100%; min-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.usage-meter { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Notifications ---------- */
.notif-item { display: flex; gap: 0.75rem; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.6rem; background: var(--background); }
.notif-item.unread { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.notif-item .t { font-weight: 600; color: var(--primary); font-size: 0.92rem; }
.notif-item .b { font-size: 0.85rem; color: var(--text-muted); }
.notif-item .time { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

/* ---------- Verify page ---------- */
.verify-card { max-width: 640px; margin: 3rem auto; }
.verify-status { display: flex; align-items: center; gap: 0.75rem; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.verify-status.ok { color: var(--success); }
.verify-status.bad { color: var(--error); }
.verify-icon { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.verify-status.ok .verify-icon { background: #ECFDF5; }
.verify-status.bad .verify-icon { background: #FEF2F2; }
.verify-rows { border-top: 1px solid var(--border); }
.verify-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.verify-row .k { color: var(--text-muted); }
.verify-row .v { font-weight: 600; color: var(--primary); text-align: right; }

/* ---------- Admin form grid ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 1.25rem; }
.form-grid .full { grid-column: 1 / -1; }
.search-bar { display: flex; gap: 0.6rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 220px; padding: 0.6rem 0.8rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.95rem; font-family: inherit; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.6rem 1rem; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--accent); }

/* ---------- Responsive app shell ---------- */
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .app-sidebar { width: 100%; height: auto; position: static; padding: 0.75rem 0; }
    .app-nav { display: flex; overflow-x: auto; padding-bottom: 0.5rem; }
    .app-nav a { white-space: nowrap; border-left: none; }
    .app-nav a.active { border-left: none; border-bottom: 2px solid var(--accent); }
    .app-nav-section { display: none; }
    .app-main { padding: 1rem; }
}

/* ===== Auth pages (additive) ===== */
.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; text-align: left; }
.auth-form .field span { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .375rem; color: var(--text, #0F172A); }
.auth-links { display: flex; gap: .75rem; justify-content: center; margin-top: 1.5rem; font-size: .9rem; color: var(--muted, #64748B); }
.auth-links a { color: var(--accent, #0891B2); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0; color: var(--muted, #64748B); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border, #E2E8F0); }
.btn-block { width: 100%; justify-content: center; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; color: var(--muted, #64748B); }
.check input { margin-top: .2rem; }
.check a { color: var(--accent, #0891B2); }
.backup-codes { font-size: .85rem; color: var(--muted, #64748B); }
.backup-codes summary { cursor: pointer; margin-bottom: .5rem; }

/* ===== Badges (success/error aliases) ===== */
.badge-success { background: #ECFDF5; color: #059669; }
.badge-error { background: #FEF2F2; color: #DC2626; }

/* ===== Verify page ===== */
.verify-page { display: flex; justify-content: center; padding: 4rem 1rem; }
.verify-id { color: var(--muted, #64748B); font-size: .9rem; }
.verify-id code { background: var(--primary-soft, #E8EEF7); padding: .15rem .5rem; border-radius: 6px; font-weight: 600; }
.verify-details { margin: 1.5rem 0; text-align: left; display: flex; flex-direction: column; gap: .75rem; }
.verify-details > div { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border, #E2E8F0); }
.verify-details dt { color: var(--muted, #64748B); font-size: .875rem; }
.verify-details dd { font-weight: 600; margin: 0; text-align: right; }
