/* ------------------------------------------------------------
   TrackJi – Premium Industrial Dashboard Theme
   Global styles + navbar + cards + hero + tables
------------------------------------------------------------- */

:root {
  --tj-primary: #1e4ed8;
  --tj-primary-deep: #0f2f78;
  --tj-primary-soft: #dbe7ff;

  --tj-success: #198754;
  --tj-success-soft: #dff3e9;

  --tj-warning: #b7791f;
  --tj-warning-soft: #fff1d8;

  --tj-danger: #c0392b;
  --tj-danger-soft: #fde6e2;

  --tj-info: #0f766e;
  --tj-info-soft: #dff6f3;

  --tj-dark: #334155;
  --tj-dark-soft: #e9eef5;

  --tj-bg: #edf2f7;
  --tj-surface: #ffffff;
  --tj-surface-soft: #f8fbff;
  --tj-border: #d7e1ee;

  --tj-text: #152232;
  --tj-text-soft: #5f7288;
  --tj-white: #ffffff;

  --tj-radius-sm: 12px;
  --tj-radius-md: 18px;
  --tj-radius-lg: 24px;

  --tj-shadow-sm: 0 8px 24px rgba(15, 35, 65, 0.08);
  --tj-shadow-md: 0 18px 45px rgba(15, 35, 65, 0.10);
  --tj-shadow-lg: 0 28px 60px rgba(9, 25, 53, 0.16);
}

/* -----------------------------
   Base
------------------------------ */
html, body {
  min-height: 100%;
}

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(30, 78, 216, 0.06), transparent 26%),
    linear-gradient(180deg, #f6f9fd 0%, var(--tj-bg) 100%);
  color: var(--tj-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
}

.app-shell {
  padding-bottom: 2rem;
}

/* -----------------------------
   Navbar
------------------------------ */
.navbar-custom {
  background:
    linear-gradient(135deg, rgba(9, 25, 53, 0.96), rgba(19, 60, 145, 0.95)),
    linear-gradient(90deg, #0f2f78, #1e4ed8);
  box-shadow: 0 10px 35px rgba(5, 16, 35, 0.22);
  backdrop-filter: blur(8px);
}

.navbar {
  min-height: 74px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff !important;
}

.navbar-brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.10));
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
  font-size: 0.88rem;
  font-weight: 800;
}

.navbar-brand__text {
  font-size: 1.02rem;
}

.nav-link {
  color: rgba(255,255,255,0.90) !important;
  font-weight: 600;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: #ffffff !important;
}

.dropdown-menu {
  border: 1px solid rgba(15, 35, 65, 0.08);
  border-radius: 16px;
  box-shadow: var(--tj-shadow-md);
  padding: 0.55rem;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: #edf4ff;
  color: var(--tj-primary-deep);
}

.navbar-logout-btn {
  border-radius: 999px;
  padding: 0.52rem 1rem;
  font-weight: 700;
  color: var(--tj-primary-deep) !important;
  box-shadow: 0 8px 20px rgba(255,255,255,0.14);
}

.navbar-toggler:focus {
  box-shadow: none;
}

/* -----------------------------
   Generic cards / sections
------------------------------ */
.card-soft,
.section-shell,
.premium-card,
.action-tile,
.empty-state-box,
.premium-table-wrap {
  border-radius: var(--tj-radius-md);
  background: var(--tj-surface);
  border: 1px solid rgba(215, 225, 238, 0.9);
  box-shadow: var(--tj-shadow-sm);
}

.card-soft {
  padding: 1.35rem;
}

.section-shell {
  padding: 1.35rem;
}

.section-shell__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-shell__header--table {
  align-items: center;
}

.section-kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--tj-primary);
  margin-bottom: 0.35rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tj-text);
}

.section-subtitle {
  color: var(--tj-text-soft);
  font-size: 0.96rem;
}

/* -----------------------------
   Hero
------------------------------ */
.dashboard-page {
  max-width: 100%;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--tj-radius-lg);
  background:
    linear-gradient(135deg, rgba(7, 22, 48, 0.96), rgba(21, 69, 166, 0.92));
  color: #fff;
  padding: 2rem 2rem;
  box-shadow: var(--tj-shadow-lg);
}

.dashboard-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.12), transparent 18%),
    radial-gradient(circle at 15% 15%, rgba(255,255,255,0.08), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00));
  pointer-events: none;
}

.dashboard-eyebrow {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.72);
  margin-bottom: 0.65rem;
}

.dashboard-title {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
}

.dashboard-subtitle {
  position: relative;
  z-index: 1;
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
  max-width: 720px;
}

.dashboard-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.92);
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.hero-feature-card {
  position: relative;
  z-index: 1;
  border-radius: 22px;
  padding: 1.4rem 1.4rem;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(10px);
}

.hero-feature-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.72);
  text-transform: uppercase;
}

.hero-feature-value {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.7rem 0 0.45rem;
  color: #fff;
}

.hero-feature-note {
  color: rgba(255,255,255,0.80);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* -----------------------------
   Action tiles
------------------------------ */
.action-tile {
  display: block;
  height: 100%;
  padding: 1.15rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.action-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--tj-shadow-md);
  border-color: rgba(30, 78, 216, 0.22);
}

.action-tile__icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 0.9rem;
  background: linear-gradient(135deg, #edf4ff, #dbe7ff);
  color: var(--tj-primary-deep);
  font-size: 1.15rem;
  font-weight: 800;
}

.action-tile__title {
  color: var(--tj-text);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.action-tile__text {
  color: var(--tj-text-soft);
  font-size: 0.92rem;
}

/* -----------------------------
   KPI cards
------------------------------ */
.premium-card {
  height: 100%;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.premium-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  transform: translate(35%, -35%);
  background: rgba(30, 78, 216, 0.05);
  pointer-events: none;
}

.premium-card__label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.76);
  margin-bottom: 0.55rem;
}

.premium-card__title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fff;
}

.premium-card__value {
  font-size: 3rem;
  line-height: 1;
  font-weight: 800;
  margin: 0.85rem 0 0.55rem;
}

.premium-card__value--small {
  font-size: 2.2rem;
  color: var(--tj-text);
  margin-top: 0.95rem;
  margin-bottom: 0.35rem;
}

.premium-card__note,
.premium-card__caption {
  font-size: 0.94rem;
  line-height: 1.6;
}

.premium-card__note {
  color: rgba(255,255,255,0.80);
}

.premium-card__caption {
  color: var(--tj-text-soft);
}

.premium-card__topline {
  min-height: 30px;
}

.premium-card--primary {
  background:
    linear-gradient(135deg, rgba(8, 27, 58, 0.98), rgba(19, 73, 176, 0.94));
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--tj-shadow-lg);
}

.premium-card--status {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

/* KPI accent variants */
.kpi-primary {
  border-top: 4px solid var(--tj-primary);
}

.kpi-success {
  border-top: 4px solid var(--tj-success);
}

.kpi-warning {
  border-top: 4px solid var(--tj-warning);
}

.kpi-danger {
  border-top: 4px solid var(--tj-danger);
}

.kpi-dark {
  border-top: 4px solid var(--tj-dark);
}

.kpi-info {
  border-top: 4px solid var(--tj-info);
}

/* -----------------------------
   Status badges
------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-primary {
  background: var(--tj-primary-soft);
  color: var(--tj-primary-deep);
  border-color: rgba(30, 78, 216, 0.12);
}

.status-success {
  background: var(--tj-success-soft);
  color: #0f6b42;
  border-color: rgba(25, 135, 84, 0.12);
}

.status-warning {
  background: var(--tj-warning-soft);
  color: #8d5e11;
  border-color: rgba(183, 121, 31, 0.14);
}

.status-danger {
  background: var(--tj-danger-soft);
  color: #a93226;
  border-color: rgba(192, 57, 43, 0.14);
}

.status-info {
  background: var(--tj-info-soft);
  color: #0f5d56;
  border-color: rgba(15, 118, 110, 0.12);
}

.status-dark {
  background: var(--tj-dark-soft);
  color: #334155;
  border-color: rgba(51, 65, 85, 0.12);
}

.status-neutral {
  background: #eef3f8;
  color: #516172;
  border-color: rgba(81, 97, 114, 0.10);
}

/* -----------------------------
   Tables
------------------------------ */
.premium-table-wrap {
  overflow: hidden;
}

.premium-table {
  table-layout: fixed;
}

.premium-table thead th {
  background: linear-gradient(180deg, #f8fbff 0%, #f1f6fc 100%);
  color: #425466;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  border-bottom: 1px solid var(--tj-border);
  padding: 1rem 0.9rem;
  vertical-align: middle;
}

.premium-table tbody td {
  padding: 1rem 0.9rem;
  border-color: #edf2f7;
  color: var(--tj-text);
  vertical-align: middle;
}

.premium-table tbody tr {
  transition: background-color 0.18s ease;
}

.premium-table tbody tr:hover {
  background-color: #f8fbff;
}

.asset-code-cell {
  font-weight: 800;
  color: var(--tj-primary-deep);
}

.datetime-text {
  color: #415468;
  white-space: nowrap;
}

/* Stable fixed table layout */
.table-fixed {
  table-layout: fixed;
  width: 100%;
}

.table-fixed th,
.table-fixed td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------
   Buttons / forms / misc
------------------------------ */
.btn {
  border-radius: 12px;
  font-weight: 700;
}

.btn-primary {
  background-color: var(--tj-primary) !important;
  border-color: var(--tj-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--tj-primary-deep) !important;
  border-color: var(--tj-primary-deep) !important;
}

.btn-outline-primary {
  color: var(--tj-primary-deep) !important;
  border-color: rgba(30, 78, 216, 0.30) !important;
  background-color: #fff !important;
}

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

.form-control,
.form-select {
  border-radius: 12px;
  border-color: #d5deea;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(30, 78, 216, 0.45);
  box-shadow: 0 0 0 0.22rem rgba(30, 78, 216, 0.12);
}

.empty-state-box {
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.empty-state-box__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--tj-text);
  margin-bottom: 0.35rem;
}

.empty-state-box__text {
  color: var(--tj-text-soft);
}

/* -----------------------------
   Responsive
------------------------------ */
@media (max-width: 991.98px) {
  .dashboard-hero {
    padding: 1.4rem 1.25rem;
  }

  .hero-feature-value {
    font-size: 2.5rem;
  }

  .section-shell,
  .card-soft,
  .premium-card {
    padding: 1.1rem;
  }

  .navbar-logout-btn {
    margin-top: 0.55rem;
    display: inline-flex;
  }
}

@media (max-width: 576px) {
  .app-shell {
    padding-left: 0.9rem !important;
    padding-right: 0.9rem !important;
  }

  .dashboard-title {
    font-size: 1.7rem;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .premium-card__value {
    font-size: 2.4rem;
  }

  .premium-card__value--small {
    font-size: 1.9rem;
  }

  .hero-chip {
    font-size: 0.82rem;
  }

  .premium-table thead th,
  .premium-table tbody td {
    padding: 0.85rem 0.75rem;
  }
}
