:root {
  --idc-primary: #0f766e;
  --idc-primary-hover: #0b5f59;
  --idc-primary-soft: #e7f5f2;
  --idc-accent: #4f46e5;
  --idc-accent-soft: #eef2ff;
  --idc-sidebar: #202733;
  --idc-sidebar-hover: #2c3646;
  --idc-bg: #f6f7fb;
  --idc-surface: #ffffff;
  --idc-surface-subtle: #f9fafb;
  --idc-border: #dce3ec;
  --idc-border-strong: #c8d2df;
  --idc-text: #243041;
  --idc-heading: #111827;
  --idc-muted: #657386;
  --idc-success: #14804a;
  --idc-warning: #a15c07;
  --idc-danger: #b42318;
  --idc-info: #2454c6;
  --idc-shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --idc-shadow-md: 0 10px 30px rgba(17, 24, 39, .08);
  --sidebar-width: 264px;
  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  scroll-padding-top: 76px;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .045), transparent 280px),
    var(--idc-bg);
  color: var(--idc-text);
  font-family: "Manrope", "Noto Sans Georgian", system-ui, sans-serif;
  font-size: .94rem;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(15, 118, 110, .18);
}

a {
  color: var(--idc-primary);
  text-decoration: none;
  font-weight: 650;
}

a:hover {
  color: var(--idc-primary-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .26);
  outline-offset: 2px;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  display: flex;
  width: var(--sidebar-width);
  overflow-y: auto;
  flex-direction: column;
  padding-bottom: 1rem;
  background: var(--idc-sidebar);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-brand {
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.05rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.sidebar-brand:hover {
  color: #fff;
  text-decoration: none;
}

.app-nav {
  gap: 3px;
  padding: .35rem .75rem 1rem;
}

.app-nav .nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 40px;
  padding: .58rem .78rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-nav .nav-link i {
  width: 1.22rem;
  color: #9fb0c4;
  font-size: 1.05rem;
  text-align: center;
}

.app-nav .nav-link:hover {
  background: var(--idc-sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.app-nav .nav-link:hover i,
.app-nav .nav-link.active i {
  color: #fff;
}

.app-nav .nav-link.active {
  background: rgba(15, 118, 110, .92);
  color: #fff;
  box-shadow: inset 3px 0 0 #5eead4;
}

.nav-section {
  padding: .95rem .78rem .35rem;
  color: #8190a4;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  list-style: none;
  text-transform: uppercase;
}

.nav-section:empty {
  padding-top: .5rem;
}

.app-offcanvas {
  width: 286px;
  background: var(--idc-sidebar);
}

.app-offcanvas .offcanvas-header {
  min-height: 68px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

/* ---------- Main / topbar ---------- */
.app-main {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin-left: 0;
}

@media (min-width: 992px) {
  .app-main { margin-left: var(--sidebar-width); }
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid var(--idc-border);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(140%) blur(10px);
}

.topbar-title {
  max-width: min(58vw, 680px);
  color: var(--idc-heading);
  font-size: 1.02rem;
  font-weight: 800;
}

.avatar-circle {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--idc-primary), var(--idc-accent));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
}

.app-content {
  width: 100%;
  max-width: 1640px;
  padding: 1.15rem 1rem 3rem;
}

@media (min-width: 992px) {
  .app-content { padding: 1.45rem 1.65rem 3rem; }
}

@media (min-width: 1440px) {
  .app-content { padding-right: 2rem; padding-left: 2rem; }
}

/* ---------- Page structure ---------- */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-bottom: 1rem;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--idc-border);
}

.page-header h1 {
  max-width: 960px;
  margin: 0;
  color: var(--idc-heading);
  font-size: 1.42rem;
  font-weight: 850;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.page-header .status-badge,
.page-header .badge {
  margin-top: .15rem;
}

.page-header > .ms-auto,
.page-header .ms-auto.d-flex {
  align-items: center;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .25rem 0 .55rem;
  color: var(--idc-muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--idc-primary);
}

.dashboard-shell {
  display: grid;
  gap: 1rem;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 1rem;
  align-items: stretch;
}

.dashboard-welcome {
  display: flex;
  min-height: 184px;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(79, 70, 229, .08)),
    var(--idc-surface);
  box-shadow: var(--idc-shadow-sm);
}

.dashboard-welcome h1 {
  max-width: 760px;
  margin: 0;
  color: var(--idc-heading);
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.25;
}

.dashboard-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.dashboard-finance {
  display: grid;
  gap: .65rem;
}

.dashboard-money-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
  min-height: 54px;
  padding: .8rem .9rem;
  border: 1px solid var(--idc-border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--idc-shadow-sm);
}

.dashboard-money-card:hover {
  border-color: rgba(15, 118, 110, .35);
  box-shadow: var(--idc-shadow-md);
  text-decoration: none;
}

.dashboard-money-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--idc-primary-soft);
  color: var(--idc-primary);
  font-size: 1.05rem;
}

.dashboard-money-label {
  display: block;
  color: var(--idc-muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.dashboard-money-value {
  display: block;
  margin-top: .15rem;
  color: var(--idc-heading);
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.2;
}

.dashboard-section {
  display: grid;
  gap: .65rem;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-section-header .section-kicker {
  margin: 0;
}

.dashboard-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.dashboard-queue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.queue-card {
  min-height: 100%;
}

.queue-card .list-group-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}

.queue-card .list-group-item > div {
  min-width: 0;
}

.queue-card .list-group-item .fw-semibold {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1199.98px) {
  .dashboard-hero,
  .dashboard-queue-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .dashboard-welcome {
    min-height: 0;
    padding: 1rem;
  }

  .dashboard-welcome h1 {
    font-size: 1.14rem;
  }

  .dashboard-welcome-actions .btn {
    flex: 1 1 calc(50% - .55rem);
  }

  .dashboard-metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header > .ms-auto,
  .page-header .ms-auto.d-flex {
    width: 100%;
    margin-left: 0 !important;
  }

  .page-header .btn {
    flex: 1 1 auto;
  }

  .topbar-title { max-width: 42vw; }
}

/* ---------- Buttons / dropdowns ---------- */
.btn:not(.btn-close):not(.btn-link) {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.btn-sm:not(.btn-close):not(.btn-link) {
  min-height: 32px;
  padding: .32rem .62rem;
  font-size: .82rem;
}

.btn i {
  line-height: 1;
}

.btn-icon {
  min-height: 38px;
  border: 1px solid var(--idc-border);
  background: #fff;
  color: var(--idc-text);
}

.btn-icon:hover,
.btn-icon.show {
  border-color: rgba(15, 118, 110, .35);
  background: var(--idc-primary-soft);
  color: var(--idc-primary-hover);
}

.btn-primary {
  border-color: var(--idc-primary);
  background: var(--idc-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 118, 110, .22);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--idc-primary-hover);
  background: var(--idc-primary-hover);
  color: #fff;
}

.btn-outline-primary {
  border-color: rgba(15, 118, 110, .45);
  color: var(--idc-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  border-color: var(--idc-primary);
  background: var(--idc-primary);
  color: #fff;
}

.btn-outline-secondary {
  border-color: var(--idc-border-strong);
  color: #4b5563;
  background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  border-color: #aeb9c7;
  background: #f3f6f9;
  color: var(--idc-heading);
}

.btn-outline-danger {
  border-color: rgba(180, 35, 24, .35);
  color: var(--idc-danger);
  background: #fff;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  border-color: var(--idc-danger);
  background: var(--idc-danger);
  color: #fff;
}

.btn-outline-success {
  border-color: rgba(20, 128, 74, .36);
  color: var(--idc-success);
  background: #fff;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
  border-color: var(--idc-success);
  background: var(--idc-success);
  color: #fff;
}

.btn-success {
  border-color: var(--idc-success);
  background: var(--idc-success);
}

.dropdown-menu {
  border: 1px solid var(--idc-border);
  border-radius: var(--radius);
  box-shadow: var(--idc-shadow-md);
}

.dropdown-item {
  font-weight: 650;
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--idc-primary);
}

/* ---------- Cards / lists / tables ---------- */
.card {
  border: 1px solid var(--idc-border);
  border-radius: var(--radius);
  background: var(--idc-surface);
  box-shadow: var(--idc-shadow-sm);
}

.card-header {
  min-height: 46px;
  padding: .78rem .95rem;
  border-bottom: 1px solid var(--idc-border);
  border-radius: var(--radius) var(--radius) 0 0 !important;
  background: #fff;
  color: var(--idc-heading);
  font-weight: 850;
}

.card-body {
  padding: 1rem;
}

.list-group-item {
  padding: .82rem .95rem;
  border-color: var(--idc-border);
  color: var(--idc-text);
}

a.list-group-item:hover,
.list-group-item-action:hover {
  background: var(--idc-primary-soft);
  color: var(--idc-text);
  text-decoration: none;
}

.table {
  --bs-table-hover-bg: #f7fbfa;
  margin-bottom: 0;
  color: var(--idc-text);
}

.table > :not(caption) > * > * {
  padding: .72rem .8rem;
  border-bottom-color: var(--idc-border);
}

.table-sm > :not(caption) > * > * {
  padding: .5rem .58rem;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--idc-border-strong);
  background: var(--idc-surface-subtle);
  color: var(--idc-muted);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-responsive {
  scrollbar-color: #aeb9c7 transparent;
}

.card > .table-responsive:first-child,
.card > .table-responsive:first-child .table {
  border-radius: var(--radius);
}

.table-row-link {
  cursor: pointer;
}

.table-row-link:hover td {
  background: var(--bs-table-hover-bg);
}

.table-row-link:hover td:first-child {
  color: var(--idc-primary);
}

.table-row-link:focus-visible td {
  background: var(--idc-primary-soft);
}

.text-money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* stat cards */
.stat-card {
  position: relative;
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  gap: .35rem;
  padding: .95rem 1rem;
  overflow: hidden;
  border-top: 3px solid var(--idc-primary);
}

a.stat-card:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, .35);
  box-shadow: var(--idc-shadow-md);
  text-decoration: none;
}

.row > [class*="col"]:nth-child(3n+2) .stat-card {
  border-top-color: var(--idc-accent);
}

.row > [class*="col"]:nth-child(3n) .stat-card {
  border-top-color: #c2410c;
}

.stat-card .stat-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: var(--idc-muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.stat-card .stat-label i {
  color: var(--idc-primary);
  font-size: 1rem;
}

.stat-card .stat-value {
  color: var(--idc-heading);
  font-size: 1.42rem;
  font-weight: 850;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.stat-card .stat-sub {
  color: var(--idc-muted);
  font-size: .8rem;
}

/* ---------- Status badges ---------- */
.badge.text-bg-light {
  border: 1px solid var(--idc-border);
  background: #fff !important;
  color: var(--idc-muted) !important;
  font-weight: 850;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: .24rem .62rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.st-draft,
.st-inactive,
.st-archived,
.st-dismissed {
  border-color: #d7dde5;
  background: #f1f3f6;
  color: #556070;
}

.st-active,
.st-paid,
.st-won,
.st-done,
.st-completed,
.st-fully_invoiced {
  border-color: #b8e6ca;
  background: #e8f7ef;
  color: var(--idc-success);
}

.st-issued,
.st-submitted,
.st-open {
  border-color: #c6d7ff;
  background: #edf3ff;
  color: var(--idc-info);
}

.st-pending,
.st-preparing,
.st-partially_paid,
.st-partially_invoiced {
  border-color: #f3d6a2;
  background: #fff5df;
  color: var(--idc-warning);
}

.st-cancelled,
.st-lost,
.st-overdue {
  border-color: #f5c0ba;
  background: #fff0ee;
  color: var(--idc-danger);
}

/* ---------- Forms ---------- */
.form-page {
  width: 100%;
  max-width: 860px;
}

.form-page-wide {
  max-width: 1180px;
}

.form-label {
  margin-bottom: .35rem;
  color: #334155;
  font-size: .84rem;
  font-weight: 800;
}

.form-control,
.form-select {
  border-color: var(--idc-border-strong);
  border-radius: var(--radius-sm);
  color: var(--idc-text);
  font-weight: 550;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 118, 110, .65);
  box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .14);
}

.form-control:disabled,
.form-select:disabled {
  background: #f3f5f8;
  color: #6b7280;
}

.required-mark {
  color: var(--idc-danger);
}

.form-hint {
  margin-top: .25rem;
  color: var(--idc-muted);
  font-size: .78rem;
}

.form-check-input {
  border-color: var(--idc-border-strong);
}

.form-check-input:checked {
  border-color: var(--idc-primary);
  background-color: var(--idc-primary);
}

.card:has(.filter-bar) {
  border-color: rgba(15, 118, 110, .18);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .045), transparent 72px),
    #fff;
}

.card:has(.filter-bar) .card-header {
  min-height: 42px;
  background: transparent;
}

.card:has(.filter-bar) .card-body {
  padding: .85rem;
}

.filter-bar form,
form.filter-bar {
  align-items: end;
  row-gap: .75rem !important;
}

.filter-bar .row {
  row-gap: .75rem !important;
}

.filter-bar [class*="col-"] {
  min-width: 0;
}

.filter-bar .form-label {
  color: var(--idc-muted);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.filter-bar .form-control,
.filter-bar .form-select {
  min-height: 36px;
  background-color: #fff;
  box-shadow: inset 0 1px 0 rgba(17, 24, 39, .03);
}

.filter-bar input[type="search"],
.filter-bar input[name="search"],
.filter-bar input[name="q"] {
  padding-left: .85rem;
}

.filter-bar .btn {
  width: 100%;
}

.filter-bar .input-group .btn {
  width: auto;
}

.filter-bar .d-flex.gap-2 {
  align-items: end;
}

@media (min-width: 992px) {
  .filter-bar .btn-sm {
    min-height: 36px;
  }

  .filter-bar .col-lg-8 input,
  .filter-bar .col-lg-4 input,
  .filter-bar .col-md-6 input {
    min-width: 220px;
  }
}

@media (max-width: 767.98px) {
  .card:has(.filter-bar) {
    margin-right: -.25rem;
    margin-left: -.25rem;
  }

  .filter-bar .d-flex.gap-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .form-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-right: -1rem;
    margin-left: -1rem;
    padding: .75rem 1rem .6rem;
    border-top: 1px solid var(--idc-border);
    background: rgba(246, 247, 251, .95);
    backdrop-filter: blur(8px);
  }

  .form-actions-sticky .btn {
    flex: 1 1 0;
  }
}

/* ---------- Tabs ---------- */
.nav-tabs {
  gap: .25rem;
  border-bottom-color: var(--idc-border);
}

.nav-tabs .nav-link,
.nav-pills .nav-link {
  border-radius: var(--radius-sm);
  color: var(--idc-muted);
  font-weight: 800;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  margin-bottom: -1px;
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  background: var(--idc-primary-soft);
  color: var(--idc-primary);
  text-decoration: none;
}

.nav-tabs .nav-link.active {
  border-color: var(--idc-border) var(--idc-border) #fff;
  color: var(--idc-primary);
  background: #fff;
}

.nav-pills {
  padding: .35rem;
  border: 1px solid var(--idc-border);
  border-radius: var(--radius);
  background: #fff;
}

.nav-pills .nav-link.active {
  background: var(--idc-primary);
  color: #fff;
}

/* ---------- Detail pages ---------- */
.dl-grid {
  display: grid;
  grid-template-columns: minmax(120px, 36%) 1fr;
  column-gap: 1rem;
  row-gap: .62rem;
  font-size: .92rem;
}

.dl-grid dt {
  color: var(--idc-muted);
  font-weight: 700;
}

.dl-grid dd {
  margin: 0;
  min-width: 0;
  color: var(--idc-heading);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .dl-grid {
    grid-template-columns: 1fr;
    row-gap: .18rem;
  }

  .dl-grid dd {
    margin-bottom: .5rem;
  }
}

.progress {
  border-radius: 999px;
  background: #e9eef4;
}

.progress-bar {
  background-color: var(--idc-primary);
}

/* ---------- Timeline ---------- */
.timeline-shell {
  max-width: 1040px;
}

.timeline {
  position: relative;
  display: grid;
  gap: .55rem;
  padding: .25rem 0 1rem;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 2.85rem;
  bottom: 1.25rem;
  left: 136px;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--idc-border-strong) 22px, var(--idc-border-strong));
}

.timeline-month {
  position: sticky;
  top: 68px;
  z-index: 2;
  width: max-content;
  margin: 1rem 0 .35rem 112px;
  padding: .28rem .62rem;
  border: 1px solid var(--idc-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--idc-muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 112px 48px minmax(0, 1fr);
  align-items: start;
  min-height: 72px;
}

.timeline-date {
  display: grid;
  justify-items: end;
  padding-top: .65rem;
  color: var(--idc-muted);
  font-size: .72rem;
  font-weight: 850;
  line-height: 1.1;
  text-align: right;
  text-transform: uppercase;
}

.timeline-date .timeline-day {
  color: var(--idc-heading);
  font-size: 1.22rem;
  font-weight: 850;
}

.timeline-point {
  position: relative;
  display: grid;
  height: 100%;
  justify-items: center;
}

.timeline-point::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-top: .85rem;
  border: 3px solid var(--idc-primary);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px var(--idc-bg);
}

.timeline-item.event-danger .timeline-point::before { border-color: var(--idc-danger); }
.timeline-item.event-success .timeline-point::before { border-color: var(--idc-success); }
.timeline-item.event-warning .timeline-point::before { border-color: var(--idc-warning); }

.timeline-card {
  position: relative;
  padding: .82rem .95rem;
  border: 1px solid var(--idc-border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--idc-shadow-sm);
}

.timeline-card::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  left: -7px;
  width: 12px;
  height: 12px;
  border-bottom: 1px solid var(--idc-border);
  border-left: 1px solid var(--idc-border);
  background: #fff;
  transform: rotate(45deg);
}

.timeline-title {
  color: var(--idc-heading);
  font-size: .95rem;
  font-weight: 850;
  line-height: 1.25;
}

@media (max-width: 767.98px) {
  .timeline::before {
    left: 18px;
  }

  .timeline-month {
    margin-left: 0;
  }

  .timeline-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .timeline-date {
    grid-column: 2;
    justify-items: start;
    padding: 0 0 .25rem;
    text-align: left;
  }

  .timeline-date .timeline-day {
    display: inline;
    margin-right: .3rem;
    font-size: .9rem;
  }

  .timeline-point {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .timeline-card {
    grid-column: 2;
  }
}

/* ---------- Auth ---------- */
.auth-shell {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    linear-gradient(145deg, #161d28 0%, #202733 52%, #0f766e 100%);
}

.auth-card {
  width: 100%;
  max-width: 410px;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(8, 13, 24, .38);
}

.auth-card .card-body {
  padding: 2rem;
}

.auth-logo {
  width: 66px;
  height: 66px;
  margin-bottom: .7rem;
  object-fit: contain;
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1080;
  display: flex;
  max-width: min(92vw, 420px);
  flex-direction: column;
  gap: .5rem;
}

.toast {
  border-radius: var(--radius);
  box-shadow: var(--idc-shadow-md);
}

/* ---------- Empty/error states ---------- */
.empty-state {
  padding: 2.4rem 1rem;
  color: var(--idc-muted);
  text-align: center;
}

.empty-state i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0 auto .7rem;
  border-radius: 50%;
  background: var(--idc-primary-soft);
  color: var(--idc-primary);
  font-size: 1.35rem;
}

/* ---------- Invoice/transaction builders ---------- */
#invoiceForm .table input,
#transactionForm .table input {
  min-width: 82px;
}

#invoiceForm .card-body.border-top .dl-grid {
  padding: .8rem 1rem;
  border: 1px solid var(--idc-border);
  border-radius: var(--radius-sm);
  background: var(--idc-surface-subtle);
}

#itemPickerList .list-group-item {
  border-radius: var(--radius-sm);
  margin-bottom: .25rem;
  border: 1px solid var(--idc-border);
}

/* ---------- Utilities ---------- */
.text-muted {
  color: var(--idc-muted) !important;
}

.alert {
  border-radius: var(--radius);
}

.filter-toggle {
  cursor: pointer;
}

.form-check-row {
  min-height: 3.4rem;
}

.progress-slim {
  height: 10px;
}

.pre-wrap {
  white-space: pre-wrap;
}

.file-input-compact {
  max-width: 320px;
}

.min-field {
  min-width: 220px;
}

.session-device {
  max-width: 320px;
}

.col-qty {
  width: 90px;
}

.col-price {
  width: 120px;
}

.allocation-amount-col {
  min-width: 150px;
}

.invoice-total-summary {
  min-width: 280px;
  max-width: 340px;
}

hr {
  border-color: var(--idc-border);
  opacity: 1;
}

@media (max-width: 767.98px) {
  .card-body { padding: .9rem; }
  .table > :not(caption) > * > * { padding: .62rem .68rem; }
}

/* ---------- Searchable selects (Tom Select) ---------- */
.ts-wrapper.form-select {
  padding: 0;
  border: 0;
  background-image: none;
}
.ts-wrapper .ts-control {
  min-height: 38px;
  padding: .42rem .75rem;
  border: 1px solid var(--idc-border-strong);
  border-radius: var(--radius-sm);
  font-size: .94rem;
  box-shadow: none;
}
.ts-wrapper.focus .ts-control {
  border-color: var(--idc-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.ts-dropdown {
  border: 1px solid var(--idc-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--idc-shadow-md);
  font-size: .92rem;
}
.ts-dropdown .active {
  background: var(--idc-primary-soft);
  color: var(--idc-primary-hover);
}
.ts-dropdown .spinner { display: none; }
.form-select-sm + .ts-wrapper .ts-control,
.ts-wrapper.form-select-sm .ts-control {
  min-height: 31px;
  padding: .22rem .5rem;
  font-size: .85rem;
}

/* ---------- Detail page two-column layout ---------- */
.detail-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1200px) {
  .detail-grid {
    grid-template-columns: minmax(0, 2.1fr) minmax(330px, 1fr);
  }
  .detail-grid > .detail-side {
    position: sticky;
    top: 76px;
  }
}

/* ---------- Dashboard: per-currency money blocks ---------- */
.dashboard-currency-block { display: grid; gap: .65rem; }
.dashboard-currency-label {
  font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
  color: var(--idc-muted); padding-left: .1rem;
}
.dashboard-currency-block + .dashboard-currency-block {
  margin-top: .5rem; padding-top: .85rem; border-top: 1px dashed var(--idc-border);
}
