/* INSTABUXX design system -- application layer.

   One palette for the whole product: the same ink / paper / green tokens the
   public site uses, refined for dense financial screens.  Layered on MDB5;
   every rule here overrides MDB's Material defaults (uppercase buttons, heavy
   shadows, coloured card headers) with a quieter, finance-grade look. */

:root {
  /* neutrals */
  --ibx-ink: #0f1e17;
  --ibx-ink-2: #3d5147;
  --ibx-ink-3: #6b7f74;
  --ibx-bg: #f5f7f6;
  --ibx-surface: #ffffff;
  --ibx-surface-2: #f7f9f8;
  --ibx-surface-3: #eef2ef;
  --ibx-line: #e3e9e5;
  --ibx-line-strong: #cdd7d1;

  /* brand */
  --ibx-primary: #14612f;
  --ibx-primary-hover: #0d4f25;
  --ibx-primary-soft: #e6f3ea;
  --ibx-primary-ring: rgba(20, 97, 47, .18);
  --ibx-accent: #f5a623;

  /* status -- foreground on a soft tint */
  --ibx-pending: #1d5fa8;   --ibx-pending-soft: #e8f0fa;
  --ibx-current: #17803d;   --ibx-current-soft: #e5f4ea;
  --ibx-default: #b42318;   --ibx-default-soft: #fdecea;
  --ibx-wallet:  #0f766e;   --ibx-wallet-soft:  #e3f4f2;
  --ibx-warn:    #b45309;   --ibx-warn-soft:    #fdf3e3;
  --ibx-neutral: #475569;   --ibx-neutral-soft: #eef1f4;

  --ibx-shadow-1: 0 1px 2px rgba(15, 30, 23, .05);
  --ibx-shadow-2: 0 1px 3px rgba(15, 30, 23, .06), 0 8px 24px rgba(15, 30, 23, .06);
  --ibx-shadow-3: 0 12px 32px rgba(15, 30, 23, .14);

  --ibx-radius-sm: 8px;
  --ibx-radius: 12px;
  --ibx-radius-lg: 16px;
  --ibx-topbar-h: 64px;
  --ibx-sidenav-width: 248px;

  --ibx-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* legacy aliases still referenced by a few templates */
  --ibx-on-surface: var(--ibx-ink);
  --ibx-on-surface-muted: var(--ibx-ink-3);
  --ibx-outline: var(--ibx-line);
  --ibx-success: var(--ibx-current);
  --ibx-danger: var(--ibx-default);
  --ibx-info: var(--ibx-pending);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ibx-ink: #e8f0eb; --ibx-ink-2: #b9c8bf; --ibx-ink-3: #8ea198;
    --ibx-bg: #0d1310; --ibx-surface: #141c18; --ibx-surface-2: #18211c;
    --ibx-surface-3: #1e2923; --ibx-line: #24302a; --ibx-line-strong: #33433a;
    --ibx-primary: #4fbf74; --ibx-primary-hover: #6fd18f;
    --ibx-primary-soft: #16301f; --ibx-primary-ring: rgba(79, 191, 116, .25);
    --ibx-pending: #7fb2ec; --ibx-pending-soft: #15243a;
    --ibx-current: #5fcb85; --ibx-current-soft: #13301e;
    --ibx-default: #f2877d; --ibx-default-soft: #3a1714;
    --ibx-wallet: #5fd0c5;  --ibx-wallet-soft: #10302d;
    --ibx-warn: #f0b467;    --ibx-warn-soft: #33240f;
    --ibx-neutral: #a3b1c2; --ibx-neutral-soft: #1d242c;
    --ibx-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --ibx-shadow-2: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --ibx-ink: #e8f0eb; --ibx-ink-2: #b9c8bf; --ibx-ink-3: #8ea198;
  --ibx-bg: #0d1310; --ibx-surface: #141c18; --ibx-surface-2: #18211c;
  --ibx-surface-3: #1e2923; --ibx-line: #24302a; --ibx-line-strong: #33433a;
  --ibx-primary: #4fbf74; --ibx-primary-hover: #6fd18f;
  --ibx-primary-soft: #16301f; --ibx-primary-ring: rgba(79, 191, 116, .25);
  --ibx-pending: #7fb2ec; --ibx-pending-soft: #15243a;
  --ibx-current: #5fcb85; --ibx-current-soft: #13301e;
  --ibx-default: #f2877d; --ibx-default-soft: #3a1714;
  --ibx-wallet: #5fd0c5;  --ibx-wallet-soft: #10302d;
  --ibx-warn: #f0b467;    --ibx-warn-soft: #33240f;
  --ibx-neutral: #a3b1c2; --ibx-neutral-soft: #1d242c;
}

/* ================================================================== base */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ibx-font);
  font-feature-settings: 'cv11', 'ss01';
  background-color: var(--ibx-bg);
  color: var(--ibx-ink);
  font-size: .9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--ibx-ink);
  font-weight: 650;
  letter-spacing: -.015em;
}

a { color: var(--ibx-primary); text-decoration: none; }
a:hover { color: var(--ibx-primary-hover); }

.text-muted, .text-muted-2 { color: var(--ibx-ink-3) !important; }
.num, .ibx-num { font-variant-numeric: tabular-nums; }
.fw-bold { font-weight: 650 !important; }
.text-success { color: var(--ibx-current) !important; }
.text-danger { color: var(--ibx-default) !important; }

::selection { background: var(--ibx-primary-soft); }

:focus-visible {
  outline: 2px solid var(--ibx-primary);
  outline-offset: 2px;
}

/* ================================================================ top bar */
.ibx-appbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--ibx-topbar-h);
  background: color-mix(in srgb, var(--ibx-surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--ibx-line);
  box-shadow: none;
}

.ibx-appbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem;
}

.ibx-appbar__brand img { height: 32px; width: auto; display: block; }

.ibx-appbar__spacer { flex: 1 1 auto; }

.ibx-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ibx-ink-2);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ibx-icon-btn:hover { background: var(--ibx-surface-3); color: var(--ibx-ink); }
.ibx-icon-btn .material-icons { font-size: 21px; }

.ibx-nav-toggle { display: none; }

.ibx-user {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .25rem .5rem .25rem .25rem;
  border-radius: 999px;
}

.ibx-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ibx-primary-soft);
  color: var(--ibx-primary);
  font-weight: 650;
  font-size: .8rem;
  letter-spacing: .02em;
  flex: none;
}

.ibx-user__name { font-weight: 600; font-size: .875rem; line-height: 1.15; color: var(--ibx-ink); }
.ibx-user__role { font-size: .75rem; color: var(--ibx-ink-3); line-height: 1.15; }

/* Legacy app bar markup (signed-out pages that still extend base.html) */
.ibx-appbar .nav-link, .ibx-appbar .navbar-text { color: var(--ibx-ink-2) !important; }
.ibx-appbar .nav-link:hover { color: var(--ibx-ink) !important; }
.ibx-brand-mark { height: 32px; width: auto; }

/* ================================================================ sidenav */
.ibx-layout { display: flex; flex: 1 0 auto; min-height: 0; }

.ibx-sidenav {
  position: sticky;
  top: var(--ibx-topbar-h);
  align-self: flex-start;
  width: var(--ibx-sidenav-width);
  flex: 0 0 var(--ibx-sidenav-width);
  height: calc(100vh - var(--ibx-topbar-h));
  overflow-y: auto;
  background-color: var(--ibx-surface);
  border-right: 1px solid var(--ibx-line);
  padding: .75rem .75rem 1.5rem;
  scrollbar-width: thin;
}

.ibx-sidenav__section {
  padding: 1.1rem .75rem .4rem;
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ibx-ink-3);
  font-weight: 600;
}
.ibx-sidenav__section:first-child { padding-top: .5rem; }

.ibx-sidenav a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .75rem;
  margin: 1px 0;
  color: var(--ibx-ink-2);
  font-size: .875rem;
  font-weight: 500;
  border-radius: var(--ibx-radius-sm);
  transition: background-color .12s ease, color .12s ease;
}

.ibx-sidenav a .material-icons { font-size: 19px; color: var(--ibx-ink-3); transition: color .12s ease; }
.ibx-sidenav a:hover { background-color: var(--ibx-surface-3); color: var(--ibx-ink); }
.ibx-sidenav a:hover .material-icons { color: var(--ibx-ink-2); }

.ibx-sidenav a.active {
  background-color: var(--ibx-primary-soft);
  color: var(--ibx-primary);
  font-weight: 600;
}
.ibx-sidenav a.active .material-icons { color: var(--ibx-primary); }

.ibx-sidenav .badge {
  margin-left: auto;
  background: var(--ibx-default) !important;
  font-size: .6875rem;
  font-weight: 650;
  padding: .2rem .45rem;
  border-radius: 999px;
}

.ibx-scrim { display: none; }

/* ================================================================ content */
.ibx-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.75rem 2rem 2.5rem;
  max-width: 1480px;
}

.ibx-page-head {
  display: flex;
  flex-direction: column-reverse;
  gap: .25rem;
  margin-bottom: 1.5rem;
}
.ibx-page-head h1 {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0;
  line-height: 1.2;
}
.ibx-breadcrumb {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ibx-ink-3);
}
.ibx-breadcrumb:empty { display: none; }

/* Section titles inside a page (h2.h6.text-uppercase and friends) */
.ibx-content h2.h6, .ibx-content .h6.text-uppercase {
  font-size: .75rem !important;
  letter-spacing: .08em;
  font-weight: 650;
  color: var(--ibx-ink-3) !important;
  margin-top: .5rem;
}
.ibx-content > h2, .ibx-content > h3, .ibx-content h2.h5, .ibx-content .h5 {
  font-size: 1.0625rem;
  font-weight: 650;
}

/* ================================================================== cards */
.card {
  background-color: var(--ibx-surface);
  color: var(--ibx-ink);
  border: 1px solid var(--ibx-line);
  border-radius: var(--ibx-radius);
  box-shadow: var(--ibx-shadow-1);
}
.card:hover { box-shadow: var(--ibx-shadow-1); }

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--ibx-line);
  padding: .9rem 1.25rem;
  font-weight: 600;
  font-size: .9375rem;
  color: var(--ibx-ink);
}
.card-header .material-icons { color: var(--ibx-ink-3); font-size: 19px !important; }
.card-body { padding: 1.25rem; }
.card-footer { background: var(--ibx-surface-2); border-top: 1px solid var(--ibx-line); }

/* -------------------------------------------------------------- stat tile
   The header is a quiet label with a tinted icon badge; colour carries the
   status, the numbers carry the weight. */
.ibx-stat {
  position: relative;
  height: 100%;
  background-color: var(--ibx-surface);
  border: 1px solid var(--ibx-line);
  border-radius: var(--ibx-radius);
  box-shadow: var(--ibx-shadow-1);
  overflow: hidden;
  --tone: var(--ibx-neutral);
  --tone-soft: var(--ibx-neutral-soft);
}

.ibx-stat__head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: 1rem 1.125rem .25rem;
  color: var(--ibx-ink-2);
  background: transparent !important;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: 0;
}

.ibx-stat__head .material-icons {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 17px;
  color: var(--tone);
  background: var(--tone-soft);
  flex: none;
}

.ibx-stat__body { padding: .5rem 1.125rem 1rem; }

.ibx-stat__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: .3rem 0;
  font-size: .875rem;
  border-top: 1px dashed transparent;
}
.ibx-stat__row + .ibx-stat__row { border-top-color: var(--ibx-line); }
.ibx-stat__row span:first-child { color: var(--ibx-ink-3); }
.ibx-stat__row span:last-child {
  font-weight: 600;
  color: var(--ibx-ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* The last row of a tile is its headline figure. */
.ibx-stat__row:last-child span:last-child { font-size: 1rem; font-weight: 700; }

.ibx-stat--current { --tone: var(--ibx-current); --tone-soft: var(--ibx-current-soft); }
.ibx-stat--pending { --tone: var(--ibx-pending); --tone-soft: var(--ibx-pending-soft); }
.ibx-stat--default { --tone: var(--ibx-default); --tone-soft: var(--ibx-default-soft); }
.ibx-stat--wallet  { --tone: var(--ibx-wallet);  --tone-soft: var(--ibx-wallet-soft); }
.ibx-stat--neutral { --tone: var(--ibx-neutral); --tone-soft: var(--ibx-neutral-soft); }

/* A thin status rule along the top edge. */
.ibx-stat::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tone);
  opacity: .85;
}

/* ================================================================ buttons */
.btn {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--ibx-font);
  font-weight: 600;
  font-size: .875rem;
  line-height: 1.25;
  padding: .55rem 1rem;
  border-radius: var(--ibx-radius-sm);
  box-shadow: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover, .btn:focus, .btn:active { box-shadow: none !important; }
.btn-sm { font-size: .8125rem; padding: .35rem .7rem; border-radius: 7px; }
.btn-lg { font-size: .9375rem; padding: .75rem 1.25rem; border-radius: 10px; }
.btn .material-icons { font-size: 17px; vertical-align: -3px; }

.btn-success, .btn-primary {
  background-color: var(--ibx-primary);
  border: 1px solid var(--ibx-primary);
  color: #fff;
}
.btn-success:hover, .btn-primary:hover,
.btn-success:focus, .btn-primary:focus {
  background-color: var(--ibx-primary-hover);
  border-color: var(--ibx-primary-hover);
  color: #fff;
}

.btn-warning { background-color: var(--ibx-accent); border: 1px solid var(--ibx-accent); color: #2b1d00; }
.btn-warning:hover { background-color: #e4961a; color: #2b1d00; }

.btn-danger { background-color: var(--ibx-default); border: 1px solid var(--ibx-default); color: #fff; }

.btn-light, .btn-secondary {
  background: var(--ibx-surface);
  border: 1px solid var(--ibx-line-strong);
  color: var(--ibx-ink);
}
.btn-light:hover, .btn-secondary:hover { background: var(--ibx-surface-3); color: var(--ibx-ink); }

[class*="btn-outline-"] {
  background: var(--ibx-surface);
  border-width: 1px !important;
  border-style: solid;
}
.btn-outline-primary, .btn-outline-success {
  border-color: var(--ibx-line-strong); color: var(--ibx-primary);
}
.btn-outline-primary:hover, .btn-outline-success:hover {
  background: var(--ibx-primary-soft); border-color: var(--ibx-primary); color: var(--ibx-primary);
}
.btn-outline-secondary, .btn-outline-dark {
  border-color: var(--ibx-line-strong); color: var(--ibx-ink-2);
}
.btn-outline-secondary:hover, .btn-outline-dark:hover {
  background: var(--ibx-surface-3); border-color: var(--ibx-ink-3); color: var(--ibx-ink);
}
.btn-outline-danger { border-color: color-mix(in srgb, var(--ibx-default) 35%, var(--ibx-line)); color: var(--ibx-default); }
.btn-outline-danger:hover { background: var(--ibx-default-soft); border-color: var(--ibx-default); color: var(--ibx-default); }
.btn-outline-warning { border-color: color-mix(in srgb, var(--ibx-warn) 35%, var(--ibx-line)); color: var(--ibx-warn); }
.btn-outline-warning:hover { background: var(--ibx-warn-soft); border-color: var(--ibx-warn); color: var(--ibx-warn); }
.btn-outline-info { border-color: color-mix(in srgb, var(--ibx-pending) 30%, var(--ibx-line)); color: var(--ibx-pending); }
.btn-outline-info:hover { background: var(--ibx-pending-soft); border-color: var(--ibx-pending); color: var(--ibx-pending); }

/* Action buttons in table rows sit close together. */
td .btn-sm + .btn-sm, td .btn-sm + form, td form + .btn-sm { margin-left: .25rem; }

/* ================================================================== tables */
.table-responsive { border-radius: var(--ibx-radius); }
.card > .table-responsive, .card-body > .table-responsive:only-child { border-radius: 0 0 var(--ibx-radius) var(--ibx-radius); }

.ibx-table, .table {
  --mdb-table-bg: transparent;
  background-color: var(--ibx-surface);
  color: var(--ibx-ink);
  margin-bottom: 0;
  font-size: .875rem;
}

.ibx-table > thead, .table > thead { background-color: var(--ibx-surface-2); }

.ibx-table > thead th, .table > thead th {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ibx-ink-3);
  font-weight: 650;
  white-space: nowrap;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--ibx-line);
  border-top: 0;
}

.ibx-table > tbody td, .ibx-table > tbody th,
.table > tbody td, .table > tbody th {
  vertical-align: middle;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--ibx-line);
  color: var(--ibx-ink);
}
/* Cells stay on one line; wide tables scroll inside .table-responsive.
   Long free text (message bodies) opts back in with .text-wrap. */
.ibx-table > tbody td, .ibx-table > tbody th { white-space: nowrap; }
.ibx-table > tbody td.text-wrap, .ibx-table > tbody td.ibx-wrap { white-space: normal; min-width: 16rem; }
.ibx-table > tbody th[scope="row"] { color: var(--ibx-ink-3); font-weight: 500; }
.ibx-table > tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background-color: var(--ibx-surface-2); --mdb-table-accent-bg: transparent; }

.ibx-table td.num, .ibx-table th.num, .table td.num, .table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ibx-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ibx-ink-3);
}
.ibx-empty .material-icons { display: block; font-size: 32px; margin: 0 auto .5rem; opacity: .6; }

/* ------------------------------------------------------------ DataTables */
.dataTables_wrapper { color: var(--ibx-ink); font-size: .875rem; }
.dataTables_wrapper .row:first-child, .dataTables_wrapper .row:last-child { padding: .75rem 1rem; margin: 0; }
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--ibx-line-strong);
  border-radius: var(--ibx-radius-sm);
  background: var(--ibx-surface);
  color: var(--ibx-ink);
  padding: .35rem .6rem;
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--ibx-primary); box-shadow: 0 0 0 3px var(--ibx-primary-ring); }
.dataTables_info { color: var(--ibx-ink-3) !important; }
.page-link { border: 1px solid var(--ibx-line); color: var(--ibx-ink-2); border-radius: 7px !important; margin: 0 2px; background: var(--ibx-surface); }
.page-item.active .page-link { background: var(--ibx-primary); border-color: var(--ibx-primary); color: #fff; }
table.dataTable tbody tr { background-color: var(--ibx-surface); }

/* ==================================================================== tabs */
.nav-tabs {
  border-bottom: 1px solid var(--ibx-line);
  gap: .25rem;
}
.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ibx-ink-3);
  font-size: .875rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: .85rem 1rem;
  margin-bottom: -1px;
}
.nav-tabs .nav-link:hover { color: var(--ibx-ink); border-bottom-color: var(--ibx-line-strong); background: transparent; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
  color: var(--ibx-primary);
  border-bottom-color: var(--ibx-primary);
  background: transparent;
}
.nav-tabs .badge {
  margin-left: .35rem;
  font-size: .6875rem;
  font-weight: 650;
  border-radius: 999px;
  padding: .18rem .45rem;
  background: var(--ibx-surface-3) !important;
  color: var(--ibx-ink-2) !important;
}
.nav-tabs .nav-link.active .badge { background: var(--ibx-primary-soft) !important; color: var(--ibx-primary) !important; }

/* =================================================================== forms */
.ibx-form-card { max-width: 720px; margin: 0 auto; }
.ibx-form-card .card-body { padding: 1.75rem; }

.form-label { font-weight: 600; font-size: .8125rem; color: var(--ibx-ink-2); margin-bottom: .35rem; }

.form-control, .form-select {
  background-color: var(--ibx-surface);
  color: var(--ibx-ink);
  border: 1px solid var(--ibx-line-strong);
  border-radius: var(--ibx-radius-sm);
  padding: .6rem .8rem;
  font-size: .9375rem;
  min-height: 42px;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: var(--ibx-ink-3); opacity: .8; }
.form-control:hover, .form-select:hover { border-color: var(--ibx-ink-3); }
.form-control:focus, .form-select:focus {
  background-color: var(--ibx-surface);
  color: var(--ibx-ink);
  border-color: var(--ibx-primary);
  box-shadow: 0 0 0 3px var(--ibx-primary-ring);
}
textarea.form-control { min-height: 110px; }
.form-text { font-size: .8125rem; }
.form-check-input:checked { background-color: var(--ibx-primary); border-color: var(--ibx-primary); }
.form-range::-webkit-slider-thumb { background: var(--ibx-primary); }
.form-range::-moz-range-thumb { background: var(--ibx-primary); }
.invalid-feedback.d-block { font-size: .8125rem; color: var(--ibx-default); }

/* Plain inputs rendered without a class by Django widgets */
.ibx-content input[type=text]:not(.form-control), .ibx-content input[type=number]:not(.form-control),
.ibx-content input[type=email]:not(.form-control), .ibx-content input[type=password]:not(.form-control),
.ibx-content input[type=datetime-local]:not(.form-control), .ibx-content select:not(.form-select):not([class*=dataTables]),
.ibx-content textarea:not(.form-control) {
  width: 100%;
  background: var(--ibx-surface);
  color: var(--ibx-ink);
  border: 1px solid var(--ibx-line-strong);
  border-radius: var(--ibx-radius-sm);
  padding: .6rem .8rem;
  font-size: .9375rem;
}

/* =================================================================== chips */
.ibx-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ibx-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.ibx-chip--current { background: var(--ibx-current-soft); color: var(--ibx-current); }
.ibx-chip--pending { background: var(--ibx-pending-soft); color: var(--ibx-pending); }
.ibx-chip--default { background: var(--ibx-default-soft); color: var(--ibx-default); }
.ibx-chip--muted   { background: var(--ibx-neutral-soft); color: var(--ibx-neutral); }

.badge { font-weight: 650; letter-spacing: 0; border-radius: 6px; }

/* ================================================================== alerts */
.alert {
  border: 1px solid transparent;
  border-radius: var(--ibx-radius);
  padding: .85rem 1rem;
  font-size: .875rem;
  box-shadow: none;
}
.alert .material-icons { font-size: 20px !important; }
.alert-success { background: var(--ibx-current-soft); color: var(--ibx-current); border-color: color-mix(in srgb, var(--ibx-current) 20%, transparent); }
.alert-info, .alert-primary { background: var(--ibx-pending-soft); color: var(--ibx-pending); border-color: color-mix(in srgb, var(--ibx-pending) 20%, transparent); }
.alert-warning { background: var(--ibx-warn-soft); color: var(--ibx-warn); border-color: color-mix(in srgb, var(--ibx-warn) 22%, transparent); }
.alert-danger { background: var(--ibx-default-soft); color: var(--ibx-default); border-color: color-mix(in srgb, var(--ibx-default) 20%, transparent); }
.alert-secondary { background: var(--ibx-neutral-soft); color: var(--ibx-neutral); }
.alert strong { color: inherit; }
.alert .btn-close { opacity: .5; }

.ibx-flash {
  position: fixed;
  top: calc(var(--ibx-topbar-h) + .75rem);
  right: 1rem;
  z-index: 1080;
  width: min(420px, calc(100vw - 2rem));
  display: grid;
  gap: .5rem;
}
.ibx-flash .alert {
  margin: 0;
  background-color: var(--ibx-surface);
  box-shadow: var(--ibx-shadow-3);
  border-color: var(--ibx-line);
  color: var(--ibx-ink);
  border-left: 3px solid var(--ibx-pending);
}
.ibx-flash .alert-success { border-left-color: var(--ibx-current); }
.ibx-flash .alert-danger { border-left-color: var(--ibx-default); }
.ibx-flash .alert-warning { border-left-color: var(--ibx-warn); }
.ibx-flash .alert .material-icons { color: var(--ibx-pending); }
.ibx-flash .alert-success .material-icons { color: var(--ibx-current); }
.ibx-flash .alert-danger .material-icons { color: var(--ibx-default); }
.ibx-flash .alert-warning .material-icons { color: var(--ibx-warn); }

/* ===================================================== list / description */
dl.row dt { font-weight: 500; }
dl.row dd { font-weight: 500; color: var(--ibx-ink); }
.list-group-item { background: var(--ibx-surface); color: var(--ibx-ink); border-color: var(--ibx-line); }

/* ================================================================== footer */
.ibx-footer {
  background: transparent;
  color: var(--ibx-ink-3);
  border-top: 1px solid var(--ibx-line);
  padding: 1rem 2rem;
  font-size: .8125rem;
  margin-top: auto;
}
.ibx-footer strong { color: var(--ibx-ink-2); font-weight: 600; }
.ibx-footer a { color: var(--ibx-ink-2); }
.ibx-footer a:hover { color: var(--ibx-primary); }

/* ==================================================================== hero */
.ibx-hero { border-radius: var(--ibx-radius-lg); overflow: hidden; box-shadow: var(--ibx-shadow-2); background-size: cover; background-position: center; }
.ibx-hero__scrim { background: linear-gradient(0deg, rgba(0,0,0,.62), rgba(0,0,0,.38)); padding: 3rem 1.5rem; color: #fff; text-align: center; }

/* ============================================================== responsive */
@media (max-width: 991.98px) {
  .ibx-nav-toggle { display: inline-grid; }
  .ibx-user__text { display: none; }

  .ibx-sidenav {
    position: fixed;
    top: var(--ibx-topbar-h);
    left: 0;
    bottom: 0;
    height: auto;
    z-index: 1040;
    /* Closed: off-canvas, unshadowed and out of the tab order. */
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
  }
  body.ibx-nav-open .ibx-sidenav {
    transform: none;
    visibility: visible;
    box-shadow: var(--ibx-shadow-3);
    transition: transform .22s ease;
  }

  .ibx-scrim {
    position: fixed;
    inset: var(--ibx-topbar-h) 0 0 0;
    z-index: 1035;
    background: rgba(15, 30, 23, .35);
  }
  body.ibx-nav-open .ibx-scrim { display: block; }

  .ibx-content { padding: 1.25rem 1rem 2rem; }
  .ibx-page-head h1 { font-size: 1.375rem; }
  .ibx-footer { padding: 1rem; }
}

@media (max-width: 575.98px) {
  .ibx-appbar__inner { padding: 0 .75rem; gap: .5rem; }
  .ibx-appbar__apply-label { display: none; }
  .card-body { padding: 1rem; }
  .ibx-table > thead th, .ibx-table > tbody td, .ibx-table > tbody th { padding: .65rem .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .ibx-appbar, .ibx-sidenav, .ibx-footer, .ibx-flash { display: none !important; }
  .ibx-content { padding: 0; }
}
