@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-app: #080d1a;
  --bg-sidebar: #0b1325;
  --navy: #080d1a;
  --navy2: #0d172a;
  --panel: #0e182b;
  --panel2: #13223c;
  --panel-elevated: #162846;
  --cyan: #0ea5e9;
  --cyan-hover: #38bdf8;
  --cyan-glow: rgba(14, 165, 233, 0.22);
  --blue-primary: #0284c7;
  --gold: #f59e0b;
  --red: #f43f5e;
  --green: #10b981;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --line: rgba(148, 163, 184, 0.12);
  --line-highlight: rgba(56, 189, 248, 0.22);
  --white: #ffffff;
  --shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.5), 0 4px 12px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 48px -8px rgba(0, 0, 0, 0.65);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}
* {
  box-sizing: border-box;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #060b14;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 999px;
  border: 2px solid #060b14;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}
::selection {
  background: rgba(14, 165, 233, 0.35);
  color: #ffffff;
}
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.login-body {
  min-height: 100vh;
  background: radial-gradient(
    circle at top right,
    #16486a 0,
    #081528 42%,
    #050b16 100%
  );
  display: grid;
  place-items: center;
  padding: 28px;
}
.login-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 24px;
  align-items: stretch;
}
.login-hero,
.login-card {
  background: rgba(13, 33, 56, 0.82);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
  backdrop-filter: blur(12px);
}
.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
}
.brand-logo {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 6px;
}
.side-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  object-fit: contain;
  padding: 4px;
}
.eyebrow {
  color: var(--cyan);
  letter-spacing: 0.04em;
  font-weight: 700;
  margin: 0 0 6px;
}
.login-hero h1,
.title-block h1 {
  margin: 0;
  font-size: clamp(22px, 3vw, 36px);
}
.hero-panel {
  margin-top: 90px;
  max-width: 680px;
}
.hero-label {
  display: inline-block;
  background: rgba(34, 199, 232, 0.13);
  border: 1px solid rgba(34, 199, 232, 0.3);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--cyan);
  font-weight: 700;
}
.hero-panel h2 {
  font-size: clamp(28px, 5vw, 54px);
  line-height: 1.1;
  margin: 16px 0;
}
.hero-panel p:last-child {
  color: #c8d5e1;
  font-size: 18px;
  line-height: 1.7;
}
.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card h2 {
  font-size: 30px;
  margin: 20px 0 4px;
}
.login-card label {
  display: block;
  margin: 18px 0 8px;
  color: #d7e4ee;
}
.login-card input,
.form-grid input,
.form-grid select,
.form-grid textarea,
.filter-panel select,
.settings-panel select,
.modal-card input,
.modal-card textarea {
  width: 100%;
  background: #08172a;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
}
.primary-btn {
  background: linear-gradient(135deg, var(--cyan), #4c86ff);
  color: #06101e;
}
.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--text);
}
.login-card .primary-btn {
  width: 100%;
  margin-top: 22px;
}
.form-error {
  color: #ff8fa6;
  min-height: 22px;
}
.lang-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  color: #c7d6e4;
  font-weight: 700;
}
.compact {
  font-size: 13px;
}
.lang-switch input {
  display: none;
}
.lang-switch span {
  display: block;
  width: 58px;
  height: 30px;
  background: #203a58;
  border-radius: 999px;
  position: relative;
  border: 1px solid var(--line);
}
.lang-switch span:before {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 2px;
  border-radius: 50%;
  background: var(--cyan);
  transition: 0.2s;
}
.lang-switch input:checked + span:before {
  left: 29px;
  background: var(--gold);
}
.app-body {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.08) 0px, transparent 40%),
    radial-gradient(at 0% 100%, rgba(30, 58, 138, 0.08) 0px, transparent 40%);
  background-attachment: fixed;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 6px;
}
.side-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
  padding: 3px;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35);
}
.sidebar-brand b {
  font-size: 1.05rem;
  letter-spacing: -0.3px;
  color: #f8fafc;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}
.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.nav-item span {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  transform: translateX(3px);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.16) 0%, rgba(14, 165, 233, 0.03) 100%);
  border-color: rgba(14, 165, 233, 0.25);
  border-left: 3px solid #0ea5e9;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px -2px rgba(14, 165, 233, 0.2);
}
.nav-item.active span {
  background: rgba(14, 165, 233, 0.2);
}
.main {
  min-width: 0;
  padding: 20px 28px 48px;
}
.topbar {
  position: sticky;
  top: 14px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(11, 19, 37, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 16px;
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}
.bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-left h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  letter-spacing: -0.3px;
}
.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #081426;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  padding: 4px 14px 4px 6px;
}
.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0ea5e9;
}
.user-chip b {
  font-size: 0.86rem;
  color: #f1f5f9;
}
.user-chip small {
  color: #0ea5e9;
  font-weight: 600;
  margin-left: 4px;
}
.title-block {
  min-width: 0;
}
.title-block h1 {
  font-size: 22px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-pill {
  background: #10243b;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  white-space: nowrap;
}
.hamburger {
  display: none;
  background: #10243b;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}
.view {
  display: none;
  margin-top: 18px;
}
.view.active {
  display: block;
}
.filter-panel,
.kpi-grid,
.chart-grid,
.form-grid {
  display: grid;
  gap: 14px;
}
.filter-panel {
  grid-template-columns: 1.2fr repeat(3, 1fr) 1fr;
  align-items: flex-end !important;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.filter-panel .filter-btn-wrap {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
.filter-panel .filter-btn-spacer {
  visibility: hidden !important;
  margin-bottom: 7px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
}
.filter-panel #applyFilter {
  height: 44px !important;
  margin: 0 !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  align-self: flex-end !important;
}
.filter-panel label,
.form-grid label,
.settings-panel label {
  display: block;
  color: #c8d6e4;
  margin-bottom: 7px;
  font-weight: 700;
}
.executive-summary {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, #102947, #0d1e34);
  border: 1px solid rgba(34, 199, 232, 0.25);
  border-radius: 24px;
  padding: 22px;
}
.summary-text h2 {
  margin: 0 0 8px;
  font-size: 28px;
}
.summary-text p:last-child {
  margin: 0;
  color: #c5d5e4;
}
.summary-badge {
  min-width: 190px;
  text-align: center;
  background: rgba(255, 196, 0, 0.12);
  border: 1px solid rgba(255, 196, 0, 0.4);
  border-radius: 22px;
  padding: 14px;
}
.summary-badge span {
  display: block;
  font-size: 46px;
  font-weight: 900;
  color: var(--gold);
}
.summary-badge small {
  color: #e8d28a;
}
.kpi-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 14px;
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}
.kpi-card span {
  color: #c2d0df;
}
.kpi-card b {
  display: block;
  font-size: 34px;
  margin: 8px 0;
}
.kpi-card small {
  color: var(--muted);
}
.kpi-card.gold b {
  color: var(--gold);
}
.kpi-card.danger b {
  color: var(--red);
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.equipment-card {
  background: #0d223a;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  min-width: 0;
}
.equipment-card img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  background: #172f4d;
}
.equipment-card .body {
  padding: 10px;
}
.equipment-card b {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}
.equipment-card .num {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 8px;
}
.equipment-card .num strong {
  font-size: 28px;
  color: var(--red);
}
.equipment-card .bar {
  height: 5px;
  background: #203752;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.equipment-card .bar i {
  display: block;
  height: 100%;
  background: var(--cyan);
}
.chart-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}
.chart-card,
.table-card,
.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}
.chart-card h3,
.table-card h3 {
  margin: 0 0 12px;
}
.chart-card.wide {
  grid-column: span 1;
}
.pareto-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  gap: 10px;
  align-items: center;
  margin: 11px 0;
}
.pareto-bar {
  height: 20px;
  background: #203752;
  border-radius: 999px;
  overflow: hidden;
}
.pareto-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
}
.donut-wrap {
  min-height: 220px;
  display: grid;
  place-items: center;
}
.donut {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) 0 42%,
    var(--gold) 42% 72%,
    var(--red) 72% 100%
  );
  display: grid;
  place-items: center;
}
.donut:before {
  content: "";
  width: 112px;
  height: 112px;
  background: var(--panel);
  border-radius: 50%;
  position: absolute;
}
.donut span {
  position: relative;
  text-align: center;
  font-weight: 900;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}
.table-scroll {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: #0a1b30;
  color: #bfeeff;
  position: sticky;
  top: 0;
}
td {
  color: #d8e4ef;
}
.camera-btn {
  background: rgba(34, 199, 232, 0.12);
  border: 1px solid rgba(34, 199, 232, 0.3);
  border-radius: 12px;
  color: #bff4ff;
  padding: 8px 10px;
}
.news-feed {
  display: grid;
  gap: 16px;
}
.news-card {
  background: linear-gradient(180deg, #fbfdff, #eef5fb);
  color: #11233a;
  border-radius: 20px;
  padding: 22px;
  border-left: 6px solid var(--cyan);
  box-shadow: var(--shadow);
}
.news-card .date {
  color: #436078;
  font-weight: 800;
}
.news-card h3 {
  margin: 8px 0;
}
.news-card p {
  line-height: 1.7;
}
.tag {
  display: inline-block;
  background: #dff5fb;
  color: #03566e;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  margin-right: 6px;
}
.form-grid {
  grid-template-columns: repeat(4, 1fr);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.full {
  grid-column: 1/-1;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  width: min(780px, 100%);
  background: #0d2138;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  position: relative;
}
.close-modal {
  position: absolute;
  right: 14px;
  top: 12px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 34px;
}
.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.media-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 14px;
  background: #1a334f;
}
.permission-table {
  min-width: 620px;
}
@media (max-width: 1180px) {
  .filter-panel {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    margin-top: 40px;
  }
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -290px;
    transition: 0.25s;
  }
  .sidebar.open {
    left: 0;
  }
  .hamburger {
    display: block;
  }
  .topbar {
    align-items: flex-start;
  }
  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .chart-grid,
  .form-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }
  .executive-summary {
    flex-direction: column;
    align-items: stretch;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .title-block h1 {
    font-size: 18px;
  }
}
/* V2 additions */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-pill img,
.mini-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.user-pill small {
  color: var(--gold);
  font-weight: 800;
}
.nav-item[style*="display: none"] {
  display: none !important;
}
.equipment-card {
  cursor: pointer;
}
.equipment-card img {
  height: 118px;
  object-fit: contain;
  background: linear-gradient(180deg, #e9f4fb, #c8d7e5);
  padding: 4px;
}
.clickable {
  cursor: pointer;
}
.chart-hint {
  color: var(--cyan);
  font-weight: 700;
}
.pareto-row {
  grid-template-columns: minmax(150px, 220px) 1fr 76px;
}
.news-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  overflow: hidden;
}
.news-cover {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 16px;
  background: #d6e1ec;
}
.news-content {
  min-width: 0;
}
.ghost-btn.small {
  padding: 7px 10px;
  margin-top: 12px;
  color: #0a263d;
  background: #dceaf5;
  border-color: #c5d7e5;
}
.insight-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.insight-kpis div {
  background: #07182a;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.insight-kpis b {
  display: block;
  font-size: 30px;
  color: var(--gold);
}
.insight-kpis span {
  color: #bdd0df;
}
.media-gallery video {
  width: 100%;
  height: 190px;
  border-radius: 14px;
  background: #000;
}
.file-link {
  display: block;
  color: #bff4ff;
  background: #07182a;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
}
.form-grid small {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}
.permission-table input {
  transform: scale(1.25);
}
@media (max-width: 860px) {
  .news-card {
    grid-template-columns: 1fr;
  }
  .news-cover {
    height: 210px;
  }
  .insight-kpis {
    grid-template-columns: 1fr;
  }
  .equipment-card img {
    height: 150px;
  }
  .pareto-row {
    grid-template-columns: 1fr;
  }
  .pareto-row span {
    text-align: right;
  }
  .top-actions {
    width: 100%;
  }
  .user-pill {
    max-width: 100%;
    white-space: normal;
  }
  .filter-panel,
  .form-grid {
    padding: 14px;
  }
  .modal-card {
    max-height: 90vh;
    overflow: auto;
  }
}
/* ===== Responsive overflow fix ===== */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.app-body,
.main,
.view,
.topbar,
.filter-panel,
.executive-summary,
.kpi-grid,
.equipment-grid,
.chart-grid,
.table-card,
.chart-card,
.form-grid {
  max-width: 100%;
  min-width: 0;
}

.main {
  overflow-x: hidden;
}

.chart-card canvas {
  width: 100% !important;
  max-width: 100% !important;
}


.chart-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.filter-panel {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 1180px) {
  .app-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .main {
    padding: 14px;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .app-body {
    display: block;
  }

  .main {
    width: 100%;
    padding: 12px;
  }

  .topbar {
    position: relative;
    border-radius: 16px;
  }

  .title-block {
    width: 100%;
  }

  .filter-panel,
  .chart-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card b {
    font-size: 28px;
  }

  table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .summary-text h2 {
    font-size: 20px;
  }

  .summary-badge span {
    font-size: 34px;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

/* ===== Popup final theme + scroll fix ===== */
.modal:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 18px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 9999 !important;
  background: rgba(0, 0, 0, 0.68) !important;
}

/* ===== Old Light Modal Cleaned Up & Replaced with Modern Dark Theme ===== */
.modal-card {
  width: min(980px, 96vw) !important;
  max-height: calc(100vh - 48px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 12px auto 40px auto !important;
  border-radius: 20px !important;
  background: #09172a !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
}

.modal-card.media {
  max-height: calc(100vh - 48px) !important;
  overflow-y: auto !important;
}

.modal-card h3 {
  color: #38bdf8 !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  padding-bottom: 12px !important;
  margin: 0 0 16px 0 !important;
}

.close-modal {
  position: absolute !important;
  right: 18px !important;
  top: 16px !important;
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #1e293b !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 10000 !important;
  pointer-events: auto !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5) !important;
}

.close-modal:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.1) rotate(90deg) !important;
}

.insight-body,
.media-gallery {
  max-width: 100%;
  overflow-x: hidden;
  color: #f1f5f9;
}

.insight-body p,
.insight-body .muted {
  color: #94a3b8;
}

.insight-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.insight-kpis div {
  background: #ffffff !important;
  border: 1px solid #c4def0 !important;
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(0, 90, 140, 0.1);
}

.insight-kpis b {
  display: block;
  font-size: 30px;
  color: #006aa6 !important;
}

.insight-kpis span {
  color: #526a7d !important;
}

.insight-body .table-scroll,
.modal-card .table-scroll {
  max-height: 55vh !important;
  overflow: auto !important;
  border-radius: 14px;
  border: 1px solid #c4def0;
}

.insight-body table,
.modal-card table {
  width: 100%;
  min-width: 0;
  background: #081628;
  color: #f1f5f9;
}

.insight-body th,
.modal-card th {
  background: #0d2238 !important;
  color: #38bdf8 !important;
  position: sticky;
  top: 0;
  z-index: 1;
}

.insight-body td,
.modal-card td {
  color: #f1f5f9 !important;
  border-color: rgba(56, 189, 248, 0.15) !important;
}

.insight-body .camera-btn,
.modal-card .camera-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
}

.media-gallery img {
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
}

.media-gallery video {
  width: 100%;
  height: 190px;
  border-radius: 14px;
  background: #000;
}

.file-link {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
}

@media (max-width: 860px) {
  .modal:not(.hidden) {
    padding: 10px !important;
  }

  .modal-card {
    width: 96vw !important;
    max-height: calc(100vh - 28px) !important;
    margin: 8px auto 30px auto !important;
    border-radius: 18px !important;
  }

  .insight-body .table-scroll,
  .modal-card .table-scroll {
    max-height: 60vh !important;
  }

  .insight-body table,
  .modal-card table {
    min-width: 620px;
  }
}
/* ===== News board: multi-image gallery ===== */
.news-feed {
  gap: 22px;
}

.news-card.news-card-gallery {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(320px, 0.75fr);
  gap: 22px;
  padding: 22px;
  align-items: stretch;
  border-left: 8px solid var(--cyan);
}

.news-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 170px;
  gap: 10px;
  min-height: 350px;
}

.news-gallery.single {
  grid-template-columns: 1fr;
  grid-auto-rows: 360px;
}

.news-gallery.empty {
  display: grid;
  place-items: center;
  background: #d6e1ec;
  border-radius: 18px;
  color: #436078;
  font-weight: 800;
}

.news-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  background: #d6e1ec;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.news-gallery img.main-news-img {
  grid-row: span 2;
}

.news-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-content h3 {
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.25;
  margin: 12px 0;
}

.news-content p {
  font-size: 16px;
  line-height: 1.85;
  color: #20364f;
}

@media (max-width: 1100px) {
  .news-card.news-card-gallery {
    grid-template-columns: 1fr;
  }

  .news-gallery {
    min-height: 280px;
  }
}

@media (max-width: 620px) {
  .news-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 220px;
  }

  .news-gallery img.main-news-img {
    grid-row: span 1;
  }

  .news-content h3 {
    font-size: 22px;
  }
}
/* ===== News board: fixed 50/50 layout, max 5 images ===== */
.news-feed {
  display: grid;
  gap: 26px;
}

.news-card.news-card-gallery {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 26px !important;
  align-items: start !important;
  width: 100%;
  padding: 24px !important;
  overflow: hidden !important;
}

.news-media-side {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.news-gallery {
  width: 100%;
  min-height: 360px;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

/* 1 รูป */
.news-gallery.news-count-1 {
  grid-template-columns: 1fr;
}
.news-gallery.news-count-1 img {
  height: 420px;
}

/* 2 รูป */
.news-gallery.news-count-2 {
  grid-template-columns: 1fr 1fr;
}
.news-gallery.news-count-2 img {
  height: 360px;
}

/* 3 รูป */
.news-gallery.news-count-3 {
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 180px 180px;
}
.news-gallery.news-count-3 img:first-child {
  grid-row: span 2;
}

/* 4 รูป */
.news-gallery.news-count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 180px 180px;
}

/* 5 รูป */
.news-gallery.news-count-5 {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  grid-template-rows: 180px 180px;
}
.news-gallery.news-count-5 img:first-child {
  grid-row: span 2;
}

.news-gallery img {
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: cover;
  border-radius: 16px;
  background: #d6e1ec;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
  display: block;
}

.news-gallery.empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  background: #d6e1ec;
  border-radius: 18px;
  color: #436078;
  font-weight: 800;
}

.news-content {
  min-width: 0;
  width: 100%;
  display: block !important;
  align-self: start;
}

.news-content h3 {
  font-size: clamp(24px, 2vw, 36px);
  line-height: 1.28;
  margin: 12px 0;
  color: #11233a;
}

.news-content p {
  font-size: 17px;
  line-height: 1.9;
  color: #20364f;
  white-space: pre-line;
}

.news-content small {
  display: block;
  margin-top: 18px;
  color: #436078;
}

@media (max-width: 1100px) {
  .news-card.news-card-gallery {
    grid-template-columns: 1fr !important;
  }

  .news-gallery {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .news-gallery,
  .news-gallery.news-count-1,
  .news-gallery.news-count-2,
  .news-gallery.news-count-3,
  .news-gallery.news-count-4,
  .news-gallery.news-count-5 {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .news-gallery img,
  .news-gallery.news-count-1 img,
  .news-gallery.news-count-2 img,
  .news-gallery.news-count-3 img:first-child,
  .news-gallery.news-count-5 img:first-child {
    grid-row: auto;
    height: 230px;
  }
}
/* ===== Sidebar logo enlarge ===== */
.sidebar .brand-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.sidebar .brand-logo,
.sidebar #appLogo {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
}

.sidebar .brand-row h1,
.sidebar .brand-row .brand-title {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
  font-weight: 900;
}

.sidebar .brand-row p,
.sidebar .brand-row .brand-subtitle {
  font-size: 14px;
  line-height: 1.25;
  margin: 4px 0 0;
  color: #b8d7ee;
}
/* ===== Sidebar logo enlarge - real class fix ===== */
.sidebar-brand {
  display: grid !important;
  grid-template-columns: 92px 1fr !important;
  gap: 14px !important;
  align-items: center !important;
  margin-bottom: 32px !important;
}

.sidebar-brand .side-logo,
.sidebar-brand img.side-logo,
#appLogo.side-logo {
  width: 92px !important;
  height: 92px !important;
  max-width: 92px !important;
  max-height: 92px !important;
  min-width: 92px !important;
  min-height: 92px !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  background: #fff !important;
  padding: 5px !important;
}

.sidebar-brand > div {
  min-width: 0;
}

.sidebar-brand h1 {
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1.25 !important;
  font-weight: 900 !important;
  white-space: normal !important;
}

.sidebar-brand small {
  display: block !important;
  margin-top: 4px !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
  color: #b8d7ee !important;
}
/* ===== Force enlarge sidebar logo ===== */
.sidebar-brand {
  display: grid !important;
  grid-template-columns: 120px 1fr !important;
  gap: 14px !important;
  align-items: center !important;
  margin-bottom: 34px !important;
}

.sidebar-brand img,
.sidebar-brand #appLogo,
.sidebar img#appLogo,
img#appLogo {
  width: 120px !important;
  height: 120px !important;
  max-width: 120px !important;
  max-height: 120px !important;
  min-width: 120px !important;
  min-height: 120px !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  background: #fff !important;
  padding: 6px !important;
  display: block !important;
}

.sidebar-brand h1 {
  font-size: 16px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  white-space: normal !important;
}

.sidebar-brand small {
  font-size: 14px !important;
  line-height: 1.25 !important;
  margin-top: 5px !important;
  display: block !important;
}
/* ===== Sidebar maker logo ===== */
.sidebar-maker-logo {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-maker-logo img {
  width: 100%;
  max-width: 140px;
  max-height: 40px;
  object-fit: contain;
  display: block;
}
/* ===== Dashboard chart layout: 2 top / 2 bottom ===== */
.chart-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  align-items: stretch !important;
}

.chart-card {
  min-width: 0 !important;
  width: 100% !important;
}

/* ให้ Pareto และ Severity สูงพอดีในแถวล่าง */
.chart-card .pareto-box,
.chart-card .donut-wrap {
  min-height: 300px;
}

/* มือถือให้เรียง 1 คอลัมน์ */
@media (max-width: 860px) {
  .chart-grid {
    grid-template-columns: 1fr !important;
  }
}
/* ===== Executive Summary Zero Accident ===== */
.executive-summary-new {
  display: grid !important;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr) !important;
  gap: 18px !important;
  align-items: stretch !important;
  padding: 24px !important;
  background:
    linear-gradient(135deg, rgba(34,199,232,.12), rgba(76,134,255,.08)),
    linear-gradient(135deg, #102947, #0d1e34) !important;
}

.zero-slogan {
  margin: 4px 0 14px !important;
  font-size: clamp(26px, 3vw, 44px) !important;
  line-height: 1.15 !important;
  color: #ffffff !important;
  font-weight: 950 !important;
}

.zero-slogan span {
  display: inline-block;
  color: var(--gold);
  white-space: nowrap;
}

.summary-text #summaryHeadline {
  font-size: 18px;
  font-weight: 800;
  color: #d9ecff;
  margin: 0 0 8px;
}

.summary-text #summaryDesc {
  color: #b8d7ee;
  line-height: 1.7;
}

.summary-stat-panel {
  display: grid !important;
  gap: 10px !important;
  align-content: center !important;
}

.summary-stat-main,
.summary-stat-change {
  border-radius: 18px !important;
  padding: 12px 14px !important;
  text-align: center !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  background: rgba(6,16,30,.42) !important;
}

.summary-stat-main span {
  display: block !important;
  font-size: clamp(34px, 4vw, 46px) !important;
  line-height: 1.05 !important;
  font-weight: 950 !important;
  color: var(--gold) !important;
}

.summary-stat-main small,
.summary-stat-change small {
  display: block !important;
  margin-top: 4px !important;
  color: #d8e8f7 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
}

.summary-stat-change b {
  display: block !important;
  font-size: 20px !important;
  line-height: 1.15 !important;
  color: var(--cyan) !important;
}

.summary-stat-change.up b {
  color: #ff8a00;
}

.summary-stat-change.down b {
  color: #1fd180;
}

.summary-stat-change.same b {
  color: #d8e8f7;
}

@media (max-width: 860px) {
  .executive-summary-new {
    grid-template-columns: 1fr !important;
  }

  .summary-stat-panel {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .summary-stat-panel {
    grid-template-columns: 1fr;
  }
}
/* ===== Accident form section layout ===== */
.form-section-title {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-left: 5px solid var(--cyan);
  border-radius: 12px;
  background: rgba(34, 199, 232, 0.12);
  color: #bff4ff;
  font-weight: 900;
  letter-spacing: .02em;
}

#accidentForm {
  align-items: start;
}

#accidentForm .full {
  grid-column: 1 / -1;
}

#accidentForm textarea {
  min-height: 110px;
  resize: vertical;
}

#useCurrentLocationBtn {
  background: rgba(31, 209, 128, 0.16);
  border-color: rgba(31, 209, 128, 0.35);
  color: #caffdf;
}

#openMapBtn {
  background: rgba(255, 196, 0, 0.14);
  border-color: rgba(255, 196, 0, 0.35);
  color: #ffe9a6;
}

@media (max-width: 1180px) {
  #accidentForm {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  #accidentForm {
    grid-template-columns: 1fr;
  }
}
/* ===== Saved accident table pager ===== */
.saved-table-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  background: rgba(8, 23, 42, 0.75);
  border: 1px solid var(--line);
  border-radius: 14px;
  flex-wrap: wrap;
}

.pager-info {
  color: #c8d6e4;
  font-weight: 800;
}

.pager-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.pager-btn {
  border: 1px solid rgba(34,199,232,.28);
  background: rgba(34,199,232,.10);
  color: #dff8ff;
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 800;
}

.pager-btn.active {
  background: linear-gradient(135deg, var(--cyan), #4c86ff);
  color: #06101e;
}

.pager-jump {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #c8d6e4;
  font-weight: 800;
  margin-left: 8px;
}

.pager-jump input {
  width: 70px;
  background: #08172a;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 7px 8px;
  text-align: center;
}

.danger-btn {
  background: rgba(255,56,100,.15) !important;
  border-color: rgba(255,56,100,.4) !important;
  color: #ffd6df !important;
}

@media (max-width: 720px) {
  .saved-table-pager {
    align-items: stretch;
  }

  .pager-actions {
    justify-content: flex-start;
  }
}
/* ===== Severity donut legend color markers ===== */
.severity-chart-box {
  display: grid;
  place-items: center;
  gap: 16px;
}

.severity-legend {
  width: min(340px, 100%);
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.severity-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #cbd5e1;
  font-size: 11.5px !important;
  font-weight: 500;
  line-height: 1.3;
}

.severity-legend-row i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12);
}

.severity-legend-row b {
  min-width: 0;
  font-size: 11.5px !important;
  font-weight: 500;
  color: #cbd5e1;
  line-height: 1.25;
}

.severity-legend-row span {
  color: #ffffff;
  font-size: 11.5px !important;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* Pareto Detail List Compact - 20% reduced font */
.pareto-detail-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.pareto-detail-row {
  display: grid !important;
  grid-template-columns: minmax(130px, 185px) 1fr auto !important;
  gap: 6px 12px !important;
  align-items: center !important;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px !important;
  line-height: 1.35;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pareto-detail-row:hover {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
}

.pareto-detail-row b {
  font-size: 11.5px !important;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
}

.pareto-detail-row span {
  font-size: 11px !important;
  color: #94a3b8;
  margin: 0;
  text-align: left !important;
  justify-self: start !important;
  white-space: nowrap;
}

.pareto-detail-row small {
  font-size: 10.5px !important;
  color: #38bdf8;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  text-align: right !important;
  justify-self: end !important;
}

.chart-hint {
  font-size: 10.5px !important;
  color: #38bdf8 !important;
  margin-top: 6px;
  display: block;
}
/* ===== Sidebar maker logo ===== */
.sidebar-maker-logo {
  margin-top: auto !important;
  padding: 12px 10px 0 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.sidebar-maker-logo img {
  display: block !important;
  width: auto !important;
  max-width: 140px !important;
  max-height: 38px !important;
  margin: 0 !important;
  opacity: 0.82 !important;
  transition: opacity 0.2s ease !important;
}

.sidebar-maker-logo img:hover {
  opacity: 1 !important;
}

/* ===== KPI cards grid ===== */
.kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
}

.latest-accident-card b{
  font-size: 32px;
  color: #38d7ff;
  line-height: 1.2;
}

.latest-accident-card small{
  color: #b9d7ff;
}

@media (max-width: 1400px){
  .kpi-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .kpi-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){
  .kpi-grid{
    grid-template-columns: 1fr;
  }
}
/* ===== KPI grid back to 4 cards ===== */
.kpi-grid{
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.latest-accident-card b{
  font-size: 32px;
  color: #38d7ff;
  line-height: 1.2;
}

@media (max-width: 1200px){
  .kpi-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 560px){
  .kpi-grid{
    grid-template-columns: 1fr !important;
  }
}
/* ===== Accident media popup larger image ===== */
.media-gallery{
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)) !important;
  gap: 22px !important;
  align-items: start !important;
}

.accident-popup-img{
  width: 100% !important;
  max-width: 720px !important;
  height: 420px !important;
  object-fit: contain !important;
  background: #071523 !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  padding: 8px !important;
  cursor: zoom-in !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}

.accident-popup-img:hover{
  transform: scale(1.02) !important;
  box-shadow: 0 18px 45px rgba(0,0,0,.45) !important;
}

.accident-popup-video{
  width: 100% !important;
  max-width: 720px !important;
  height: 420px !important;
  background: #071523 !important;
  border-radius: 18px !important;
}

.image-fullscreen-overlay{
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  background: rgba(0,0,0,.88) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px !important;
}

.image-fullscreen-overlay.show{
  display: flex !important;
}

.image-fullscreen-overlay img{
  max-width: 96vw !important;
  max-height: 92vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 80px rgba(0,0,0,.65) !important;
  background: #071523 !important;
}

.image-fullscreen-close{
  position: fixed !important;
  top: 18px !important;
  right: 24px !important;
  width: 46px !important;
  height: 46px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #ff3864 !important;
  color: #fff !important;
  font-size: 34px !important;
  line-height: 42px !important;
  cursor: pointer !important;
  font-weight: 900 !important;
}

@media (max-width: 760px){
  .media-gallery{
    grid-template-columns: 1fr !important;
  }

  .accident-popup-img,
  .accident-popup-video{
    max-width: 100% !important;
    height: 320px !important;
  }
}
/* ===== Equipment insight side-by-side popup ===== */
#insightModal .modal-card.media{
  width: min(96vw, 1500px) !important;
  max-width: 1500px !important;
  max-height: 92vh !important;
  overflow: auto !important;
}

/* Modal Popup แสดงตารางแนวโน้มรายปี / สัดส่วนความรุนแรง ขนาดกะทัดรัดพอดีกับข้อมูล (ยุบระยะห่างคอลัมน์ให้สมส่วน) */
#insightModal .modal-card.media.compact-insight {
  width: min(92vw, 420px) !important;
  max-width: 420px !important;
  padding: 18px 20px !important;
  overflow: hidden !important;
}

.equipment-insight-layout{
  display: grid !important;
  grid-template-columns: minmax(520px, 1.1fr) minmax(480px, .9fr) !important;
  gap: 22px !important;
  align-items: start !important;
}

.equipment-insight-left,
.equipment-insight-right{
  min-width: 0 !important;
}

.equipment-insight-right{
  background: rgba(7,21,35,.55) !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 18px !important;
  padding: 14px !important;
  position: sticky !important;
  top: 0 !important;
}

.equipment-insight-right h4{
  margin: 0 0 12px !important;
  color: #ffffff !important;
  font-size: 18px !important;
}

.equipment-media-preview{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 14px !important;
  max-height: 72vh !important;
  overflow: auto !important;
  padding-right: 4px !important;
}

.equipment-media-img,
.equipment-media-video{
  width: 100% !important;
  max-height: 520px !important;
  object-fit: contain !important;
  background: #071523 !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  padding: 8px !important;
}

.equipment-media-img{
  cursor: zoom-in !important;
}

.equipment-media-img:hover{
  transform: scale(1.01) !important;
}

@media (max-width: 1050px){
  .equipment-insight-layout{
    grid-template-columns: 1fr !important;
  }

  .equipment-insight-right{
    position: static !important;
  }
}
/* ===== Existing accident attachments in edit form ===== */
.existing-attachment-box{
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(34,199,232,.35);
  border-radius: 16px;
  background: rgba(7,21,35,.35);
}

.existing-attachment-box.hidden{
  display: none !important;
}

.existing-attachment-head{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.existing-attachment-head b{
  color: #ffffff;
  font-size: 16px;
}

.existing-attachment-head small{
  color: #b9d7ff;
}

.existing-attachment-list{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.existing-attachment-item{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 10px;
}

.existing-attachment-item img{
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: #071523;
  cursor: zoom-in;
}

.existing-attachment-item video{
  width: 100%;
  height: 120px;
  border-radius: 10px;
  background: #071523;
}

.existing-attachment-item .file-link{
  display: block;
  color: #38d7ff;
  font-weight: 800;
  word-break: break-word;
  padding: 14px 4px;
}

.delete-attachment-btn{
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: #dc2626;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.delete-attachment-btn:hover{
  filter: brightness(1.08);
}
/* ==========================================================================
   MASTER CLEAN MODERN DASHBOARD SYSTEM
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #06111f;
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.app-body {
  display: flex !important;
  min-height: 100vh !important;
  width: 100% !important;
  overflow-x: hidden !important;
  background: #06111f !important;
}

/* 1. Sleek Modern Sidebar */
.sidebar {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  height: 100vh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  background: #071526 !important;
  border-right: 1px solid rgba(56, 189, 248, 0.12) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 16px 12px 14px 12px !important;
  z-index: 1000 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.2) transparent;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 4px;
}

/* Sidebar Brand Header */
.sidebar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 6px 10px 14px 10px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  margin-bottom: 12px !important;
}

.sidebar-brand .side-logo {
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)) !important;
}

.sidebar-brand div {
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  letter-spacing: 0.3px !important;
  line-height: 1.25 !important;
}

/* Sidebar Navigation Items */
.side-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: left !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.nav-item span {
  font-size: 1.15rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  flex-shrink: 0 !important;
}

.nav-icon-img {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
  display: block !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-item:hover .nav-icon-img {
  transform: scale(1.15) !important;
}

.nav-item.active .nav-icon-img {
  transform: scale(1.12) !important;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.45)) !important;
}

.nav-item b {
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.nav-item:hover {
  background: rgba(56, 189, 248, 0.08) !important;
  color: #f1f5f9 !important;
  transform: translateX(3px) !important;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(27, 152, 224, 0.25), rgba(27, 152, 224, 0.06)) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-left: 3px solid #38bdf8 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.nav-item.active b {
  font-weight: 700 !important;
  color: #ffffff !important;
}

/* Sidebar Footer / Maker Logo */
.sidebar-maker-logo {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 10px 8px 0 8px !important;
  margin-top: 10px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.sidebar-maker-logo img {
  max-height: 34px !important;
  max-width: 130px !important;
  width: auto !important;
  object-fit: contain !important;
  opacity: 0.8 !important;
  transition: opacity 0.2s ease !important;
  margin: 0 !important;
}

.sidebar-maker-logo img:hover {
  opacity: 1 !important;
}

/* 2. Main Content Container */
main.content,
.main.content,
.content,
.main {
  margin-left: 260px !important;
  width: calc(100% - 260px) !important;
  min-height: 100vh !important;
  padding: 18px 28px 60px 28px !important;
  box-sizing: border-box !important;
  background: #06111f !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

/* 3. Topbar Header */
.topbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 20px !important;
  background: rgba(10, 25, 47, 0.88) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(56, 189, 248, 0.15) !important;
  border-radius: 16px !important;
  margin-bottom: 22px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  position: sticky !important;
  top: 12px !important;
  z-index: 99 !important;
}

.bar-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.bar-left h1 {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  letter-spacing: 0.2px !important;
}

#hamburger {
  display: none !important;
}

.bar-right {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  flex-shrink: 0 !important;
}

.user-chip {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: rgba(15, 36, 61, 0.85) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 999px !important;
  padding: 4px 14px 4px 6px !important;
}

.avatar-sm {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #38bdf8 !important;
  background: #081728 !important;
}

.user-chip div {
  font-size: 0.85rem !important;
  color: #f1f5f9 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.user-chip small {
  color: #38bdf8 !important;
  font-weight: 600 !important;
  font-size: 0.78rem !important;
}

.topbar-lang {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

#logoutBtn {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  border-radius: 10px !important;
  padding: 6px 14px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

#logoutBtn:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45) !important;
}

/* 4. Dashboard View: Toolbar & Filters */
.toolbar {
  background: #0c1e33 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  padding: 16px 20px !important;
  margin-bottom: 22px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.filters {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 12px !important;
}

.filters label {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  margin: 0 !important;
}

.filters select,
.filters input {
  height: 38px !important;
  padding: 6px 12px !important;
  background: #071526 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: 10px !important;
  color: #f1f5f9 !important;
  font-size: 0.88rem !important;
  min-width: 120px !important;
}

.mode-filter-group {
  display: flex !important;
  gap: 10px !important;
  align-items: flex-end !important;
}

.mode-filter-group.hidden {
  display: none !important;
}

#applyFilter {
  height: 38px !important;
  padding: 0 20px !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  background: #1b98e0 !important;
  border: none !important;
  color: #ffffff !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#applyFilter:hover {
  background: #0284c7 !important;
  box-shadow: 0 0 14px rgba(27, 152, 224, 0.45) !important;
}

.toolbar-note {
  font-size: 0.82rem !important;
  color: #38bdf8 !important;
  margin-top: 10px !important;
}

/* 5. Dashboard KPI Grid */
.kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
}

.kpi-card {
  background: linear-gradient(145deg, #0d223a, #081729) !important;
  border: 1px solid rgba(56, 189, 248, 0.18) !important;
  border-radius: 16px !important;
  padding: 18px 20px !important;
  position: relative !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.kpi-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.kpi-label {
  font-size: 0.84rem !important;
  color: #94a3b8 !important;
  margin: 0 0 8px 0 !important;
  font-weight: 500 !important;
}

.kpi-card h2 {
  font-size: 1.85rem !important;
  color: #f8fafc !important;
  font-weight: 700 !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.2 !important;
}

.click-hint {
  font-size: 0.75rem !important;
  color: #38bdf8 !important;
  opacity: 0.8 !important;
}

/* 6. Dashboard Chart Grid */
.chart-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 18px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1024px) {
  .chart-grid {
    grid-template-columns: 1fr !important;
  }
}

.chart-card {
  background: #0b1e33 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  padding: 20px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
}

.chart-card h3 {
  font-size: 1rem !important;
  color: #f1f5f9 !important;
  margin: 0 0 16px 0 !important;
  font-weight: 600 !important;
}

.chart-box {
  position: relative !important;
  min-height: 260px !important;
}

/* 7. Map Card & Table Card */
.map-card {
  margin-bottom: 24px !important;
}

.table-card {
  background: #0b1e33 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  margin-bottom: 24px !important;
}

.table-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.table-head h3 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  color: #f1f5f9 !important;
}

.table-scroll {
  overflow-x: auto !important;
  width: 100% !important;
}

/* 8. Claims View Styles */
.claims-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .claims-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.claims-kpi-grid .kpi-card {
  background: linear-gradient(145deg, #0d223a, #081729);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.claims-kpi-grid .kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.claims-kpi-grid .kpi-card.claimed {
  border-left: 4px solid #f59e0b !important;
}

.claims-kpi-grid .kpi-card.paid {
  border-left: 4px solid #22c55e !important;
}

.claims-kpi-grid .kpi-card.saved {
  border-left: 4px solid #38bdf8 !important;
}

.claims-kpi-grid .kpi-card.cases {
  border-left: 4px solid #a855f7 !important;
}

.claims-kpi-grid .kpi-card small {
  display: block;
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.claims-kpi-grid .kpi-card b {
  display: block;
  font-size: 1.55rem;
  color: #f8fafc;
  font-weight: 700;
  line-height: 1.2;
}

.claims-filter-card {
  background: #0b1e33;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.claims-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: flex-end;
}

.claims-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.claims-filter-grid select,
.claims-filter-grid input {
  height: 38px;
  padding: 6px 12px;
  background: #071526;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.88rem;
}

.claims-filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.claims-charts-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .claims-charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-panel {
  background: #0b1e33;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
}

.chart-panel-header h3 {
  font-size: 1.05rem;
  margin: 0;
  color: #f1f5f9;
}

.chart-panel-header small {
  color: #94a3b8;
  font-size: 0.8rem;
}

/* Badges & Pills */
.status-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.green {
  background: #052e16;
  color: #4ade80;
  border: 1px solid #166534;
}

.status-badge.blue {
  background: #082f49;
  color: #38bdf8;
  border: 1px solid #0369a1;
}

.status-badge.orange {
  background: #451a03;
  color: #fb923c;
  border: 1px solid #b45309;
}

.status-badge.yellow {
  background: #422006;
  color: #facc15;
  border: 1px solid #a16207;
}

.status-badge.gray {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
}

.code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #08172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-weight: 600;
}

.badge-year {
  background: #1e293b;
  color: #cbd5e1;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Claims Detail Modal */
.detail-header-card {
  background: linear-gradient(135deg, #0c233c, #091726);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .detail-grid-layout {
    grid-template-columns: 1fr;
  }
}

.detail-section-card {
  background: #0a1b2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}

.detail-section-card h3 {
  font-size: 0.95rem;
  color: #38bdf8;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-info-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-info-table th {
  text-align: left;
  padding: 6px 10px 6px 0;
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
  width: 38%;
  vertical-align: top;
}

.detail-info-table td {
  padding: 6px 0;
  font-size: 0.86rem;
  color: #e2e8f0;
  vertical-align: top;
}

.cost-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .cost-summary-row {
    grid-template-columns: 1fr;
  }
}

.cost-box {
  background: #061525;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}

.cost-box small {
  display: block;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.cost-box b {
  display: block;
  font-size: 1.15rem;
  color: #f8fafc;
}

.cost-box.highlight {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}

.cost-box.success {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.06);
}

.detail-text-box {
  background: #061525;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  line-height: 1.6;
  color: #e2e8f0;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px 0;
}

.pagination-bar button {
  background: #0d2138;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-bar button:hover:not(:disabled) {
  background: #1b98e0;
  color: #ffffff;
  border-color: #1b98e0;
}

.pagination-bar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-bar span {
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0 10px;
}

/* 9. Mobile Responsive (<901px) */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%) !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  main.content,
  .main.content,
  .content,
  .main {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 14px 14px 40px 14px !important;
  }
  #hamburger {
    display: inline-flex !important;
  }
}

/* ==========================================================================
   FORM GRID & FORM CONTROLS STYLES (CLEAN & MODERN)
   ========================================================================== */
.form-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  background: #0b1e33 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1200px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 680px) {
  .form-grid {
    grid-template-columns: 1fr !important;
  }
}

.form-grid > div {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.form-grid label {
  font-size: 0.84rem !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  margin: 0 !important;
  display: block !important;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100% !important;
  height: 40px !important;
  background: #071526 !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: 10px !important;
  color: #f1f5f9 !important;
  font-size: 0.9rem !important;
  padding: 8px 12px !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

.form-grid textarea {
  height: auto !important;
  min-height: 90px !important;
  resize: vertical !important;
}

.form-grid input[type="file"] {
  height: auto !important;
  padding: 8px 10px !important;
  background: #06111f !important;
  cursor: pointer !important;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
  background: #091b30 !important;
}

.form-section-title {
  grid-column: 1 / -1 !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
  padding: 12px 0 6px 0 !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18) !important;
  margin-top: 14px !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.full {
  grid-column: 1 / -1 !important;
}

.form-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-top: 8px !important;
  flex-wrap: wrap !important;
}

.existing-attachment-box {
  margin-top: 12px !important;
  padding: 12px 14px !important;
  background: #06111f !important;
  border: 1px solid rgba(56, 189, 248, 0.15) !important;
  border-radius: 12px !important;
}

.existing-attachment-head {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 8px !important;
}

.existing-attachment-head b {
  font-size: 0.88rem !important;
  color: #38bdf8 !important;
}

.existing-attachment-head small {
  color: #94a3b8 !important;
  font-size: 0.78rem !important;
}

.existing-attachment-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

/* ==========================================================================
   Table Single-Row Format & Compact Executive Styles
   (แถวเดียว ไม่ตัดบรรทัด คลิกดู Popup รายละเอียด)
   ========================================================================== */
.compact-table-row {
  cursor: pointer;
  transition: background 0.15s ease;
  height: 42px;
}
.compact-table-row:hover {
  background: rgba(56, 189, 248, 0.08) !important;
}

/* บังคับไม่ให้ข้อความในตารางตัดบรรทัด (Single-Row / White-Space Nowrap) */
#accidentTable,
#savedTable,
table.claims-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

#accidentTable th,
#accidentTable td,
#savedTable th,
#savedTable td,
table.claims-table th,
table.claims-table td {
  white-space: nowrap !important;
  vertical-align: middle !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  overflow: hidden !important;
}

#accidentTable thead th,
#savedTable thead th,
table.claims-table thead th {
  background: #0f1c2e !important;
  color: #94a3b8 !important;
  font-weight: 600 !important;
  border-bottom: 2px solid #1e293b !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
}

#accidentTable tbody tr,
#savedTable tbody tr,
table.claims-table tbody tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
}

/* Pill Tags */
.severity-col,
th.severity-col,
td.severity-col {
  text-align: left !important;
}

.severity-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sev-color, #22c7e8);
  background: color-mix(in srgb, var(--sev-color, #22c7e8) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--sev-color, #22c7e8) 35%, transparent);
  white-space: nowrap;
  vertical-align: middle;
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  white-space: nowrap;
}

.view-popup-btn {
  padding: 3px 9px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
  white-space: nowrap;
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-popup-btn:hover {
  background: #38bdf8 !important;
  color: #0b1320 !important;
}

.claim-desc-cell {
  max-width: 320px;
  min-width: 220px;
}
.claim-desc-snippet {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #cbd5e1;
  font-size: 12.5px;
  line-height: 1.4;
  transition: color 0.15s ease;
}
.compact-table-row:hover .claim-desc-snippet {
  color: #38bdf8;
  text-decoration: underline;
}
.claim-company-chip {
  font-size: 11px;
  color: #38bdf8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  display: block;
}

/* Truncation helpers for table cells */
.cell-truncate {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
}

/* คอลัมน์ทะเบียนเครื่องมือ: ล็อคความกว้างตามค่าเฉลี่ยส่วนมาก (~95px) ไม่ขยายตามข้อความที่ยาวผิดปกติ และซ้อนส่วนที่เกิน */
.text-plate {
  max-width: 95px !important;
  width: 95px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

.text-name {
  max-width: 130px !important;
}

.text-area {
  max-width: 125px !important;
}

/* คอลัมน์เครื่องมือ: ล็อคความกว้างตามค่าเฉลี่ยส่วนมาก (~135px) ไม่ขยายตามข้อความที่ยาวผิดปกติ และซ้อนส่วนที่เกิน */
.text-equip {
  max-width: 135px !important;
  width: 135px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block !important;
}


/* ==========================================================================
   หน้าเพิ่มข้อมูลอุบัติเหตุ (Accident Entry Modern & Compact 2-Column Layout)
   ========================================================================== */
.accident-entry-form {
  margin-top: 10px;
}

.entry-columns-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.entry-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry-card {
  background: var(--panel, #08172a);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease;
}

.entry-card:hover {
  border-color: rgba(56, 189, 248, 0.32);
}

.entry-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.entry-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #f1f5f9;
}

.entry-card-icon {
  font-size: 1.1rem;
}

.entry-card-badge {
  font-size: 11px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-weight: 500;
}

.entry-card-body {
  padding: 14px 16px;
}

.entry-field-grid {
  display: grid;
  gap: 10px 12px;
}

.entry-field-grid.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.entry-field-grid.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.entry-field-grid.grid-4 {
  grid-template-columns: 1.3fr 1.3fr 0.7fr 0.7fr;
}

.entry-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entry-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
}

.entry-field input,
.entry-field select,
.entry-field textarea {
  width: 100%;
  height: 38px;
  background: #061324;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.88rem;
  padding: 6px 10px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.entry-field input:focus,
.entry-field select:focus,
.entry-field textarea:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  background: #091a30;
}

.entry-field textarea {
  height: auto;
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}

.entry-subcard {
  margin-top: 12px;
  padding: 10px 12px;
  background: #040e1a;
  border: 1px dashed rgba(56, 189, 248, 0.2);
  border-radius: 10px;
}

.map-action-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.map-action-bar button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  cursor: pointer;
}

.map-action-bar button:hover {
  background: rgba(56, 189, 248, 0.2);
}

.input-readonly {
  background: #040e1c !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.2) !important;
}

.input-highlight {
  font-weight: 700 !important;
  color: #22c55e !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
}

.file-input-custom {
  height: auto !important;
  padding: 6px 8px !important;
  background: #040e1c !important;
  cursor: pointer !important;
}

.action-card {
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: linear-gradient(180deg, #091f38 0%, #061528 100%) !important;
}

.entry-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-save-main {
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

@media (max-width: 1024px) {
  .entry-columns-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   หน้าเพิ่ม User (User Entry Compact & Space-Saving Grid)
   ========================================================================== */
.user-entry-card {
  background: var(--panel, #08172a);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.user-form-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.3fr;
  gap: 12px 14px;
  align-items: start;
}

.user-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.user-field label {
  font-size: 0.84rem;
  font-weight: 500;
  color: #94a3b8;
  margin: 0;
}

.user-field input,
.user-field select {
  width: 100%;
  height: 38px;
  background: #061324;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.88rem;
  padding: 6px 10px;
  box-sizing: border-box;
}

.user-field input:focus,
.user-field select:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  background: #091a30;
}

/* Row 2 layout for user form: Photo on left, Submit button on right */
.field-photo {
  grid-column: 1 / 3;
}

.field-photo input[type="file"] {
  height: auto;
  padding: 6px 8px;
  background: #040e1c;
  cursor: pointer;
}

.field-actions {
  grid-column: 3 / -1;
  display: flex;
  flex-direction: column;
}

.user-submit-btn {
  height: 38px;
  padding: 0 24px;
  font-size: 0.92rem;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .user-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .field-photo,
  .field-actions {
    grid-column: 1 / -1;
  }
  .desktop-spacer-label {
    display: none;
  }
}

@media (max-width: 550px) {
  .user-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Popup รายละเอียดอุบัติเหตุ (Accident Detail & Claims Detail Modal Modern Layout)
   ========================================================================== */
.detail-modal-card {
  width: min(980px, 95vw) !important;
  max-width: 980px !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 22px 24px !important;
  background: #091a2e !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  border-radius: 20px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* Ensure any tables inside never trigger horizontal overflow */
.detail-modal-card table,
.detail-modal-card .detail-info-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}

.detail-modal-card .close-modal {
  position: absolute !important;
  top: 14px !important;
  right: 18px !important;
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #1e293b !important;
  border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  z-index: 10000 !important;
  pointer-events: auto !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  line-height: 1 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
}

.detail-modal-card .close-modal:hover {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  transform: scale(1.1) rotate(90deg) !important;
}

/* Header Card */
.detail-header-card {
  background: linear-gradient(135deg, #0d2847 0%, #081a2e 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 14px !important;
  padding: 16px 20px !important;
  margin-bottom: 14px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}

.detail-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-code-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-code-title {
  margin: 0;
  color: #38bdf8;
  font-size: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.detail-date-badge {
  font-size: 0.85rem;
  color: #94a3b8;
}

.detail-date-badge b {
  color: #f1f5f9;
}

.detail-header-right {
  display: flex;
  align-items: center;
  text-align: right;
}

.detail-cost-box {
  background: rgba(6, 19, 36, 0.75);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.cost-label {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.cost-amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: #22c55e;
}

.cost-sub {
  font-size: 0.76rem;
  color: #94a3b8;
}

/* 2-Column Info Summary */
.detail-grid-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.detail-grid-layout > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .detail-grid-layout {
    grid-template-columns: 1fr !important;
  }
}

.detail-section-card {
  background: #061527 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.detail-section-card h3 {
  font-size: 0.92rem !important;
  color: #38bdf8 !important;
  margin: 0 0 10px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

/* Key-Value Pair System (Replaces cramped tables) */
.detail-kv-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.detail-kv-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 5px 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  font-size: 0.86rem !important;
  gap: 10px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.detail-kv-row:last-child {
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.detail-kv-label {
  color: #94a3b8 !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  flex-shrink: 0 !important;
  width: 38% !important;
}

.detail-kv-val {
  color: #f1f5f9 !important;
  text-align: right !important;
  flex-grow: 1 !important;
  min-width: 0 !important;
  word-break: break-word !important;
}

.text-cyan {
  color: #38bdf8 !important;
}

/* Narrative Story Card */
.detail-narrative-card {
  margin-top: 12px;
  background: #061527;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 12px;
  padding: 14px 16px;
}

.detail-narrative-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  color: #38bdf8;
  margin-bottom: 8px;
}

.detail-narrative-icon {
  font-size: 1.05rem;
}

.detail-narrative-text {
  background: #030b15;
  border-left: 3px solid #38bdf8;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Dual Side-by-Side Grid for Root Cause & Corrective Action */
.detail-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .detail-dual-grid {
    grid-template-columns: 1fr;
  }
}

.detail-insight-box {
  background: #061527;
  border-radius: 12px;
  padding: 12px 14px;
}

.detail-insight-box.cause-box {
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.detail-insight-box.action-box {
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.insight-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.cause-box .insight-box-title {
  color: #fbbf24;
}

.action-box .insight-box-title {
  color: #4ade80;
}

.insight-box-content {
  background: #030b15;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.86rem;
  color: #e2e8f0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Footer Action Bar */
.detail-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  flex-wrap: wrap;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   2026 International Enterprise Design Suite (Modern & Executive Polish)
   ========================================================================== */

/* 1. Global Typography & Atmospheric Polish */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Prompt', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}

b, strong {
  font-weight: 600;
}

.code-pill, 
.badge-year,
.mono-val,
.claims-table td strong,
.table-scroll td:first-child,
.claims-kpi-grid .kpi-card b,
.kpi-card b {
  font-family: 'JetBrains Mono', 'Plus Jakarta Sans', monospace !important;
  font-feature-settings: "tnum" !important;
  font-variant-numeric: tabular-nums !important;
}

/* 2. Executive Cards & Subtle Glassmorphism */
.table-card,
.chart-panel,
.claims-filter-card,
.toolbar,
.filter-panel,
.settings-panel,
.accident-entry-card,
.user-entry-card {
  background: #0b1526 !important;
  border: 1px solid rgba(56, 189, 248, 0.14) !important;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 8px 24px -4px rgba(0, 0, 0, 0.35) !important;
  transition: all 0.25s ease !important;
}

.table-card:hover,
.chart-panel:hover {
  border-color: rgba(56, 189, 248, 0.28) !important;
}

/* 3. Executive Hero Summary Banner */
.executive-summary-new {
  background: linear-gradient(135deg, #0d2238 0%, #071220 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 20px !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 12px 36px rgba(0, 0, 0, 0.45) !important;
  position: relative !important;
  overflow: hidden !important;
}

.executive-summary-new::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* 4. Executive KPI Grid (4 Cards on Dashboard & Claims) */
.kpi-card,
.claims-kpi-grid .kpi-card {
  position: relative !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  background: linear-gradient(145deg, #0c182c, #07101e) !important;
  border: 1px solid rgba(56, 189, 248, 0.15) !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.3) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.kpi-card::before,
.claims-kpi-grid .kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  opacity: 0.85;
}

.kpi-card:nth-child(2)::before,
.claims-kpi-grid .kpi-card.claimed::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24) !important;
}

.kpi-card:nth-child(3)::before,
.claims-kpi-grid .kpi-card.paid::before {
  background: linear-gradient(90deg, #10b981, #34d399) !important;
}

.kpi-card:nth-child(4)::before,
.claims-kpi-grid .kpi-card.saved::before {
  background: linear-gradient(90deg, #8b5cf6, #a78bfa) !important;
}

.kpi-card:hover,
.claims-kpi-grid .kpi-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 16px rgba(14, 165, 233, 0.15) !important;
}

.kpi-card b,
.claims-kpi-grid .kpi-card b {
  font-size: 1.85rem !important;
  letter-spacing: -0.5px !important;
  font-weight: 700 !important;
}

/* 5. Modern Filter Panel & Input Controls */
.filter-panel,
.claims-filter-card {
  background: #091424 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  padding: 16px 20px !important;
}

select,
input[type="text"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="password"] {
  background: #060e1a !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 10px !important;
  color: #f8fafc !important;
  transition: all 0.2s ease !important;
}

select:focus,
input:focus,
textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25) !important;
  outline: none !important;
  background: #081324 !important;
}

/* 6. Primary Buttons with Radiant Gradient */
.primary-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35) !important;
  transition: all 0.2s ease !important;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45) !important;
  transform: translateY(-1px) !important;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  border-radius: 10px !important;
  transition: all 0.2s ease !important;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: #ffffff !important;
}

/* 7. Modern Tables with Compact Single-Row Elegance */
.table-scroll {
  border-radius: 0 0 14px 14px !important;
}

table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

table thead th {
  background: #081220 !important;
  color: #94a3b8 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 11px 14px !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.16) !important;
  white-space: nowrap !important;
}

table tbody tr {
  background: transparent !important;
  transition: background-color 0.15s ease !important;
}

table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015) !important;
}

table tbody tr:hover {
  background: rgba(14, 165, 233, 0.06) !important;
}

table tbody td {
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  font-size: 0.86rem !important;
  color: #e2e8f0 !important;
}

/* 8. Glowing Status Badges */
.status-badge,
.status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.status-badge.green,
.status-pill.green {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #34d399 !important;
}

.status-badge.yellow,
.status-pill.yellow {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  color: #fbbf24 !important;
}

.status-badge.orange,
.status-pill.orange {
  background: rgba(249, 115, 22, 0.12) !important;
  border: 1px solid rgba(249, 115, 22, 0.3) !important;
  color: #fb923c !important;
}

.status-badge.blue,
.status-pill.blue {
  background: rgba(14, 165, 233, 0.12) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  color: #38bdf8 !important;
}

.status-badge.gray,
.status-pill.gray {
  background: rgba(148, 163, 184, 0.1) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #94a3b8 !important;
}

/* 9. Sleek Code Pills & Fiscal Badges */
.code-pill {
  background: rgba(14, 165, 233, 0.08) !important;
  border: 1px solid rgba(14, 165, 233, 0.25) !important;
  color: #38bdf8 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
}

.badge-year {
  background: rgba(14, 165, 233, 0.14) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  display: inline-block !important;
}

/* 10. Modern Frosted Modal Backdrop */
.modal {
  background: rgba(3, 7, 18, 0.78) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

/* Topbar Avatar & Status Badge */
.avatar-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.online-dot {
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 9px !important;
  height: 9px !important;
  background: #10b981 !important;
  border: 2px solid #081426 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 8px #10b981 !important;
}

.role-badge {
  background: rgba(14, 165, 233, 0.15) !important;
  border: 1px solid rgba(14, 165, 233, 0.3) !important;
  padding: 1px 7px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  color: #38bdf8 !important;
  font-weight: 600 !important;
  margin-left: 4px !important;
}

/* Enhanced Visual Balance & Micro-Interactions */
.side-nav .nav-item {
  position: relative;
  overflow: hidden;
}

.side-nav .nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: #0ea5e9;
  border-radius: 0 4px 4px 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-nav .nav-item.active::after {
  transform: translateY(-50%) scaleY(1);
}

/* Clean smooth focus outline for all buttons & links */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #0ea5e9 !important;
  outline-offset: 1px !important;
}

/* Dashboard Order & Spacing */
#view-dashboard .executive-summary-new {
  margin-top: 0 !important;
  margin-bottom: 14px !important;
}

#view-dashboard .filter-panel {
  margin-top: 0 !important;
  margin-bottom: 14px !important;
}

/* ==========================================================================
   Filter Panel Single-Row Layout & Quick Buttons
   ========================================================================== */
.filter-panel {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  background: #0b1526 !important;
  border: 1px solid rgba(56, 189, 248, 0.16) !important;
  border-radius: 16px !important;
  padding: 14px 18px !important;
  overflow-x: auto !important;
}

.filter-col {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

.filter-col-mode { flex: 0 0 135px !important; }
.filter-col-from { flex: 0 0 115px !important; }
.filter-col-to   { flex: 0 0 115px !important; }
.filter-col-equip { flex: 1 1 170px !important; min-width: 140px !important; }
.filter-col-quick { flex: 0 0 auto !important; }
.filter-col-apply { flex: 0 0 100px !important; }

.filter-col select {
  height: 44px !important;
  font-size: 13.5px !important;
  padding: 0 12px !important;
}

.quick-btn-group {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
}

.quick-filter-btn {
  height: 44px !important;
  padding: 0 16px !important;
  background: rgba(14, 165, 233, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 12px !important;
  color: #7dd3fc !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.quick-filter-btn:hover {
  background: rgba(14, 165, 233, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25) !important;
}

.quick-filter-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45) !important;
}

/* ==========================================================================
   Topbar Theme Toggle Pill
   ========================================================================== */
.theme-toggle-pill {
  height: 34px !important;
  padding: 0 12px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.2s ease !important;
}

.theme-toggle-pill:hover {
  background: rgba(14, 165, 233, 0.15) !important;
  border-color: var(--cyan) !important;
  color: var(--cyan-hover) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   Complete Light Mode Theme System
   ========================================================================== */
/* ==========================================================================
   Complete Light Mode Theme System
   ========================================================================== */
html[data-theme="light"],
:root[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --navy: #f8fafc;
  --navy2: #ffffff;
  --panel: #ffffff;
  --panel2: #f8fafc;
  --panel-elevated: #ffffff;
  --cyan: #0284c7;
  --cyan-hover: #0369a1;
  --cyan-glow: rgba(2, 132, 199, 0.15);
  --blue-primary: #0284c7;
  --gold: #d97706;
  --red: #e11d48;
  --green: #059669;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --line: #cbd5e1;
  --line-highlight: rgba(2, 132, 199, 0.35);
  --white: #0f172a;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] body.app-body,
html[data-theme="light"] .app-body,
html[data-theme="light"] .main,
html[data-theme="light"] main.content,
html[data-theme="light"] .content {
  background: #f1f5f9 !important;
  background-image: none !important;
  color: #0f172a !important;
}

/* Sidebar in Light Mode */
html[data-theme="light"] .sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .sidebar-brand {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .sidebar-brand b {
  color: #0f172a !important;
}

html[data-theme="light"] .side-nav .nav-item,
html[data-theme="light"] .nav-item {
  color: #475569 !important;
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme="light"] .side-nav .nav-item b,
html[data-theme="light"] .nav-item b {
  color: #475569 !important;
}

html[data-theme="light"] .side-nav .nav-item:hover,
html[data-theme="light"] .nav-item:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .side-nav .nav-item:hover b,
html[data-theme="light"] .nav-item:hover b {
  color: #0284c7 !important;
}

html[data-theme="light"] .side-nav .nav-item.active,
html[data-theme="light"] .nav-item.active {
  background: #e0f2fe !important;
  border-left: 3px solid #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .side-nav .nav-item.active b,
html[data-theme="light"] .nav-item.active b {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .side-nav .nav-item.active span,
html[data-theme="light"] .nav-item.active span {
  background: rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .side-foot {
  border-top: 1px solid #e2e8f0 !important;
}

/* Topbar in Light Mode */
html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .topbar h1,
html[data-theme="light"] .bar-left h1 {
  color: #0f172a !important;
}

html[data-theme="light"] #hamburger {
  color: #0f172a !important;
}

html[data-theme="light"] .user-chip {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .user-chip div,
html[data-theme="light"] .user-chip b {
  color: #0f172a !important;
}

html[data-theme="light"] .user-chip small,
html[data-theme="light"] .role-badge {
  background: #e0f2fe !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .topbar-lang,
html[data-theme="light"] .lang-switch-wrap {
  color: #475569 !important;
}

html[data-theme="light"] .theme-toggle-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .theme-toggle-pill:hover {
  background: #e2e8f0 !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

/* Executive Summary in Light Mode */
html[data-theme="light"] .executive-summary-new {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%) !important;
  border: 1px solid rgba(2, 132, 199, 0.3) !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.08) !important;
}

html[data-theme="light"] .executive-summary-new .eyebrow {
  color: #0284c7 !important;
}

html[data-theme="light"] .zero-slogan {
  color: #0c4a6e !important;
}

html[data-theme="light"] .zero-slogan span {
  color: #d97706 !important;
}

html[data-theme="light"] .summary-text #summaryHeadline {
  color: #0369a1 !important;
}

html[data-theme="light"] .summary-text #summaryDesc {
  color: #334155 !important;
}

html[data-theme="light"] .summary-stat-main {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] #trendBadge {
  color: #d97706 !important;
}

html[data-theme="light"] .summary-stat-main small,
html[data-theme="light"] #trendBadgeLabel {
  color: #475569 !important;
}

html[data-theme="light"] .summary-stat-change,
html[data-theme="light"] #accidentTrendBox,
html[data-theme="light"] #accidentAvgHistBox {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] #accidentTrendText,
html[data-theme="light"] #accidentAvgHistText {
  color: #0f172a !important;
}

html[data-theme="light"] #accidentTrendDesc,
html[data-theme="light"] #accidentAvgHistDesc {
  color: #475569 !important;
}

/* Filter Panel & Form Inputs in Light Mode */
html[data-theme="light"] .filter-panel,
html[data-theme="light"] .toolbar,
html[data-theme="light"] .claims-filter-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .filter-panel label,
html[data-theme="light"] .filters label,
html[data-theme="light"] .claims-filter-card label {
  color: #334155 !important;
}

html[data-theme="light"] select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="search"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] textarea,
html[data-theme="light"] .filters select,
html[data-theme="light"] .filters input,
html[data-theme="light"] .filter-panel select,
html[data-theme="light"] .form-grid select,
html[data-theme="light"] .form-grid input,
html[data-theme="light"] .form-grid textarea,
html[data-theme="light"] .settings-panel select,
html[data-theme="light"] .modal-card input,
html[data-theme="light"] .modal-card textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] select:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .quick-filter-btn {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .quick-filter-btn:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .quick-filter-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

/* KPI Cards in Light Mode */
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .claims-kpi-grid .kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .kpi-card:hover,
html[data-theme="light"] .claims-kpi-grid .kpi-card:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .kpi-card span,
html[data-theme="light"] .kpi-label {
  color: #475569 !important;
}

html[data-theme="light"] .kpi-card b,
html[data-theme="light"] .kpi-card h2,
html[data-theme="light"] .claims-kpi-grid .kpi-card b {
  color: #0f172a !important;
}

html[data-theme="light"] .kpi-card.gold b {
  color: #d97706 !important;
}

html[data-theme="light"] .kpi-card.danger b {
  color: #e11d48 !important;
}

html[data-theme="light"] .kpi-card small,
html[data-theme="light"] .click-hint {
  color: #64748b !important;
}

/* Equipment Cards in Light Mode */
html[data-theme="light"] .equipment-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .equipment-card:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .equipment-card img {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .equipment-card .body {
  background: #ffffff !important;
}

html[data-theme="light"] .equipment-card b {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .equipment-card .num strong {
  color: #e11d48 !important;
}

html[data-theme="light"] .equipment-card .num span {
  color: #64748b !important;
}

html[data-theme="light"] .equipment-card small {
  color: #475569 !important;
}

html[data-theme="light"] .equipment-card .bar {
  background: #e2e8f0 !important;
}

html[data-theme="light"] .equipment-card .bar i {
  background: #0284c7 !important;
}

/* Charts & Panels in Light Mode */
html[data-theme="light"] .chart-card,
html[data-theme="light"] .chart-panel,
html[data-theme="light"] .claims-chart-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .chart-card h2,
html[data-theme="light"] .chart-card h3,
html[data-theme="light"] .chart-panel-header h3,
html[data-theme="light"] .section-head h2 {
  color: #0f172a !important;
}

html[data-theme="light"] .chart-card p,
html[data-theme="light"] .chart-card small,
html[data-theme="light"] .chart-panel-header small {
  color: #64748b !important;
}

html[data-theme="light"] .pareto-detail-row {
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .pareto-detail-row:hover {
  background: #f8fafc !important;
}

html[data-theme="light"] .pareto-detail-row b {
  color: #0f172a !important;
}

html[data-theme="light"] .pareto-detail-row span {
  color: #0284c7 !important;
}

html[data-theme="light"] .pareto-detail-row small {
  color: #64748b !important;
}

html[data-theme="light"] .severity-legend-row b {
  color: #1e293b !important;
}

html[data-theme="light"] .severity-legend-row span {
  color: #475569 !important;
}

html[data-theme="light"] .donut:before {
  background: #ffffff !important;
}

html[data-theme="light"] .donut span {
  color: #0f172a !important;
}

html[data-theme="light"] .chart-foot-link,
html[data-theme="light"] .clickable {
  color: #0284c7 !important;
}

/* Table Cards & Tables in Light Mode */
html[data-theme="light"] .table-card,
html[data-theme="light"] .claims-table-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .table-card-header,
html[data-theme="light"] .table-head {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .table-card-header h2,
html[data-theme="light"] .table-card-header h3,
html[data-theme="light"] .table-head h3 {
  color: #0f172a !important;
}

html[data-theme="light"] table {
  background: #ffffff !important;
}

html[data-theme="light"] table th {
  background: #f8fafc !important;
  color: #334155 !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

html[data-theme="light"] table td {
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

html[data-theme="light"] table tr:hover td {
  background: #f8fafc !important;
}

html[data-theme="light"] .case-pill,
html[data-theme="light"] .code-pill {
  background: #f1f5f9 !important;
  color: #0369a1 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Forms, News, Settings, Logs & Modals in Light Mode */
html[data-theme="light"] .news-card,
html[data-theme="light"] .settings-panel,
html[data-theme="light"] .user-entry-card,
html[data-theme="light"] .accident-entry-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .news-content h3,
html[data-theme="light"] .settings-panel h2,
html[data-theme="light"] .settings-panel h3,
html[data-theme="light"] .user-entry-card h2,
html[data-theme="light"] .user-entry-card h3,
html[data-theme="light"] .accident-entry-card h3,
html[data-theme="light"] .entry-card-title b {
  color: #0f172a !important;
}

html[data-theme="light"] .news-content p,
html[data-theme="light"] .entry-card-desc,
html[data-theme="light"] .form-grid label,
html[data-theme="light"] .settings-panel label {
  color: #334155 !important;
}

html[data-theme="light"] .entry-card-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .entry-card-badge {
  background: #e0f2fe !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .news-meta {
  color: #64748b !important;
}

html[data-theme="light"] .modal-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .modal-card h2,
html[data-theme="light"] .modal-card h3,
html[data-theme="light"] .modal-card h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .modal-card p {
  color: #334155 !important;
}

html[data-theme="light"] .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .modal-footer {
  border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .equipment-insight-right {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .equipment-insight-right h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .equipment-media-img,
html[data-theme="light"] .equipment-media-video {
  background: #e2e8f0 !important;
}

/* ==========================================================================
   Equipment Cards - Single Row Squeeze (แถวเดียวกันทั้งหมด 7 การ์ด ขนาดรูปภาพเท่าเดิม)
   ========================================================================== */
.equipment-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 14px !important;
  width: 100% !important;
  overflow-x: auto !important;
  scrollbar-width: thin;
}

@media (max-width: 1024px) {
  .equipment-grid {
    grid-template-columns: repeat(7, minmax(120px, 1fr)) !important;
    padding-bottom: 6px !important;
  }
}

.equipment-card {
  min-width: 0 !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.equipment-card:hover {
  transform: translateY(-2px);
}

.equipment-card img {
  width: 100% !important;
  height: 118px !important;
  object-fit: contain !important;
  display: block !important;
  padding: 4px !important;
}

.equipment-card .body {
  padding: 7px 8px 9px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  justify-content: space-between !important;
  min-width: 0 !important;
}

.equipment-card b {
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  min-height: 28px !important;
  max-height: 28px !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-bottom: 2px !important;
}

.equipment-card .num {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  margin-top: 4px !important;
}

.equipment-card .num strong {
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: -0.5px !important;
}

.equipment-card .num span {
  font-size: 11px !important;
  font-weight: 600 !important;
}

.equipment-card small {
  font-size: 10px !important;
  line-height: 1.2 !important;
  margin-top: 3px !important;
  display: block !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.equipment-card .bar {
  height: 4px !important;
  margin-top: 6px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
}

/* ==========================================================================
   KPI Cards - Compact 30% reduction (ลดพื้นที่ว่างด้านล่างลง 30% ให้กระชับ สวยงาม)
   ========================================================================== */
.kpi-grid,
.claims-kpi-grid {
  gap: 10px !important;
  margin-top: 10px !important;
  margin-bottom: 12px !important;
}

.kpi-card,
.claims-kpi-grid .kpi-card {
  padding: 10px 14px !important;
  min-height: 0 !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.kpi-card span,
.claims-kpi-grid .kpi-card small:first-child {
  font-size: 11.5px !important;
  line-height: 1.2 !important;
  margin-bottom: 2px !important;
  opacity: 0.85 !important;
  display: block !important;
}

.kpi-card b,
.claims-kpi-grid .kpi-card b {
  font-size: 1.6rem !important;
  line-height: 1.15 !important;
  margin: 2px 0 !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
}

.latest-accident-card b {
  font-size: 1.45rem !important;
}

#kpiTop {
  font-size: 1.25rem !important;
  line-height: 1.15 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

.kpi-card small,
.claims-kpi-grid .kpi-card small:last-child {
  font-size: 11px !important;
  line-height: 1.2 !important;
  margin-top: 2px !important;
  opacity: 0.75 !important;
  display: block !important;
}

/* ==========================================================================
   Date & Time Picker Enhancement (White Icon in Dark Mode, 24-Hour Dual Select)
   ========================================================================== */
input[type="date"],
input[type="time"] {
  cursor: pointer !important;
}

/* 1. White Calendar & Time Picker Indicator in Dark Mode */
html:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator,
html:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.4) !important;
  opacity: 0.95 !important;
  cursor: pointer !important;
  padding: 3px !important;
  border-radius: 4px !important;
  transition: opacity 0.15s ease, background 0.15s ease !important;
}

html:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator:hover,
html:not([data-theme="light"]) input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Browser native popup color scheme */
html:not([data-theme="light"]) input[type="date"],
html:not([data-theme="light"]) input[type="time"] {
  color-scheme: dark !important;
}

html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="time"] {
  color-scheme: light !important;
}

html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none !important;
  opacity: 0.7 !important;
  cursor: pointer !important;
}

/* 2. 24-Hour Dual Select Time Picker (HH : MM) */
.time-picker-24h {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.time-picker-24h .time-select {
  flex: 1 !important;
  min-width: 0 !important;
  height: 38px !important;
  background: #061324 !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  padding: 6px 8px !important;
  text-align: center !important;
  cursor: pointer !important;
  font-family: 'JetBrains Mono', monospace, sans-serif !important;
}

.time-picker-24h .time-select:focus {
  border-color: #38bdf8 !important;
  outline: none !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
  background: #091a30 !important;
}

.time-picker-24h .time-sep {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
  user-select: none !important;
  line-height: 1 !important;
}

.time-picker-24h .time-unit {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  user-select: none !important;
}

html[data-theme="light"] .time-picker-24h .time-select {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .time-picker-24h .time-select:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="light"] .time-picker-24h .time-sep {
  color: #0284c7 !important;
}

html[data-theme="light"] .time-picker-24h .time-unit {
  color: #64748b !important;
}

/* ==========================================================================
   Claims Comprehensive Filter Toolbar (จากปี, ถึงปี, ประเภทรถ, พื้นที่, ประเภทความเสียหาย)
   ========================================================================== */
.claims-filter-card {
  background: #0b1e33 !important;
  border: 1px solid rgba(56, 189, 248, 0.18) !important;
  border-radius: 16px !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
}

.claims-filter-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  gap: 10px !important;
  width: 100% !important;
}

.claims-filter-row .filter-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 1 140px !important;
  min-width: 120px !important;
}

.claims-filter-row .filter-item label {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.claims-filter-row .filter-item select,
.claims-filter-row .filter-item input {
  height: 38px !important;
  background: #061324 !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  border-radius: 8px !important;
  color: #f8fafc !important;
  font-size: 0.88rem !important;
  padding: 6px 10px !important;
  width: 100% !important;
  cursor: pointer !important;
}

.claims-filter-row .filter-item select:focus,
.claims-filter-row .filter-item input:focus {
  border-color: #38bdf8 !important;
  outline: none !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25) !important;
  background: #091a30 !important;
}

.claims-filter-row .filter-search-item {
  flex: 2 1 200px !important;
  min-width: 180px !important;
}

html[data-theme="light"] .claims-filter-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .claims-filter-row .filter-item select,
html[data-theme="light"] .claims-filter-row .filter-item input {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .claims-filter-row .filter-item label {
  color: #475569 !important;
}

html[data-theme="light"] .claims-filter-header b {
  color: #0f172a !important;
}

/* ==========================================================================
   Comprehensive Light Theme Text & Table High-Contrast Overrides
   (แก้ไขข้อความทุกจุดในโหมดสว่างให้แสดงสีเข้ม คมชัด อ่านออก 100%)
   ========================================================================== */

/* 1. ปีงบประมาณ (.badge-year) - ปรับเป็นสีเข้ม คมชัด ไม่จาง */
html[data-theme="light"] .badge-year,
body.light-theme .badge-year {
  background: #e2e8f0 !important;
  border: 1px solid #94a3b8 !important;
  color: #0f172a !important; /* ดำเข้มคมชัด */
  font-weight: 800 !important;
  font-size: 0.82rem !important;
}

/* 2. หัวตารางทุกตารางในโหมดสว่าง (Header) */
html[data-theme="light"] #accidentTable thead th,
body.light-theme #accidentTable thead th,
html[data-theme="light"] #savedTable thead th,
body.light-theme #savedTable thead th,
html[data-theme="light"] table.claims-table thead th,
body.light-theme table.claims-table thead th,
html[data-theme="light"] table.mini-insight-table thead th,
body.light-theme table.mini-insight-table thead th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

/* 3. เนื้อหาแถวในตารางทุกตารางในโหมดสว่าง (Body cells) */
html[data-theme="light"] #accidentTable td,
body.light-theme #accidentTable td,
html[data-theme="light"] #savedTable td,
body.light-theme #savedTable td,
html[data-theme="light"] table.claims-table td,
body.light-theme table.claims-table td,
html[data-theme="light"] table.mini-insight-table td,
body.light-theme table.mini-insight-table td {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .compact-table-row:hover,
body.light-theme .compact-table-row:hover {
  background: #f8fafc !important;
}

/* 4. คลาสข้อความเฉพาะในตาราง Dashboard & เพิ่มอุบัติเหตุ */
html[data-theme="light"] .text-plate,
body.light-theme .text-plate {
  color: #334155 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .text-name,
body.light-theme .text-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .text-area,
body.light-theme .text-area {
  color: #1e293b !important;
}

html[data-theme="light"] .text-equip,
body.light-theme .text-equip {
  color: #0f172a !important;
  font-weight: 600 !important;
}

/* 5. คลาสข้อความเฉพาะในตารางประวัติอุบัติเหตุ (Claims Table) */
.claim-equip-title,
.claim-emp-name,
.claim-loc-text {
  font-weight: 600;
  color: #f1f5f9;
  font-size: 13px;
}

.claim-sub-text {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.claim-zone-pill {
  font-size: 11px;
  color: #38bdf8;
  margin-top: 2px;
  font-weight: 500;
}

.claim-col-date {
  color: #94a3b8;
  font-size: 12.5px;
}

html[data-theme="light"] .claim-equip-title,
body.light-theme .claim-equip-title,
html[data-theme="light"] .claim-emp-name,
body.light-theme .claim-emp-name,
html[data-theme="light"] .claim-loc-text,
body.light-theme .claim-loc-text {
  color: #0f172a !important; /* เข้ม ชัดเจน คมกริบ */
  font-weight: 700 !important;
}

html[data-theme="light"] .claim-sub-text,
body.light-theme .claim-sub-text {
  color: #475569 !important; /* เทาเข้ม อ่านง่าย */
  font-weight: 500 !important;
}

html[data-theme="light"] .claim-zone-pill,
body.light-theme .claim-zone-pill {
  color: #0284c7 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .claim-col-date,
body.light-theme .claim-col-date {
  color: #1e293b !important;
  font-weight: 600 !important;
}

/* 6. ป้ายสถานะ (Status Badges) ในโหมดสว่างให้เป็นโทนสีเข้มชัดเจน */
html[data-theme="light"] .status-badge.yellow,
html[data-theme="light"] .status-pill.yellow,
body.light-theme .status-badge.yellow,
body.light-theme .status-pill.yellow {
  background: #fef3c7 !important;
  border: 1px solid #fcd34d !important;
  color: #b45309 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .status-badge.orange,
html[data-theme="light"] .status-pill.orange,
body.light-theme .status-badge.orange,
body.light-theme .status-pill.orange {
  background: #ffedd5 !important;
  border: 1px solid #fdba74 !important;
  color: #c2410c !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .status-badge.green,
html[data-theme="light"] .status-pill.green,
body.light-theme .status-badge.green,
body.light-theme .status-pill.green {
  background: #dcfce7 !important;
  border: 1px solid #86efac !important;
  color: #15803d !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .status-badge.blue,
html[data-theme="light"] .status-pill.blue,
body.light-theme .status-badge.blue,
body.light-theme .status-pill.blue {
  background: #e0f2fe !important;
  border: 1px solid #7dd3fc !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .status-badge.gray,
html[data-theme="light"] .status-pill.gray,
body.light-theme .status-badge.gray,
body.light-theme .status-pill.gray {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-weight: 700 !important;
}

/* 7. ตารางรายการที่บันทึกแล้ว (#savedTable) และปุ่มจัดการ */
#savedTable {
  min-width: 960px !important;
}

#savedTable th:last-child,
#savedTable td:last-child {
  width: 130px !important;
  min-width: 130px !important;
  overflow: visible !important;
  padding: 6px 4px !important;
  text-align: center !important;
}

.saved-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.saved-row-actions .btn-table-act {
  padding: 3px 6px !important;
  font-size: 13px !important;
  line-height: 1 !important;
  border-radius: 6px !important;
  cursor: pointer;
}

.saved-row-actions .view-popup-btn {
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

/* 8. ตารางในหน้าต่าง Popup Insight แบบกะทัดรัด (Mini Insight Table) */
.mini-insight-scroll {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  margin: 10px 0 !important;
  overflow: hidden !important;
  max-height: 480px !important;
  overflow-y: auto !important;
}

html[data-theme="light"] .mini-insight-scroll,
body.light-theme .mini-insight-scroll {
  border-color: #cbd5e1 !important;
}

table.mini-insight-table {
  min-width: 100% !important;
  width: 100% !important;
  table-layout: fixed !important;
}

table.mini-insight-table th,
table.mini-insight-table td {
  padding: 8px 10px !important;
  font-size: 13px !important;
}

/* 9. Popup แสดงรายละเอียดเคสในโหมดสว่าง */
html[data-theme="light"] .detail-header-card,
body.light-theme .detail-header-card {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe) !important;
  border: 1px solid #bae6fd !important;
}

html[data-theme="light"] .detail-header-card h2,
body.light-theme .detail-header-card h2 {
  color: #0f172a !important;
}

html[data-theme="light"] .detail-section-card,
body.light-theme .detail-section-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .detail-section-card h3,
body.light-theme .detail-section-card h3 {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .detail-info-table th,
body.light-theme .detail-info-table th {
  color: #475569 !important;
  background: transparent !important;
}

html[data-theme="light"] .detail-info-table td,
body.light-theme .detail-info-table td {
  color: #0f172a !important;
}

/* ==========================================================================
   Professional Safety Analytics & Multi-Dimensional Assessment Card
   (การ์ดบทวิเคราะห์และข้อเสนอแนะเชิงยุทธศาสตร์ด้านความปลอดภัย)
   ========================================================================== */
.safety-analytics-card {
  background: var(--panel, #08172a);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.safety-analytics-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #f59e0b, #ef4444);
}

.safety-analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.safety-badge-expert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.safety-analytics-title {
  margin: 0 0 6px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.safety-analytics-subtitle {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 820px;
}

.safety-analytics-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
}

.meta-tag .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.meta-tag .dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); }
.meta-tag .dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.meta-tag .dot.yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.meta-tag .dot.blue { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }

/* Daily Morning Briefing & Conversational Safety Officer Talk (07:00 AM) */
.safety-daily-briefing-wrap {
  margin-bottom: 22px;
}

.safety-talk-bubble {
  display: flex;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 14px;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.safety-talk-bubble.safe-theme {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.09), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-left: 5px solid #22c55e;
}

.safety-talk-bubble.alert-theme {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(15, 23, 42, 0.88));
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 5px solid #f59e0b;
}

.advisor-avatar-box {
  position: relative;
  flex-shrink: 0;
}

.advisor-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.safety-talk-bubble.alert-theme .advisor-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.online-pulse-green,
.online-pulse-yellow {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #08172a;
}

.online-pulse-green {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.online-pulse-yellow {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.advisor-dialog-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.advisor-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.advisor-name {
  font-weight: 700;
  color: #f8fafc;
  font-size: 0.95rem;
  letter-spacing: -0.2px;
}

.briefing-cycle-pill {
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}

.briefing-cycle-pill b {
  color: #38bdf8;
  font-weight: 700;
}

.auto-update-tag {
  font-size: 0.75rem;
  color: #86efac;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.auto-update-tag.warn {
  color: #fde047;
}

.dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseLive 2s infinite ease-in-out;
}

.dot-live.red {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.dialog-speech {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 12px 16px;
  border-left: 3px solid rgba(56, 189, 248, 0.4);
}

.highlight-safe {
  color: #4ade80;
  font-weight: 700;
}

.highlight-alert {
  color: #fbbf24;
  font-weight: 700;
}

.dialog-quick-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.status-mini-card {
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.status-mini-card.green {
  background: rgba(34, 197, 94, 0.07);
  border-color: rgba(34, 197, 94, 0.25);
}

.status-mini-card.blue {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.25);
}

.status-mini-card.cyan {
  background: rgba(20, 184, 166, 0.07);
  border-color: rgba(20, 184, 166, 0.25);
}

.status-mini-card.red {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.25);
}

.status-mini-card.yellow {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.25);
}

.status-mini-card .mini-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
}

.status-mini-card .mini-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
}

.status-mini-card.green .mini-val { color: #4ade80; }
.status-mini-card.blue .mini-val { color: #38bdf8; }
.status-mini-card.cyan .mini-val { color: #2dd4bf; }
.status-mini-card.red .mini-val { color: #f87171; }
.status-mini-card.yellow .mini-val { color: #fbbf24; }

@media (max-width: 768px) {
  .safety-talk-bubble {
    flex-direction: column;
    gap: 14px;
  }
  .dialog-quick-status {
    grid-template-columns: 1fr;
  }
}

/* Grid 4 Dimensions */
.safety-dimensions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.dimension-card {
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dimension-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dimension-card.success-card {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(15, 23, 42, 0.6));
  border-left: 4px solid #22c55e;
}

.dimension-card.danger-card {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(15, 23, 42, 0.6));
  border-left: 4px solid #ef4444;
}

.dimension-card.warning-card {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(15, 23, 42, 0.6));
  border-left: 4px solid #f59e0b;
}

.dimension-card.info-card {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08), rgba(15, 23, 42, 0.6));
  border-left: 4px solid #38bdf8;
}

.dimension-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.dim-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.dim-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.dim-tag.success { background: rgba(34, 197, 94, 0.18); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.dim-tag.danger { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.dim-tag.warning { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.dim-tag.info { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }

.dim-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: #f1f5f9;
}

.dimension-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.dim-finding {
  margin: 0;
  color: #cbd5e1;
}

.dim-finding strong {
  color: #f8fafc;
}

.dim-conclusion {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  padding: 8px 12px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
}

.dim-label {
  font-weight: 700;
  color: #e2e8f0;
  display: block;
  margin-bottom: 2px;
}

.dim-action {
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
}

.action-label {
  font-weight: 700;
  color: #38bdf8;
  display: block;
  margin-bottom: 2px;
}

/* Strategic Roadmap Box */
.safety-strategy-box {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(7, 18, 33, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 20px 22px;
}

.strategy-header {
  margin-bottom: 16px;
}

.strategy-badge {
  display: inline-block;
  background: linear-gradient(90deg, #0284c7, #2563eb);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.strategy-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.strategy-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  gap: 12px;
  transition: all 0.2s ease;
}

.strategy-item:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.strategy-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0ea5e9);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.strategy-content b {
  display: block;
  font-size: 0.88rem;
  color: #f1f5f9;
  margin-bottom: 6px;
  line-height: 1.35;
}

.strategy-content p {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .safety-dimensions-grid {
    grid-template-columns: 1fr;
  }
  .strategy-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .strategy-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Light Mode Overrides for Safety Analytics
   ========================================================================== */
html[data-theme="light"] .safety-analytics-card,
body.light-theme .safety-analytics-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .safety-analytics-header,
body.light-theme .safety-analytics-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .safety-analytics-title,
body.light-theme .safety-analytics-title {
  color: #0f172a !important;
}

html[data-theme="light"] .safety-analytics-subtitle,
body.light-theme .safety-analytics-subtitle {
  color: #475569 !important;
}

html[data-theme="light"] .meta-tag,
body.light-theme .meta-tag {
  color: #334155 !important;
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .dimension-card,
body.light-theme .dimension-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .dimension-card.success-card,
body.light-theme .dimension-card.success-card {
  border-left: 4px solid #16a34a !important;
  background: linear-gradient(180deg, #f0fdf4, #ffffff) !important;
}

html[data-theme="light"] .dimension-card.danger-card,
body.light-theme .dimension-card.danger-card {
  border-left: 4px solid #dc2626 !important;
  background: linear-gradient(180deg, #fef2f2, #ffffff) !important;
}

html[data-theme="light"] .dimension-card.warning-card,
body.light-theme .dimension-card.warning-card {
  border-left: 4px solid #d97706 !important;
  background: linear-gradient(180deg, #fffbeb, #ffffff) !important;
}

html[data-theme="light"] .dimension-card.info-card,
body.light-theme .dimension-card.info-card {
  border-left: 4px solid #0284c7 !important;
  background: linear-gradient(180deg, #f0f9ff, #ffffff) !important;
}

html[data-theme="light"] .dim-title,
body.light-theme .dim-title {
  color: #0f172a !important;
}

html[data-theme="light"] .dim-finding,
body.light-theme .dim-finding {
  color: #334155 !important;
}

html[data-theme="light"] .dim-finding strong,
body.light-theme .dim-finding strong {
  color: #0f172a !important;
}

html[data-theme="light"] .dim-conclusion,
body.light-theme .dim-conclusion {
  background: #f8fafc !important;
  border-left: 3px solid #cbd5e1 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .dim-label,
body.light-theme .dim-label {
  color: #0f172a !important;
}

html[data-theme="light"] .dim-action,
body.light-theme .dim-action {
  background: #f0f9ff !important;
  border: 1px dashed #7dd3fc !important;
  color: #0c4a6e !important;
}

html[data-theme="light"] .action-label,
body.light-theme .action-label {
  color: #0284c7 !important;
}

html[data-theme="light"] .safety-strategy-box,
body.light-theme .safety-strategy-box {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .strategy-header h4,
body.light-theme .strategy-header h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .strategy-item,
body.light-theme .strategy-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .strategy-content b,
body.light-theme .strategy-content b {
  color: #0f172a !important;
}

html[data-theme="light"] .strategy-content p,
body.light-theme .strategy-content p {
  color: #475569 !important;
}

/* Light Mode Overrides for Safety Daily Talk */
html[data-theme="light"] .safety-talk-bubble.safe-theme,
body.light-theme .safety-talk-bubble.safe-theme {
  background: linear-gradient(135deg, #f0fdf4, #ffffff) !important;
  border: 1px solid #bbf7d0 !important;
  border-left: 5px solid #16a34a !important;
  box-shadow: 0 4px 18px rgba(22, 163, 74, 0.08) !important;
}

html[data-theme="light"] .safety-talk-bubble.alert-theme,
body.light-theme .safety-talk-bubble.alert-theme {
  background: linear-gradient(135deg, #fffbeb, #ffffff) !important;
  border: 1px solid #fde68a !important;
  border-left: 5px solid #d97706 !important;
  box-shadow: 0 4px 18px rgba(217, 119, 6, 0.08) !important;
}

html[data-theme="light"] .advisor-name,
body.light-theme .advisor-name {
  color: #0f172a !important;
}

html[data-theme="light"] .briefing-cycle-pill,
body.light-theme .briefing-cycle-pill {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .briefing-cycle-pill b,
body.light-theme .briefing-cycle-pill b {
  color: #0284c7 !important;
}

html[data-theme="light"] .dialog-speech,
body.light-theme .dialog-speech {
  background: #f8fafc !important;
  color: #1e293b !important;
  border-left: 3px solid #0284c7 !important;
}

html[data-theme="light"] .highlight-safe,
body.light-theme .highlight-safe {
  color: #15803d !important;
}

html[data-theme="light"] .highlight-alert,
body.light-theme .highlight-alert {
  color: #b45309 !important;
}

html[data-theme="light"] .status-mini-card,
body.light-theme .status-mini-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .status-mini-card .mini-label,
body.light-theme .status-mini-card .mini-label {
  color: #64748b !important;
}

html[data-theme="light"] .status-mini-card.green .mini-val,
body.light-theme .status-mini-card.green .mini-val {
  color: #15803d !important;
}

html[data-theme="light"] .status-mini-card.blue .mini-val,
body.light-theme .status-mini-card.blue .mini-val {
  color: #0369a1 !important;
}

html[data-theme="light"] .status-mini-card.cyan .mini-val,
body.light-theme .status-mini-card.cyan .mini-val {
  color: #0f766e !important;
}

html[data-theme="light"] .status-mini-card.red .mini-val,
body.light-theme .status-mini-card.red .mini-val {
  color: #b91c1c !important;
}

html[data-theme="light"] .status-mini-card.yellow .mini-val,
body.light-theme .status-mini-card.yellow .mini-val {
  color: #b45309 !important;
}




