/* ============================================================
   FINANCIAL OS — Utilities
   ============================================================ */

/* ---- 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-1    { flex: 1; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between{ justify-content: space-between; }
.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); }

/* ---- Grid ---- */
.grid-2  { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3  { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-cols-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }

/* ---- Spacing ---- */
.m-0  { margin: 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); }
.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); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ---- Width / Height ---- */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }

/* ---- Text ---- */
.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); }

.font-regular  { font-weight: var(--weight-regular); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-disabled  { color: var(--text-disabled); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-danger    { color: var(--color-danger); }
.text-info      { color: var(--brand-primary); }

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

.text-upper { text-transform: uppercase; letter-spacing: 0.6px; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-nowrap { white-space: nowrap; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ---- Border radius ---- */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded      { 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); }

/* ---- Background ---- */
.bg-surface { background: var(--bg-surface); }
.bg-subtle  { background: var(--bg-subtle); }
.bg-inset   { background: var(--bg-inset); }
.bg-success { background: var(--color-success-light); }
.bg-warning { background: var(--color-warning-light); }
.bg-danger  { background: var(--color-danger-light); }
.bg-info    { background: var(--color-info-light); }
.bg-brand   { background: var(--brand-primary-light); }

/* ---- Overflow ---- */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-x-auto  { overflow-x: auto; }

/* ---- Cursor ---- */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

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

/* ---- Borders ---- */
.border-bottom { border-bottom: 1px solid var(--border-subtle); }
.border-top    { border-top: 1px solid var(--border-subtle); }

/* ---- Visibility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Animation helpers ---- */
.fade-in { animation: fadeIn var(--transition-slow) ease; }
.slide-up { animation: slideUp var(--transition-slow) ease; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .hide-mobile { display: none !important; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}
