﻿:root {
  --ink: #17212b;
  --muted: #5f6f82;
  --line: rgba(23, 33, 43, 0.12);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --brand: #0d5c63;
  --brand-deep: #06343a;
  --accent: #f4a261;
  --accent-soft: #fdebd9;
  --success-soft: #e6f4ea;
  --bg-top: #f3efe6;
  --bg-bottom: #d7e8ec;
  --app-shell-max-width: 1480px;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(244, 162, 97, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(13, 92, 99, 0.18), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.platform-main {
  min-height: calc(100vh - 140px);
}

.app-shell {
  width: min(var(--app-shell-max-width), calc(100% - 24px));
  margin: 0 auto;
}


.platform-nav {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(6, 52, 58, 0.18);
}

.navbar-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.navbar-shell .navbar-collapse {
  flex-basis: 100%;
}

@media (min-width: 992px) {
  .navbar-shell .navbar-collapse {
    display: flex !important;
    flex-grow: 1;
    align-items: center;
    justify-content: flex-end;
    flex-basis: auto;
    min-width: 0;
    gap: 0.85rem;
  }

  .platform-nav-links {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    margin: 0;
  }

  .platform-nav-links .nav-link {
    white-space: nowrap;
  }

  .platform-nav-user {
    flex: 0 0 auto;
    margin-left: 0;
    margin-top: 0;
  }
}

.platform-nav-user {
  margin-top: 0.75rem;
}

.platform-nav .navbar-brand,
.platform-nav .nav-link,
.platform-nav .btn {
  color: #fff !important;
}

.platform-nav .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.platform-nav .nav-link {
  border-radius: 8px;
  opacity: 0.9;
  position: relative;
}

.platform-nav .nav-link:hover,
.platform-nav .nav-link:focus {
  opacity: 1;
}

.platform-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-weight: 700;
  opacity: 1;
}

.platform-shell {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
  backdrop-filter: blur(14px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 2rem;
  color: #fff;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(6, 52, 58, 0.94), rgba(13, 92, 99, 0.84));
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(244, 162, 97, 0.25);
}

.metric-card,
.data-card,
.form-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(23, 33, 43, 0.06);
}

.metric-card {
  padding: 1.25rem;
  min-height: 150px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.08;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
  word-break: normal;
}

.metric-value.is-condensed {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.metric-value.is-condensed-xs {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
}

.metric-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.data-card,
.form-card {
  padding: 1.5rem;
}

.table thead th {
  border-top: none;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.table td {
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background: rgba(13, 92, 99, 0.05);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.section-kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.stat-pill,
.platform-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.platform-pill {
  background: var(--accent-soft);
  color: #8a4b12;
}

.status-pill {
  background: rgba(13, 92, 99, 0.1);
  color: var(--brand-deep);
}

.status-pill.is-alert {
  background: rgba(225, 93, 68, 0.12);
  color: #a33922;
}

.status-pill.is-success {
  background: var(--success-soft);
  color: #23603a;
}

.vendor-center-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.vendor-center-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  padding: 0.55rem 0.95rem;
}

.vendor-center-tab.is-active {
  border-color: rgba(13, 92, 99, 0.2);
  background: rgba(13, 92, 99, 0.1);
  color: var(--brand-deep);
}

.vendor-center-pane {
  display: none;
}

.vendor-center-pane.is-active {
  display: block;
}

.case-progress {
  min-width: 150px;
  margin-bottom: 0.45rem;
}

.case-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #45566c;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.case-progress-track {
  height: 0.55rem;
  margin-top: 0.25rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef2;
}

.case-progress-fill {
  display: block;
  height: 100%;
  min-width: 0.45rem;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.case-progress.is-draft .case-progress-fill,
.case-progress.is-unknown .case-progress-fill {
  background: #9aa6b2;
}

.case-progress.is-quoted .case-progress-fill {
  background: #d99132;
}

.case-progress.is-signed .case-progress-fill {
  background: #2f9e68;
}

.case-progress.is-progress .case-progress-fill,
.case-progress.is-billed .case-progress-fill {
  background: #1f7acb;
}

.case-progress.is-completed .case-progress-fill {
  background: #138f8f;
}

.case-progress.is-closed .case-progress-fill,
.case-progress.is-settled .case-progress-fill {
  background: #16794c;
}

.case-progress.is-unbilled .case-progress-fill {
  background: #d45d45;
}

.case-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.case-row-actions .btn {
  margin: 0;
  min-width: 3.5rem;
  white-space: nowrap;
}

.file-attachments-table-wrap {
  overflow-x: auto;
}

.file-attachments-table {
  min-width: 780px;
  table-layout: fixed;
}

.file-attachments-table th,
.file-attachments-table td {
  vertical-align: middle;
}

.file-attachments-table .file-attachment-source {
  width: 64px;
}

.file-attachments-table .file-attachment-kind {
  width: 150px;
}

.file-attachments-table .file-attachment-name {
  width: auto;
  word-break: break-word;
}

.file-attachments-table .file-attachment-time {
  width: 112px;
}

.file-attachments-table .file-attachment-actions {
  width: 220px;
  text-align: right;
}

.file-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.file-action-buttons .btn {
  margin: 0;
  white-space: nowrap;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

.form-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-header .close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -0.35rem -0.35rem -0.35rem auto;
  padding: 0;
  color: var(--brand-deep);
  text-shadow: none;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(23, 33, 43, 0.25);
  border-radius: 8px;
  opacity: 1;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.modal-header .close span {
  display: block;
  line-height: 1;
  font-size: 1.35rem;
  font-weight: 700;
  transform: translateY(-1px);
}

.modal-header .close:hover,
.modal-header .close:focus {
  color: #fff;
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  box-shadow: 0 0 0 0.18rem rgba(13, 92, 99, 0.18);
  opacity: 1;
  outline: 0;
}

.modal-header .close.text-white {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.45);
}

.modal-header .close.text-white:hover,
.modal-header .close.text-white:focus {
  color: var(--brand-deep) !important;
  background: #fff;
  border-color: #fff;
}

.footer {
  height: 10vh;
}

@media (max-width: 767px) {
  .app-shell {
    width: min(100% - 14px, var(--app-shell-max-width));
  }


  .navbar-shell {
    padding: 0.4rem 0;
  }

  .platform-nav-user {
    margin-top: 0.75rem;
  }

  .hero-panel {
    padding: 1.5rem;
  }

  .metric-card,
  .data-card,
  .form-card {
    border-radius: 18px;
  }
}

.period-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.period-switch .btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.trend-chart-stack {
  display: grid;
  gap: 0.9rem;
}

.trend-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: center;
}

.trend-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.trend-bar-wrap {
  position: relative;
  min-height: 54px;
  border-radius: 16px;
  background: rgba(13, 92, 99, 0.08);
  overflow: hidden;
}

.trend-bar {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(13, 92, 99, 0.92), rgba(244, 162, 97, 0.82));
}

.trend-meta {
  position: relative;
  z-index: 1;
  min-height: 54px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.platform-mix-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1rem 0;
}

.platform-mini-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.dashboard-switch-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.platform-bar-chart {
  display: grid;
  gap: 1rem;
}

.platform-bar-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  align-items: center;
}

.platform-bar-label {
  font-weight: 700;
  color: var(--ink);
}

.platform-bar-track {
  position: relative;
  min-height: 56px;
  border-radius: 16px;
  background: rgba(13, 92, 99, 0.08);
  overflow: hidden;
}

.platform-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 16px;
}

.platform-bar-meta {
  position: relative;
  z-index: 1;
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  color: #fff;
  font-weight: 700;
}

.platform-column-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  align-items: end;
}

.platform-column-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.platform-column-value {
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.platform-column-stage {
  width: 100%;
  max-width: 120px;
  height: 220px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 0.75rem;
  border-radius: 18px;
  background: rgba(13, 92, 99, 0.08);
}

.platform-column-bar {
  width: 100%;
  border-radius: 16px 16px 10px 10px;
  min-height: 16px;
}

.platform-column-label {
  font-weight: 700;
  color: var(--brand-deep);
}

.platform-line-chart {
  display: grid;
  gap: 1rem;
}

.platform-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
}

.platform-line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--ink);
}

.platform-line-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}

.platform-line-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.platform-line-grid {
  stroke: rgba(23, 33, 43, 0.12);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.platform-axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.platform-donut-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 1.5rem;
  align-items: center;
}

.platform-donut-chart {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin: 0 auto;
}

.platform-donut-hole {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.platform-donut-total {
  font-size: 1.4rem;
}

.platform-donut-legend {
  display: grid;
  gap: 0.85rem;
}

.platform-donut-legend-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.status-metric {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  min-width: 0;
}

.status-metric.is-case {
  background: rgba(13, 92, 99, 0.08);
}

.status-metric.is-billing {
  background: rgba(244, 162, 97, 0.12);
}

@media (max-width: 767px) {
  .trend-row {
    grid-template-columns: 1fr;
  }

  .platform-bar-row {
    grid-template-columns: 1fr;
  }

  .platform-donut-layout {
    grid-template-columns: 1fr;
  }
}

.export-actions {
  gap: 0.75rem;
}

.export-actions .btn {
  min-width: 128px;
}

.cross-matrix {
  display: grid;
  gap: 1rem;
}

.cross-table th,
.cross-table td {
  min-width: 120px;
}

.cross-cell {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 0.75rem;
  background: linear-gradient(90deg, rgba(13, 92, 99, 0.1) var(--fill), rgba(244, 162, 97, 0.08) var(--fill));
}

.cross-cell-count {
  font-weight: 700;
  color: var(--brand-deep);
}

.cross-cell-amount {
  font-size: 0.88rem;
  color: var(--muted);
}

.admin-analytics-page .trend-bar-wrap {
  min-height: 64px;
}

.admin-analytics-page .trend-meta {
  min-height: 64px;
  align-content: center;
}

.admin-analytics-page .trend-meta span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(23, 33, 43, 0.12);
  padding: 0.16rem 0.48rem;
  line-height: 1.35;
}

.admin-analytics-page .table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 0;
}

.admin-analytics-page .table-responsive > .table {
  margin-bottom: 0;
}

.admin-analytics-trend-row {
  align-items: flex-start;
}

.admin-analytics-status-card {
  height: auto;
}

.admin-analytics-bottom-row {
  align-items: flex-start;
}

.admin-analytics-table-card {
  height: auto;
}

.admin-analytics-wide-table {
  min-width: 760px;
}

.admin-analytics-page .cross-table {
  min-width: 920px;
}

.admin-analytics-page .table th,
.admin-analytics-page .table td {
  vertical-align: middle;
}

.admin-analytics-page .admin-trend-row {
  cursor: pointer;
  border-radius: 8px;
  padding: 0.25rem;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-analytics-page .admin-trend-row:hover,
.admin-analytics-page .admin-trend-row.is-selected {
  background: rgba(13, 92, 99, 0.08);
  box-shadow: inset 0 0 0 1px rgba(13, 92, 99, 0.12);
}

.admin-analytics-page .trend-detail-panel {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.admin-analytics-page .trend-detail-panel .status-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.admin-analytics-page .trend-detail-panel .metric-value {
  font-size: clamp(1.18rem, 1.35vw, 1.55rem);
}

.admin-analytics-page .trend-detail-panel .metric-value.is-condensed {
  font-size: clamp(0.88rem, 1vw, 1.08rem);
}

.admin-analytics-page .trend-detail-panel .metric-value.is-condensed-xs {
  font-size: clamp(0.76rem, 0.86vw, 0.92rem);
}

.mail-inbox-page .mail-detail-value,
.mail-inbox-page .mail-validation-note,
.mail-inbox-page #inboxDetailPane .form-note,
.mail-inbox-page #inboxDetailPane pre {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mail-inbox-page #inboxDetailPane {
  min-width: 0;
}

.mail-inbox-page #inboxDetailPane .table-responsive {
  overflow-x: auto;
}

.mail-inbox-page .mail-validation-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}

.mail-inbox-page .mail-validation-table th,
.mail-inbox-page .mail-validation-table td {
  vertical-align: top;
}

.mail-inbox-page .mail-validation-table th:nth-child(1),
.mail-inbox-page .mail-validation-table td:nth-child(1),
.mail-inbox-page .mail-validation-label {
  width: 22%;
}

.mail-inbox-page .mail-validation-table th:nth-child(2),
.mail-inbox-page .mail-validation-table td:nth-child(2),
.mail-inbox-page .mail-validation-status {
  width: 20%;
}

.mail-inbox-page .mail-validation-table th:nth-child(3),
.mail-inbox-page .mail-validation-table td:nth-child(3),
.mail-inbox-page .mail-validation-note {
  width: 58%;
}

.mail-inbox-page .inbox-detail-actions {
  gap: 0.5rem;
}

.mail-inbox-page .inbox-confirm-state {
  min-height: 1.25rem;
}

.vendor-quote-items {
  min-width: 0;
}

.vendor-quote-item-table {
  table-layout: fixed;
}

.vendor-quote-item-table th,
.vendor-quote-item-table td {
  vertical-align: top;
}

.vendor-quote-item-table th:nth-child(1),
.vendor-quote-item-table td:nth-child(1) {
  width: 48%;
}

.vendor-quote-item-table th:nth-child(2),
.vendor-quote-item-table td:nth-child(2),
.vendor-quote-item-table th:nth-child(3),
.vendor-quote-item-table td:nth-child(3) {
  width: 26%;
}

.vendor-quote-item-table td,
.vendor-quote-item-table .form-note {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.vendor-action-status {
  min-height: 1.25rem;
}
