/* ── Display ──────────────────────────────────────────────── */
.d-none    { display: none !important; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-inline  { display: inline; }
.d-inline-flex { display: inline-flex; }

/* ── Flex ─────────────────────────────────────────────────── */
.flex-col    { flex-direction: column; }
.flex-row    { flex-direction: row; }
.flex-wrap   { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-1      { flex: 1; }
.flex-auto   { flex: auto; }
.flex-none   { flex: none; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.items-stretch{ align-items: stretch; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }
.self-start  { align-self: flex-start; }
.self-center { align-self: center; }
.self-end    { align-self: flex-end; }

/* ── Gap ──────────────────────────────────────────────────── */
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── Grid ─────────────────────────────────────────────────── */
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Spacing ──────────────────────────────────────────────── */
.m-0  { margin: 0; }        .m-auto { margin: auto; }
.mt-0 { margin-top: 0; }    .mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); } .mt-10 { margin-top: var(--space-10); }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); } .mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); } .mb-10 { margin-bottom: var(--space-10); }
.ml-auto { margin-left: auto; } .mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-0  { padding: 0; }        .p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); } .p-6  { padding: var(--space-6); }
.pt-0 { padding-top: 0; }    .pb-0 { padding-bottom: 0; }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }

/* ── Sizing ───────────────────────────────────────────────── */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }
.max-w-sm  { max-width: 480px; }
.max-w-md  { max-width: 640px; }
.max-w-lg  { max-width: 800px; }
.max-w-xl  { max-width: 1024px; }
.max-w-2xl { max-width: 1280px; }

/* ── Text alignment ───────────────────────────────────────── */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ── Font weight ──────────────────────────────────────────── */
.font-normal { font-weight: var(--weight-normal); }
.font-medium { font-weight: var(--weight-medium); }
.font-semi   { font-weight: var(--weight-semi); }
.font-bold   { font-weight: var(--weight-bold); }
.font-black  { font-weight: var(--weight-black); }

/* ── Font size ────────────────────────────────────────────── */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md   { font-size: var(--text-md); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

/* ── Colors ───────────────────────────────────────────────── */
.bg-surface    { background: var(--surface); }
.bg-secondary  { background: var(--bg-secondary); }
.bg-tertiary   { background: var(--bg-tertiary); }
.bg-brand      { background: var(--clr-brand); }
.bg-success    { background: var(--clr-success-bg); }
.bg-warning    { background: var(--clr-warning-bg); }
.bg-danger     { background: var(--clr-danger-bg); }
.bg-info       { background: var(--clr-info-bg); }

/* ── Border ───────────────────────────────────────────────── */
.border   { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-brand { border-color: var(--clr-brand); }
.border-none  { border: none; }

/* ── Border radius ────────────────────────────────────────── */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ── Shadows ──────────────────────────────────────────────── */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── Position ─────────────────────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* ── Cursor ───────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }

/* ── Opacity ──────────────────────────────────────────────── */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ── Transition ───────────────────────────────────────────── */
.transition { transition: all var(--duration-base) var(--ease-inout); }
.transition-fast { transition: all var(--duration-fast) var(--ease-out); }
.transition-slow { transition: all var(--duration-slow) var(--ease-out); }

/* ── Divider ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }
.divider-vertical { width: 1px; height: 24px; background: var(--border); }

/* ── Visibility ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) {
  .show-mobile { display: none !important; }
}
@media (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}
