/* =============================================================
   utilities.css — small, atomic utility classes
   -------------------------------------------------------------
   Replaces the majority of inline `style=""` attributes so the
   CSP can forbid `style-src-attr 'unsafe-inline'`.
   All colour tokens come from themes.css.
   ============================================================= */

/* ---------- Display ---------- */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.d-inline-flex {
    display: inline-flex !important;
}

.d-grid {
    display: grid !important;
}

/* ---------- Flex ---------- */
.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
    min-width: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-baseline {
    align-items: baseline;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

/* ---------- Gaps ---------- */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-5 {
    gap: 1.5rem;
}

/* ---------- Margins ---------- */
.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-5 {
    margin-top: 1.5rem;
}

.mt-6 {
    margin-top: 2rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-5 {
    margin-bottom: 1.5rem;
}

.mb-6 {
    margin-bottom: 2rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Padding ---------- */
.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.5rem;
}

.p-6 {
    padding: 2rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-5 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ---------- Text ---------- */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

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

.text-accent {
    color: var(--accent);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--emerald);
}

.text-white {
    color: #fff;
}

.fw-600 {
    font-weight: 600;
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.fs-xs {
    font-size: 0.75rem;
}

.fs-sm {
    font-size: 0.85rem;
}

.fs-md {
    font-size: 0.95rem;
}

.fs-lg {
    font-size: 1.05rem;
}

.fs-xl {
    font-size: 1.25rem;
}

.fs-2xl {
    font-size: 1.5rem;
}

.fs-3xl {
    font-size: 2rem;
}

.lh-16 {
    line-height: 1.6;
}

.lh-15 {
    line-height: 1.5;
}

/* ---------- Sizing ---------- */
.w-100 {
    width: 100%;
}

.min-w-0 {
    min-width: 0;
}

.mw-260 {
    min-width: 260px;
}

.mw-210 {
    min-width: 210px;
}

.mw-180 {
    min-width: 180px;
}

.mw-200 {
    min-width: 200px;
}

.mw-420 {
    max-width: 420px;
}

/* ---------- Borders / radius ---------- */
.rounded {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 9999px;
}

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

/* ---------- Position ---------- */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* ---------- Text overflow ---------- */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-break {
    word-break: break-all;
}

/* ---------- Misc ---------- */
.pointer {
    cursor: pointer;
}

.overflow-auto {
    overflow: auto;
}

.col-span-full {
    grid-column: 1 / -1;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Layout helpers used across views ---------- */
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flex-col-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flex-col-stack-3 {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.flex-row-wrap {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Standard "hidden but still in a11y tree" ---------- */
[hidden] {
    display: none !important;
}