/* Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
    /* --- Brand palette (tweak as needed) --- */
    --brand-bg: #0c1f3a;
    /* deep navy (page bg for auth) */
    --brand-primary: #163b72;
    /* navy-700 */
    --brand-accent: #5d74ff;
    /* indigo/blue from logo */
    --brand-accent-2: #8ea2ff;
    /* lighter accent for hovers */
    --brand-on-dark: #e7eef8;

    /* UI neutrals */
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --card: #ffffff;
    --bg: #f8fafc;

    --radius: 14px;
    --pad: 14px;
}

/* Global */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    max-width: 980px;
    margin: 32px auto;
    padding: 0 16px;
}

/* Dark background variant for auth */
.auth-bg {
    background: var(--brand-bg);
    color: var(--brand-on-dark);
    max-width: none;
    margin: 0;
    min-height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* Header / logo */
.header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.brand-mark {
    height: 28px;
}

.brand-name {
    font-weight: 600;
    color: var(--brand-primary);
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--pad);
    margin: 16px 0;
    box-shadow: 0 4px 16px rgba(10, 20, 40, 0.04);
}

h1 {
    font-size: 22px;
    margin: 8px 0 12px;
}

h3 {
    margin: 0 0 10px;
}

/* Rows / inputs / buttons */
.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input,
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: inherit;
    outline: none;
}

.input:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(93, 116, 255, 0.15);
}

.btn {
    padding: 10px 16px;
    border: 1px solid var(--brand-primary);
    color: #fff;
    background: var(--brand-primary);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
}

.btn:hover {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

.btn.ghost {
    background: #fff;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn.ghost:hover {
    background: #f3f4f6;
}

/* Small text */
.small {
    color: var(--muted);
    font-size: 12px;
}

/* Progress */
.progress {
    height: 10px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.progress>div {
    height: 100%;
    width: 0%;
    background: var(--brand-accent);
    transition: width .2s;
}

/* Drag & drop */
.drop {
    border: 2px dashed #9ca3af;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: var(--muted);
}

/* Table (home list) */
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #eee;
    padding: 8px;
    text-align: left;
}

/* Pills & helpers */
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #F3F4F6;
    margin-right: 6px;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none !important;
}

/* ----- Rich dropdown ----- */
.dropdown {
    position: relative;
    display: block;
    width: 100%;
}

.dropdown-toggle {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.dropdown-toggle .chevron {
    opacity: .6;
}

.dropdown-menu {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    margin-top: 6px;
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    padding: 6px;
}

.jq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.jq-item {
    border: 1px solid #eef0f2;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    background: #fff;
}

.jq-item:hover {
    background: #f9fafb;
}

.jq-item.selected {
    border-color: var(--brand-primary);
    background: #eef2ff;
}

.jq-title {
    font-weight: 600;
}

.jq-sub {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.jq-status {
    padding: 6px 4px;
    position: sticky;
    bottom: 0;
    background: #fff;
}
/* ===== Typographic scale & hierarchy (Hunar) ===== */
:root {
    /* Poppins looks best with a slightly smaller base than 16px */
    --fs-xs: 12px;
    /* captions, helper labels */
    --fs-sm: 13px;
    /* small UI text, pills, table headers */
    --fs-base: 15px;
    /* body copy, table cells, inputs, buttons */
    --fs-md: 16px;
    /* dropdown trigger, important secondary text */
    --fs-lg: 18px;
    /* card section titles (h3) */
    --fs-xl: 22px;
    /* page H1 */
    --fs-2xl: 28px;
    /* (unused now) hero-sized */
}

/* Base */
body {
    font-size: var(--fs-base);
    line-height: 1.5;
}

/* Headings */
h1 {
    font-size: var(--fs-xl) !important;
    line-height: 1.25;
    font-weight: 600;
    margin: 8px 0 14px;
}

h3 {
    font-size: var(--fs-lg) !important;
    line-height: 1.35;
    font-weight: 600;
}

/* “Small” helper text */
.small {
    font-size: var(--fs-sm);
}

/* Header brand */
.brand-name {
    font-size: var(--fs-lg);
    font-weight: 600;
}

/* Buttons & inputs */
.btn {
    font-size: var(--fs-base);
    font-weight: 500;
    padding: 10px 16px;
}

.btn.ghost {
    font-size: var(--fs-base);
}

.input,
input[type="email"],
input[type="password"] {
    font-size: var(--fs-base);
    padding: 10px 12px;
}

/* Table */
table th {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #374151;
}

table td {
    font-size: var(--fs-base);
}

/* Progress labels */
#r2Count,
#runText,
#phaseText {
    font-size: var(--fs-sm);
}

/* Pills */
.pill {
    font-size: var(--fs-sm);
    font-weight: 500;
}

/* ===== Rich dropdown sizing ===== */
/* Trigger */
.dropdown-toggle {
    font-size: var(--fs-md);
}

/* Each item */
.jq-item {
    padding: 10px 12px;
}

.jq-title {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.35;
}

.jq-sub {
    font-size: var(--fs-sm);
}

/* Dropdown status/footer line */
.jq-status {
    font-size: var(--fs-sm);
}

/* Locked JQ summary */
#jqTitle {
    font-size: var(--fs-md);
    font-weight: 600;
}

#jqMeta,
#jqCounts {
    font-size: var(--fs-sm);
}

/* Header actions (tenant badge, logout) look balanced at small/base) */
#tenantBadge {
    font-size: var(--fs-sm);
}

#jqLocked a.btn.ghost {
    font-size: var(--fs-sm);
    padding: 8px 14px;
}