:root {
  --theme-color: #e22026;
  --secondary-color: #550401;
  --text-color: #545151;
  --title-color: #1e242a;
}

body {
  font-family: "Segoe UI", sans-serif;
  color: var(--text-color);
}

/* Card */
.theme-card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Title */
.theme-title {
  color: var(--title-color);
  font-weight: 600;
}

/* Button */
.btn-theme {
  background-color: var(--theme-color);
  color: #fff;
  border: none;
}
.btn-theme:hover {
  background-color: var(--secondary-color);
  color: #fff;
}

/* Input focus */
.form-control:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 0.2rem rgba(226,32,38,0.25);
}

/* Input icon */
.input-group-text {
  background-color: var(--secondary-color);
  color: #fff;
}

/* Icon */
.login-icon {
  color: var(--theme-color);
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #4a0705 0%, var(--secondary-color) 45%, #3d0302 100%);
  min-height: 100vh;
  height: 100vh;
  width: 260px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1030;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sidebar-logo-onexar {
  display: block;
  width: 100%;
  max-width: 210px;
  height: auto;
  max-height: 52px;
  margin: 0 auto;
  object-fit: contain;
}

.sidebar-logo-link {
  text-decoration: none;
  border-radius: 12px;
  padding: 4px;
  display: inline-block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-logo-link:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.sidebar-logo {
  display: block;
  border-radius: 10px;
}

.sidebar-logo-link.w-100 {
  max-width: 100%;
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  opacity: 1;
}

.sidebar-nav .sidebar-link {
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  padding: 11px 14px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.sidebar-nav .sidebar-link:last-child {
  border-bottom: none;
}

.sidebar-link i {
  margin-right: 10px;
  font-size: 1.15rem;
  opacity: 0.9;
  width: 1.35rem;
  text-align: center;
}

.sidebar-link:hover {
  background-color: rgba(226, 32, 38, 0.35);
  color: #fff;
  padding-left: 18px;
}

.sidebar-link.active {
  background-color: var(--theme-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(226, 32, 38, 0.35);
}

.sidebar-footer .sidebar-link-logout {
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  padding: 12px 14px;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-footer .sidebar-link-logout:hover {
  background: rgba(226, 32, 38, 0.5);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Content area */
.content {
  margin-left: 270px;
  padding: 24px;
  min-height: 100vh;
  background: linear-gradient(165deg, #f4f5f7 0%, #eef0f4 50%, #f8f9fb 100%);
}

/* Topbar */
.topbar {
  background-color: #fff;
  padding: 16px 22px;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Admin dashboard */
.admin-stat-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1) !important;
}

.admin-stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(226, 32, 38, 0.12), rgba(85, 4, 1, 0.08));
  color: var(--theme-color);
  margin-bottom: 10px;
}

.admin-stat-card--settlements {
  border: 1px solid rgba(255, 193, 7, 0.35) !important;
}

.admin-stat-card--settlements .admin-stat-icon {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.22), rgba(226, 32, 38, 0.1));
  color: #b8860b;
}

.admin-stat-card h2 {
  color: var(--title-color);
  font-weight: 700;
}

.admin-panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--title-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.admin-table-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.admin-table-wrap thead th {
  background: var(--secondary-color) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: none;
  padding: 12px 14px;
}

.admin-table-wrap tbody td {
  vertical-align: middle;
  padding: 10px 14px;
}

.admin-table-wrap .table > :not(caption) > * > * {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Investor detail page */
.detail-table-th {
  width: 38%;
  white-space: nowrap;
}

.detail-card-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail-highlight-card {
  border-radius: 16px;
  overflow: hidden;
}

.detail-highlight-card--invest {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #7a0f0d 100%);
  border: none;
  color: #fff;
}

.detail-highlight-card--invest .detail-card-kicker {
  color: rgba(255, 255, 255, 0.75) !important;
}

.detail-hero-amount {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.detail-hero-amount--dark {
  color: var(--title-color);
}

.detail-highlight-card--settlement {
  background: linear-gradient(145deg, #fff 0%, #f8f9fb 100%);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-highlight-card--overdue {
  border-color: rgba(226, 32, 38, 0.45) !important;
  background: linear-gradient(145deg, #fff5f5 0%, #fff 100%) !important;
}

.detail-highlight-card--soon {
  border-color: rgba(255, 193, 7, 0.45) !important;
}

.detail-settlement-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(226, 32, 38, 0.12), rgba(85, 4, 1, 0.08));
  color: var(--theme-color);
}

.detail-highlight-card--overdue .detail-settlement-icon {
  background: rgba(226, 32, 38, 0.15);
  color: var(--theme-color);
}

.detail-pre {
  background: #f4f5f7;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin: 0;
}

/* Dashboard — upcoming settlements preview */
.dashboard-settlements-kpi {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a:hover .dashboard-settlements-kpi {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

.dashboard-settlements-scroll {
  overflow-x: auto;
  overflow-y: visible;
  margin-inline: -6px;
  padding: 0 6px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.dashboard-settlements-scroll-track {
  width: max-content;
}

.dashboard-settlement-slot {
  width: min(272px, calc(100vw - 5.5rem));
  min-width: 0;
}

.dashboard-settlement-mini {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(160deg, #fff 0%, #f9fafb 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}

.dashboard-settlement-mini--soon {
  border-color: rgba(255, 193, 7, 0.5);
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.15);
}

.dashboard-settlement-mini-date {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.35;
}

.dashboard-settlement-mini-amount {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 800;
  color: var(--title-color);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 6px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dashboard-settlement-mini-id {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-top: 10px;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.dashboard-settlement-mini-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.dashboard-settlement-mini-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 2px;
}

.dashboard-settlement-mini-value {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--title-color);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.dashboard-settlement-mini-badges {
  margin-top: 8px;
  min-height: 1.5rem;
}

.settlement-days-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: #dff6e5;
  color: #1f6f3d;
  border: 1px solid #b8e6c5;
  font-weight: 600;
}

.dashboard-settlement-mini .btn {
  flex-shrink: 0;
}

.dashboard-settlement-mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--theme-color);
  background: linear-gradient(135deg, rgba(226, 32, 38, 0.12), rgba(85, 4, 1, 0.08));
  flex-shrink: 0;
}

/* Upcoming settlements — filter bar */
.settlement-filter-card {
  border-radius: 14px;
}

.settlement-filter-card .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 0.35rem;
}

/* Full page — settlements (timeline + cards, no table) */
.settlement-count-pill {
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.45em 0.9em;
}

.settlement-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(226, 32, 38, 0.1), rgba(85, 4, 1, 0.06));
  color: var(--theme-color);
}

.settlement-flow {
  position: relative;
  padding-left: 0;
}

.settlement-month-block {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 767.98px) {
  .settlement-month-block {
    grid-template-columns: 1fr;
  }

  .settlement-month-rail {
    flex-direction: row !important;
    align-items: center !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
  }

  .settlement-month-dot {
    margin-bottom: 0 !important;
    margin-right: 10px;
  }
}

.settlement-month-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 8px;
  border-bottom: 2px solid rgba(226, 32, 38, 0.2);
}

.settlement-month-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-color);
  margin-bottom: 10px;
  box-shadow: 0 0 0 4px rgba(226, 32, 38, 0.2);
}

.settlement-month-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--title-color);
  letter-spacing: -0.01em;
}

.settlement-month-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settlement-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.settlement-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.settlement-card--soon {
  border-color: rgba(255, 193, 7, 0.45);
}

.settlement-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--theme-color), var(--secondary-color));
}

.settlement-card--soon .settlement-card-accent {
  background: linear-gradient(180deg, #ffc107, #e22026);
}

.settlement-card-inner {
  padding: 1.15rem 1.25rem 1.15rem 1.5rem;
  margin-left: 5px;
}

.settlement-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary-color), #7a0f0d);
  flex-shrink: 0;
}

.settlement-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--title-color);
}

.settlement-card-clientid {
  font-size: 1.05rem;
  color: var(--title-color);
  margin-top: 2px;
}

.settlement-card-name + .settlement-field-label {
  margin-top: 0.5rem;
}

.settlement-card-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--title-color);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.settlement-card-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 12px 0;
}

.settlement-field-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: normal;
  margin-bottom: 2px;
}

/* User portfolio */
.portfolio-profile-grid {
  display: grid;
  gap: 0.65rem;
}

.portfolio-profile-item {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(160deg, #fff 0%, #fbfcff 100%);
}

.portfolio-profile-item span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.52);
  margin-bottom: 2px;
}

.portfolio-profile-item strong {
  display: block;
  color: var(--title-color);
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-word;
}

.portfolio-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.portfolio-kpi-card {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8f9fc 100%);
}

.portfolio-kpi-card span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 4px;
}

.portfolio-kpi-card h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--title-color);
  font-weight: 700;
}

.portfolio-kpi-card small {
  color: rgba(0, 0, 0, 0.55);
}

.portfolio-dues-list {
  display: grid;
  gap: 10px;
}

.portfolio-due-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}

.portfolio-due-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.portfolio-due-currency {
  font-weight: 700;
  color: var(--title-color);
}

.portfolio-due-amount {
  font-weight: 700;
  color: var(--theme-color);
}

.portfolio-due-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.62);
}

.portfolio-due-meta i {
  margin-right: 4px;
}

.portfolio-news-list {
  display: grid;
  gap: 10px;
}

.portfolio-news-item {
  border-left: 4px solid var(--theme-color);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.portfolio-news-item time {
  display: block;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 4px;
}

.portfolio-news-item p {
  margin: 0;
  color: var(--title-color);
}

@media (max-width: 767.98px) {
  .portfolio-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.invest-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.invest-stat-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f8f9fc 100%);
  position: relative;
}

.invest-stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(226, 32, 38, 0.1);
  color: var(--theme-color);
  margin-bottom: 8px;
}

.invest-stat-card span {
  display: block;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.invest-stat-card h4 {
  margin: 4px 0 0;
  color: var(--title-color);
  font-weight: 700;
  font-size: 1.15rem;
}

.invest-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.invest-detail-card {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.invest-detail-card--accent {
  border-color: rgba(226, 32, 38, 0.35);
  background: linear-gradient(165deg, #fff5f5 0%, #fff 100%);
}

.invest-detail-card span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.54);
  margin-bottom: 2px;
}

.invest-detail-card strong {
  display: block;
  color: var(--title-color);
  font-size: 0.94rem;
  font-weight: 600;
  word-break: break-word;
}

@media (max-width: 767.98px) {
  .invest-stat-grid,
  .invest-detail-grid {
    grid-template-columns: 1fr;
  }
}

.investment-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.investment-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f9fafc 100%);
  padding: 12px;
}

.investment-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.investment-card-id {
  font-size: 0.76rem;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 2px;
}

.investment-chip-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.investment-chip {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  background: #fff;
  color: var(--title-color);
}

.investment-mini-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.investment-mini-grid small {
  display: block;
  font-size: 0.7rem;
  color: rgba(0, 0, 0, 0.55);
}

.investment-mini-grid strong {
  display: block;
  font-size: 0.88rem;
  color: var(--title-color);
  word-break: break-word;
}

@media (max-width: 991.98px) {
  .investment-card-grid {
    grid-template-columns: 1fr;
  }
}
