@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');
 
:root {
  --bg:         #F0F4F8;
  --surface:    #FFFFFF;
  --surface-2:  #F7FAFC;
  --border:     #E2EAF0;
  --ink:        #0D1F33;
  --ink-mid:    #3D5470;
  --ink-muted:  #7A90A8;
  --sky:        #0EA5E9;
  --sky-dark:   #0369A1;
  --sky-light:  #BAE6FD;
  --gold:       #F59E0B;
  --emerald:    #10B981;
  --rose:       #F43F5E;
  --violet:     #8B5CF6;
  --amber:      #F97316;
  --slate:      #64748B;
  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 3px rgba(13,31,51,0.06), 0 1px 2px rgba(13,31,51,0.04);
  --shadow:     0 4px 16px rgba(13,31,51,0.08), 0 1px 4px rgba(13,31,51,0.04);
  --shadow-lg:  0 12px 40px rgba(13,31,51,0.12), 0 4px 12px rgba(13,31,51,0.06);
  --font:       'Outfit', sans-serif;
  --mono:       'JetBrains Mono', monospace;
}
 
/* ── Scrollbar: browser scrollbar only, system inner scrollbar hidden ── */
html, body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
 
/* Hide the system/inner scrollbar on all layout wrappers — Webkit */
body::-webkit-scrollbar,
.main-content::-webkit-scrollbar,
.content-wrapper::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
.page-wrapper::-webkit-scrollbar,
.main-panel::-webkit-scrollbar,
.content::-webkit-scrollbar,
.wrapper::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}
 
/* Hide inner scrollbar — Firefox */
.main-content, .content-wrapper, .page-content,
.page-wrapper,  .main-panel,     .content,
.wrapper {
  scrollbar-width: none !important;
}
 
/* Remove scroll containment so only the browser window scroll is active */
.main-content, .content-wrapper, .page-content,
.page-wrapper,  .main-panel,     .content,
.container,     .container-fluid,.wrapper {
  overflow: visible !important;
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
}
 
/* ── Reset within dashboard scope ── */
.ams-dash * { box-sizing: border-box; }
.ams-dash { font-family: var(--font); color: var(--ink); }
 
/* ── Page wrapper: full-width, escape Bootstrap gutters ── */
.ams-dash {
  background: var(--bg);
  min-height: 100vh;
  height: auto;
  overflow: visible;
  padding: 0 0 48px;
  /* Neutralise Bootstrap .container 15px side padding */
  margin-left:  -15px;
  margin-right: -15px;
  margin-top:   -10px;
  width: calc(100% + 30px);
}
 
/* ── Top header bar ── */
.dash-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}
 
.topbar-left { display: flex; align-items: center; gap: 14px; }
 
.topbar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: linear-gradient(135deg, var(--sky-dark), var(--sky));
  padding: 4px;
}
 
.topbar-title-wrap { display: flex; flex-direction: column; }
.topbar-org {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-dark);
}
.topbar-sys {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
 
.topbar-right { display: flex; align-items: center; gap: 12px; }
 
.topbar-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sky-dark);
}
 
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  animation: livePulse 2s ease-in-out infinite;
}
 
@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
 
.topbar-date {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  font-family: var(--mono);
}
 
/* ── Section header ── */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
 
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
 
.section-title::before {
  content: '';
  display: inline-block;
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--sky);
}
 
/* ── Main content area ── */
.dash-content {
  padding: 28px 32px;
}
 
/* ── Flash messages ── */
.dash-alert { margin-bottom: 20px; }
 
/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  animation: fadeUp 0.5s ease both;
}
 
.stats-grid-row2 {
  grid-template-columns: repeat(4, 1fr);
  margin-top: -8px;
}
 
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
 
/* ── Stat card ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s ease both;
}
 
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.30s; }
.stat-card:nth-child(7) { animation-delay: 0.35s; }
.stat-card:nth-child(8) { animation-delay: 0.40s; }
 
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: var(--radius);
}
 
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
 
.stat-card:hover::after { opacity: 1; }
 
/* Colour accent strip */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
 
.sc-sky::before   { background: linear-gradient(90deg, var(--sky-dark), var(--sky)); }
.sc-violet::before { background: linear-gradient(90deg, #7C3AED, var(--violet)); }
.sc-gold::before  { background: linear-gradient(90deg, #D97706, var(--gold)); }
.sc-emerald::before { background: linear-gradient(90deg, #059669, var(--emerald)); }
.sc-amber::before { background: linear-gradient(90deg, #EA580C, var(--amber)); }
.sc-slate::before { background: linear-gradient(90deg, #475569, var(--slate)); }
.sc-teal::before  { background: linear-gradient(90deg, #0D9488, #2DD4BF); }
.sc-rose::before  { background: linear-gradient(90deg, #BE123C, var(--rose)); }
 
.stat-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
 
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
 
.si-sky    { background: #EFF6FF; color: var(--sky-dark); }
.si-violet { background: #F5F3FF; color: #7C3AED; }
.si-gold   { background: #FFFBEB; color: #D97706; }
.si-emerald { background: #ECFDF5; color: #059669; }
.si-amber  { background: #FFF7ED; color: #EA580C; }
.si-slate  { background: #F8FAFC; color: #475569; }
.si-teal   { background: #F0FDFA; color: #0D9488; }
.si-rose   { background: #FFF1F2; color: #BE123C; }
 
.stat-arrow {
  color: var(--border);
  transition: color 0.2s, transform 0.2s;
}
 
.stat-card:hover .stat-arrow {
  color: var(--sky);
  transform: translate(2px, -2px);
}
 
.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font);
}
 
.stat-value.mono { font-family: var(--mono); font-size: 1.3rem; }
 
.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-top: 2px;
}
 
/* ── Tables section ── */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
 
.tables-grid-3 {
  grid-template-columns: 5fr 7fr;
}
 
/* ── Table card ── */
.tbl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.6s ease both;
  display: flex;
  flex-direction: column;
}
 
.tbl-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
 
.tbl-header-left { display: flex; align-items: center; gap: 12px; }
 
.tbl-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
 
.ti-sky     { background: #EFF6FF; color: var(--sky-dark); }
.ti-violet  { background: #F5F3FF; color: #7C3AED; }
.ti-emerald { background: #ECFDF5; color: #059669; }
.ti-amber   { background: #FFF7ED; color: #EA580C; }
.ti-teal    { background: #F0FDFA; color: #0D9488; }
 
.tbl-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
 
.tbl-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-top: 1px;
}
 
.tbl-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sky);
  text-decoration: none;
  padding: 6px 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
 
.tbl-link:hover { background: var(--sky); color: #fff; }
 
/* ── Data table ── */
.data-table-wrap { overflow-x: auto; flex: 1; }
 
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
 
.data-table thead tr {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
}
 
.data-table thead th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  text-align: left;
}
 
.data-table thead th.center { text-align: center; }
 
.data-table tbody tr {
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s;
}
 
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #F8FBFF; }
 
.data-table tbody td {
  padding: 11px 14px;
  color: var(--ink-mid);
  vertical-align: middle;
}
 
.data-table tbody td.center { text-align: center; }
 
.data-table .row-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  text-align: center;
  width: 36px;
}
 
.data-table .asset-name {
  font-weight: 600;
  color: var(--ink);
}
 
.data-table .asset-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sky-dark);
  font-weight: 500;
}
 
.data-table .fault-desc {
  font-size: 12px;
  color: var(--ink-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
 
.data-table .qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 22px;
  background: #F1F5F9;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mid);
}
 
.empty-row td {
  text-align: center;
  padding: 32px 16px !important;
  color: var(--ink-muted) !important;
  font-size: 13px;
  font-style: italic;
}
 
/* ── Status badges ── */
.badge-ams {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
 
.badge-ams::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
 
.b-operational { background: #DCFCE7; color: #15803D; }
.b-operational::before { background: #16A34A; }
 
.b-faulty { background: #FEF3C7; color: #B45309; }
.b-faulty::before { background: #D97706; }
 
.b-failed { background: #FEE2E2; color: #B91C1C; }
.b-failed::before { background: #DC2626; }
 
.b-under-repair { background: #DBEAFE; color: #1D4ED8; }
.b-under-repair::before { background: #2563EB; }
 
.b-retired { background: #F1F5F9; color: #475569; }
.b-retired::before { background: #94A3B8; }
 
.b-unknown { background: #F8FAFC; color: #64748B; }
.b-unknown::before { background: #94A3B8; }
 
.b-pending { background: #FEF3C7; color: #B45309; }
.b-pending::before { background: #D97706; }
 
.b-purchased { background: #DCFCE7; color: #15803D; }
.b-purchased::before { background: #16A34A; }
 
.b-submitted { background: #DBEAFE; color: #1D4ED8; }
.b-submitted::before { background: #2563EB; }
 
.b-rejected { background: #FEE2E2; color: #B91C1C; }
.b-rejected::before { background: #DC2626; }
 
.b-in-progress { background: #EDE9FE; color: #6D28D9; }
.b-in-progress::before { background: #7C3AED; }
 
.b-cancelled { background: #FFF7ED; color: #C2410C; }
.b-cancelled::before { background: #EA580C; }
 
.b-completed { background: #DCFCE7; color: #15803D; }
.b-completed::before { background: #16A34A; }
 
/* ── Bottom footer ── */
.dash-footer {
  text-align: center;
  padding: 20px 32px 0;
  font-size: 12px;
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
 
/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid, .stats-grid-row2 { grid-template-columns: repeat(2, 1fr); }
}
 
@media (max-width: 768px) {
  .dash-content { padding: 18px 16px; }
  .dash-topbar  { padding: 14px 16px; }
  .stats-grid, .stats-grid-row2 { grid-template-columns: 1fr 1fr; }
  .tables-grid, .tables-grid-3 { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
}