@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-light: #64748b;
  --card-bg: rgba(255, 255, 255, 0.7);
  --border-color: rgba(0, 0, 0, 0.08);
  --input-bg: rgba(255, 255, 255, 0.8);
  --input-border: rgba(148, 163, 184, 0.4);
  --nav-bg: rgba(255, 255, 255, 0.6);
  --th-bg: rgba(226, 232, 240, 0.8);
  --hover-bg: rgba(0, 0, 0, 0.05);
  --card-shadow: rgba(0, 0, 0, 0.08);
  --card-shadow-hover: rgba(0, 0, 0, 0.15);
  --param-card-bg: rgba(255, 255, 255, 0.5);
  --select-bg-svg: "data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E";
  --tensor-banner-from: #c2410c;
  --tensor-banner-to: #f59e0b;
  --tensor-banner-shadow: rgba(180, 83, 9, 0.32);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --text-light: #94a3b8;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --input-border: rgba(148, 163, 184, 0.2);
    --nav-bg: rgba(15,23,42,0.5);
    --th-bg: rgba(15, 23, 42, 0.8);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --card-shadow: rgba(0, 0, 0, 0.3);
    --card-shadow-hover: rgba(0, 0, 0, 0.4);
    --param-card-bg: rgba(15, 23, 42, 0.4);
    --select-bg-svg: "data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E";
    --tensor-banner-from: #9a3412;
    --tensor-banner-to: #d97706;
    --tensor-banner-shadow: rgba(120, 53, 15, 0.42);
  }

  .link-btn.link-btn--active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(129, 140, 248, 0.16));
    border-color: rgba(56, 189, 248, 0.55);
    color: #f8fafc;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
  }

  .nav-machine .link-btn.link-btn--active:hover {
    color: #f8fafc;
    border-color: rgba(56, 189, 248, 0.65);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(129, 140, 248, 0.2));
  }

  .nav-credentials-inner .link-btn.link-btn--active:hover {
    color: #f8fafc;
  }
}

/* RESET */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* BODY */
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 30px 20px;
}

/* CONTAINER (standalone pages use centered layout; app pages nest inside .app-body) */
.container {
  max-width: 900px;
  margin: auto;
  animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* App shell: top credentials row + grid (sidebar | main) */
.app-layout {
  --app-sidebar-col: 220px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-credentials {
  width: 100%;
  flex-shrink: 0;
}

.nav-credentials-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, var(--tensor-banner-from), var(--tensor-banner-to));
  padding: 14px 22px;
  border-radius: 18px;
  border: none;
  box-shadow: 0 12px 28px var(--tensor-banner-shadow);
}

.app-session-summary {
  flex: 0 0 100%;
  min-width: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 2px;
  order: 2;
  white-space: nowrap;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

/* Top bar: plain session text plus Members / Logout controls */
.nav-credentials-inner > .link-btn,
.nav-credentials-inner > span.link-btn,
.nav-credentials-inner > button.link-btn {
  order: 1;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 0;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(15, 23, 42, 0.22);
  border-color: rgba(255, 255, 255, 0.42);
}

.nav-credentials-inner > .link-btn:hover {
  color: #fff;
  background: rgba(15, 23, 42, 0.38);
  border-color: rgba(255, 255, 255, 0.55);
  transform: none;
}

.nav-credentials-inner a.crm-prefs-shortcut {
  order: 1;
  align-items: center;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  height: 2.35rem;
  justify-content: center;
  padding: 0;
  text-decoration: none;
  width: 2.35rem;
}

.nav-credentials-inner a.crm-prefs-shortcut:hover {
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
}

.nav-credentials-inner > button.tensor-banner-logout {
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
}

/* Two columns: fixed-width sidebar (vertical buttons) | fluid main (content) */
.app-body {
  display: grid;
  grid-template-columns: var(--app-sidebar-col) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.app-sidebar {
  min-width: 0;
  width: 100%;
  position: sticky;
  top: 16px;
  align-self: start;
}

/* Machine links: one column, full width of sidebar container */
.nav-machine {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin: 0;
  background: var(--nav-bg);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.nav-machine .link-btn {
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.mobile-nav-toggle {
  display: none;
}

.mobile-nav-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-nav-toggle-icon span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-section {
  margin: 4px 0 12px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.nav-section--collapsible {
  margin: 0;
  padding: 8px 0;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin: 0 0 8px 4px;
}

.nav-section-toggle {
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-light);
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-section-toggle:hover {
  background: var(--hover-bg);
  color: var(--text-muted);
  transform: none;
  box-shadow: none;
}

.nav-section-caret {
  transition: transform 0.2s ease;
}

.nav-section--collapsed .nav-section-caret {
  transform: rotate(-90deg);
}

.nav-section-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-section--collapsed .nav-section-panel {
  display: none;
}

.nav-section .link-btn {
  margin-top: 0;
}

.nav-section--input-actions {
  margin-top: 8px;
}

.link-btn--subnav {
  font-size: 0.84rem;
  padding: 7px 10px;
}

.machine-dashboard-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.machine-dashboard-part-card h3,
.machine-dashboard-part-card h4 {
  margin-bottom: 0.35em;
}

.plant-dashboard-machine-block {
  margin-bottom: 18px;
}

.app-main {
  min-width: 0;
  width: 100%;
}

.app-main .container {
  margin: 0;
  max-width: 900px;
  width: 100%;
  animation: fadeIn 0.8s ease-in-out;
}

@media (max-width: 720px) {
  .app-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .app-sidebar {
    position: static;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 0;
    margin-bottom: 8px;
    box-shadow: none;
  }

  .app-sidebar .nav-machine {
    display: none;
  }

  .app-sidebar.app-sidebar--nav-open .nav-machine {
    display: flex;
  }

  .nav-credentials-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 10px;
    overflow-x: visible;
  }

  .app-session-summary {
    flex: 1 1 auto;
    width: 100%;
    order: 0;
    text-align: left;
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    margin-top: 0;
  }

  .nav-credentials-inner > .link-btn,
  .nav-credentials-inner > span.link-btn,
  .nav-credentials-inner > button.link-btn,
  .nav-credentials-inner a.crm-prefs-shortcut,
  .nav-credentials-inner > a.tensor-erp-launcher {
    order: 1;
    align-self: flex-start;
  }
}

/* HEADINGS */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 15px;
  background: -webkit-linear-gradient(45deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-muted);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-muted);
}

p {
  margin-bottom: 10px;
  color: var(--text-light);
  line-height: 1.5;
}

/* CARD STYLE */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 25px;
  margin-top: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 32px var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--card-shadow-hover);
}

/* FORM */
form {
  display: flex;
  flex-direction: column;
}

label {
  margin-top: 15px;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input, textarea, select {
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Select specifically */
select {
  appearance: none;
  background-image: url(var(--select-bg-svg));
  background-repeat: no-repeat;
  background-position: right 1rem top 50%;
  background-size: 0.65rem auto;
  padding-right: 2.5rem;
}

/* BUTTON */
button {
  margin-top: 25px;
  padding: 14px;
  background: linear-gradient(45deg, #38bdf8, #818cf8);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

button:active {
  transform: translateY(0);
}

/* LINKS */
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.link-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  transform: translateY(-2px);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Current page in app nav */
.link-btn.link-btn--active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.32), rgba(129, 140, 248, 0.24));
  border-color: rgba(56, 189, 248, 0.7);
  color: var(--text-main);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
  font-weight: 700;
}

.nav-machine .link-btn.link-btn--active {
  transform: none;
}

.nav-machine .link-btn.link-btn--active:hover {
  transform: none;
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.75);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.38), rgba(129, 140, 248, 0.3));
}

.nav-credentials-inner .link-btn.link-btn--active {
  background: rgba(15, 23, 42, 0.42);
  border-color: rgba(255, 255, 255, 0.58);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.nav-credentials-inner .link-btn.link-btn--active:hover {
  transform: none;
  color: #fff;
  background: rgba(15, 23, 42, 0.52);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-icon {
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

/* TABLE */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  margin-top: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

th {
  background: var(--th-bg);
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: var(--hover-bg);
}

/* DASHBOARD: one chart card per numeric parameter */
.dashboard-charts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-charts .card {
  margin-top: 0;
}

/* CANVAS */
canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 400px;
  margin-top: 10px;
}

/* PARAM CARD */
.param-card {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 15px;
  background: var(--param-card-bg);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

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

/* Remove Button overrides */
.remove-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  box-shadow: none !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
  margin-top: 0 !important;
}

@media (prefers-color-scheme: dark) {
  .remove-btn {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
  }
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.8) !important;
  color: white !important;
}

/* Enterprise-only sensor picker (placeholder) */
.enterprise-btn {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #d97706 !important;
  box-shadow: none !important;
  border: 1px solid rgba(245, 158, 11, 0.2) !important;
  margin-top: 0 !important;
}

@media (prefers-color-scheme: dark) {
  .enterprise-btn {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
  }
}

.enterprise-btn:hover {
  background: rgba(245, 158, 11, 0.8) !important;
  color: white !important;
}

.param-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.maint-subheading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 6px;
}

.maint-category {
  margin: 10px 0 6px;
}

.maint-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.maint-category-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  margin: 0;
}

.maint-category-body {
  margin-top: 6px;
  padding-left: 24px;
  border-left: 2px solid var(--border-color);
}

.maint-category-body[hidden] {
  display: none;
}

.optional-ts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 8px 0 14px;
}

.optional-ts-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.optional-ts-hint {
  font-weight: normal;
  color: var(--text-light);
  opacity: 0.85;
}

.optional-ts-input {
  margin: 0;
  padding: 4px 8px;
  width: auto;
  max-width: 220px;
  font-size: 0.85rem;
}

#dataTable th.col-actions,
#dataTable td.cell-actions {
  white-space: nowrap;
  width: 1%;
  text-align: right;
}

.row-action {
  margin: 0 0 0 4px;
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}

.row-action:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.5);
}

.row-action.row-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.row-action.row-save {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.row-action.row-save:hover {
  background: #059669;
  border-color: #059669;
}

.row-action[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

#dataTable tr.row-editing {
  background: rgba(59, 130, 246, 0.06);
}

#dataTable .edit-input {
  width: 100%;
  min-width: 80px;
  padding: 4px 6px;
  margin: 0;
  font-size: 0.88rem;
  box-sizing: border-box;
}

#dataTable .edit-input-time {
  min-width: 180px;
}

.inv-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}

.inv-status-badge--ok {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.inv-status-badge--low {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.inv-status-badge--out {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

tr.inv-status-low {
  background: rgba(245, 158, 11, 0.06);
}

tr.inv-status-out {
  background: rgba(239, 68, 68, 0.08);
}

.restock-dialog {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 20px 22px;
  max-width: 420px;
  width: calc(100% - 32px);
  background: var(--card-bg, #0f172a);
  color: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.restock-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.restock-dialog label {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
}

.restock-dialog input[type="number"],
.restock-dialog input[type="text"],
.restock-dialog input[type="datetime-local"] {
  width: 100%;
  margin-top: 4px;
}

.overview-restock-section {
  margin: 24px 0 8px;
}

.overview-restock-section[hidden] {
  display: none;
}

.overview-restock-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.overview-restock-cta {
  align-self: flex-end;
}

.overview-restock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.overview-restock-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg, rgba(20, 26, 40, 0.6));
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.overview-restock-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.55);
}

.overview-restock-card--low {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.06);
}

.overview-restock-card--out {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.overview-restock-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.overview-restock-sku {
  font-size: 0.78rem;
  color: var(--text-light);
}

.overview-restock-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.25;
}

.overview-restock-qty {
  font-size: 0.92rem;
  color: var(--text);
}

.overview-restock-qty strong {
  font-size: 1.08rem;
}

.overview-restock-rp {
  color: var(--text-light);
  margin-left: 4px;
}

.overview-restock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.danger-btn {
  margin-left: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: transparent;
  color: #fecaca;
  cursor: pointer;
  line-height: 1;
}

.danger-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.75);
  color: #fff;
}

.danger-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.row-actions-cell {
  white-space: nowrap;
}

.maint-interval-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 0 0 4px 2px;
}

.maint-interval-input {
  width: 100%;
  max-width: 200px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text);
  box-sizing: border-box;
}

.spare-consume-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.spare-consume-row {
  flex-wrap: wrap;
  align-items: center;
}

.spare-consume-row .spare-inv-select {
  flex: 1;
  min-width: 200px;
}

.maint-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.maint-history-row {
  flex-wrap: wrap;
  align-items: center;
}

.manual-maint-details {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.25);
}

.manual-maint-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}

.manual-maint-hint {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 10px 0 6px;
  line-height: 1.45;
}

.work-request-item {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--param-card-bg);
}

.work-request-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.work-request-item p {
  margin: 6px 0 0;
  font-size: 0.9rem;
}

.work-request-status {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.work-request-status--pending {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
}

.work-request-status--accepted {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
}

.work-request-status--doneSubmitted {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.45);
}

.work-request-status--done {
  color: #c4b5fd;
  background: rgba(129, 140, 248, 0.14);
  border-color: rgba(129, 140, 248, 0.45);
}

.work-request-status--declined {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
}

.work-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.work-request-actions .link-btn,
.work-request-actions .remove-btn {
  margin-top: 0 !important;
}

.work-request-decision-note {
  width: 100%;
  margin-top: 4px;
}

.work-request-technical-feedback {
  width: 100%;
  min-height: 90px;
  margin-top: 4px;
}

.work-request-inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
}

.work-request-suggestions {
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--param-card-bg);
}

.work-request-suggestions[hidden] {
  display: none;
}

.maintenance-spare-consumption {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.maintenance-spare-consumption[hidden] {
  display: none;
}

.maintenance-spare-consumption h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.work-request-suggestion {
  display: block !important;
  width: 100%;
  margin: 6px 0 0 !important;
  text-align: left;
}

@media (max-width: 640px) {
  .work-request-inline-fields {
    grid-template-columns: 1fr;
  }
}

.overview-work-section {
  margin-bottom: 24px;
}

.overview-work-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.overview-work-stat {
  display: block;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--param-card-bg);
  text-decoration: none;
  color: var(--text);
}

.overview-work-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
}

.overview-work-label {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.overview-work-stat--pending {
  border-color: rgba(245, 158, 11, 0.35);
}

.overview-work-stat--accepted {
  border-color: rgba(16, 185, 129, 0.35);
}

.overview-work-stat--done-submitted {
  border-color: rgba(59, 130, 246, 0.35);
}

.overview-work-stat--done {
  border-color: rgba(129, 140, 248, 0.35);
}

.overview-work-list {
  display: grid;
  gap: 10px;
}

.overview-work-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--param-card-bg);
  color: var(--text);
  text-decoration: none;
}

.overview-work-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.overview-work-item p,
.overview-work-empty {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

@media (max-width: 720px) {
  .overview-work-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.maint-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.maint-dash-block h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 8px;
}

.maint-dash-latest {
  font-size: 0.88rem;
  color: var(--text-light);
  margin: 0 0 8px;
}

.maint-dash-latest.maint-dash-none {
  opacity: 0.85;
}

.maint-dash-due {
  font-size: 0.9rem;
  margin: 0 0 8px;
  line-height: 1.45;
  color: var(--text-light);
}

.maint-dash-due--na {
  opacity: 0.92;
}

.maint-dash-due--soon {
  color: #fbbf24;
}

.maint-dash-due--overdue {
  color: #f87171;
  font-weight: 600;
}

.maint-dash-interval-hint {
  font-size: 0.78rem;
  color: var(--text-light);
  margin: -4px 0 10px;
  opacity: 0.9;
}

.maint-dash-table-wrap {
  margin-top: 4px;
}

.maint-dash-table {
  font-size: 0.82rem;
}

.maint-dash-table th,
.maint-dash-table td {
  padding: 6px 8px;
}

.part-template-panel {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
}

.part-template-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}

.part-template-panel-hint {
  margin: 8px 0 12px;
  font-size: 0.88rem;
  color: var(--text-light);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.part-template-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: var(--surface, rgba(255, 255, 255, 0.06));
  color: var(--text);
  font-size: 0.95rem;
}

.part-template-search::placeholder {
  color: var(--text-light);
}

.part-template-search:focus {
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 1px;
}

.part-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

button.part-template-chip {
  font-size: 0.85rem;
  padding: 6px 10px;
  white-space: nowrap;
}

/* OVERVIEW — hero, charts, fleet */
.page-overview .container--overview {
  max-width: 1120px;
}

.overview-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px 26px;
  margin-bottom: 24px;
  border: none;
  background: linear-gradient(135deg, var(--tensor-banner-from), var(--tensor-banner-to));
  box-shadow: 0 12px 28px var(--tensor-banner-shadow);
}

.overview-hero-glow {
  position: absolute;
  inset: -35% -15% auto -15%;
  height: 110%;
  background: radial-gradient(ellipse 55% 45% at 82% 8%, rgba(255, 255, 255, 0.2), transparent 68%);
  pointer-events: none;
}

.overview-eyebrow {
  position: relative;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 8px;
}

.overview-title {
  position: relative;
  font-size: clamp(1.85rem, 4vw, 2.35rem);
  font-weight: 800;
  margin-bottom: 10px;
  color: #ffffff;
}

.overview-lead {
  position: relative;
  max-width: 38rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 20px;
}

.overview-stat-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

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

.overview-stat {
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(8px);
}

.overview-stat--accent {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(120, 53, 15, 0.25);
}

@media (prefers-color-scheme: light) {
  .overview-stat {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(148, 163, 184, 0.35);
  }
  .overview-stat--accent {
    background: rgba(254, 243, 199, 0.65);
    border-color: rgba(245, 158, 11, 0.35);
  }
}

.overview-stat-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f8fafc;
  line-height: 1.1;
}

@media (prefers-color-scheme: light) {
  .overview-stat-value { color: var(--text-main); }
}

.overview-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.overview-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.overview-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.overview-btn:hover {
  transform: translateY(-1px);
}

.overview-btn--primary {
  background: linear-gradient(45deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.overview-btn--muted {
  background: linear-gradient(45deg, #475569, #334155);
  color: #f1f5f9;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.overview-pdf-hint {
  position: relative;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.95);
  max-width: 40rem;
  line-height: 1.45;
}

.overview-viz-section {
  margin-bottom: 28px;
}

.overview-viz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .overview-viz-grid {
    grid-template-columns: 1fr;
  }
}

.overview-fleet-card {
  grid-row: span 2;
  border-top: 4px solid #818cf8;
}

@media (max-width: 900px) {
  .overview-fleet-card {
    grid-row: auto;
  }
}

.overview-chart-card {
  border-top: 4px solid #38bdf8;
}

.overview-chart-card--radar {
  grid-column: 1 / -1;
  border-top-color: #f472b6;
}

.overview-viz-heading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-muted);
}

.overview-viz-sub {
  font-size: 0.82rem;
  color: var(--text-light);
  margin: 0 0 12px;
  line-height: 1.4;
}

.overview-fleet-flow {
  width: 100%;
  min-height: 140px;
}

.overview-fleet-flow svg {
  width: 100%;
  height: auto;
  display: block;
}

.overview-chart-wrap {
  position: relative;
  height: 240px;
}

.overview-chart-wrap--tall {
  height: 280px;
}

.overview-chart-card--radar .overview-chart-wrap {
  height: 300px;
  max-width: 520px;
  margin: 0 auto;
}

.overview-attention-strip {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.overview-attention-strip[hidden] {
  display: none !important;
}

.overview-attention-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fecaca;
  margin-right: 6px;
}

.overview-attention-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(252, 165, 165, 0.4);
  color: #fef2f2;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.overview-attention-chip:hover {
  background: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.overview-parts-section {
  margin-top: 8px;
}

.overview-parts-head {
  margin-bottom: 16px;
}

.overview-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.overview-section-lead {
  font-size: 0.92rem;
  color: var(--text-light);
}

.overview-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.overview-card {
  border-top: 4px solid #38bdf8;
  border-left: none;
  display: flex;
  flex-direction: column;
}

.overview-card .link-btn {
  margin-top: auto;
}

/* ===== Notification bell & panel ===== */
.notif-wrap {
  position: relative;
  display: inline-flex;
  margin-right: auto;
}

.notif-bell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

.notif-bell-icon {
  opacity: 0.85;
}

.notif-bell--active .notif-bell-icon {
  animation: notif-bell-wiggle 1.2s ease 1;
}

.notif-bell--critical {
  border-color: rgba(239, 68, 68, 0.55) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  color: #fecaca !important;
}

@keyframes notif-bell-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(4deg); }
}

.notif-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notif-badge[hidden] {
  display: none;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 70vh;
  overflow: auto;
  background: var(--card-bg, #0f172a);
  color: inherit;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

.notif-panel[hidden] {
  display: none;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  background: inherit;
}

.notif-mark-all {
  font-size: 0.8rem !important;
  padding: 4px 10px !important;
}

.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  align-items: flex-start;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item--critical {
  background: rgba(239, 68, 68, 0.06);
}

.notif-item--warning {
  background: rgba(249, 115, 22, 0.06);
}

.notif-item-main {
  flex: 1;
  min-width: 0;
}

.notif-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.notif-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.notif-pill--critical {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

.notif-pill--warning {
  background: rgba(249, 115, 22, 0.15);
  color: #fed7aa;
  border-color: rgba(249, 115, 22, 0.5);
}

.notif-cat {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notif-item-detail {
  font-size: 0.85rem;
  line-height: 1.35;
  word-break: break-word;
}

.notif-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

.notif-action {
  font-size: 0.78rem !important;
  padding: 4px 10px !important;
  white-space: nowrap;
}

.health-work-request-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
}

.health-work-request-cta--existing {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.health-work-request-message {
  color: var(--text-light);
  font-size: 0.85rem;
}

.health-work-request-link {
  margin-top: 0 !important;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 600px) {
  body { padding: 15px 10px; }
  h1 { font-size: 2rem; }
  .card { padding: 15px; }
  .param-card { flex-direction: column; align-items: stretch; }
  .param-card button { margin-top: 15px !important; }

  .notif-panel {
    width: calc(100vw - 20px);
    left: -8px;
  }
}

/* Sensor status badges — used on sensors.html and inside the sensor picker. */
.sensor-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sensor-status-badge--live {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.sensor-status-badge--recent {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.sensor-status-badge--stale {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}

.sensor-status-badge--offline {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
}

/* Sensor picker: rows look like link-buttons but full-width with two-column layout. */
.sensor-pick-btn {
  padding: 8px 12px;
}

.sensor-pick-btn:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* ----- Definition images (plants / machines / parts) ------------------------
   Uploaded to S3 via a pre-signed PUT URL, served through CloudFront. The
   `.definition-image-field` block appears inside create/edit forms; the
   `.definition-image-*-thumb` / `.dashboard-hero-image` classes render the
   saved image on dashboards and tables.
*/
.definition-image-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 12px;
  border: 1px dashed var(--input-border);
  border-radius: 10px;
  background: var(--param-card-bg);
}

.definition-image-field > label {
  margin: 0;
  font-weight: 600;
}

.definition-image-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.definition-image-preview {
  display: block;
  max-width: 260px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.05);
  object-fit: cover;
}

.definition-image-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.definition-image-input {
  max-width: 360px;
}

.definition-image-remove {
  margin: 0 !important;
}

.definition-image-status {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
  min-height: 1em;
}

.definition-image-status[data-kind="error"] { color: #ef4444; }
.definition-image-status[data-kind="ok"] { color: #10b981; }

.definition-image-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.definition-image-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1px dashed var(--input-border);
  color: var(--text-light);
  font-size: 0.85rem;
}

.definition-image-card-thumb {
  display: block;
  width: 100%;
  max-width: 240px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin: 6px 0 10px;
}

.dashboard-hero-image {
  margin: 14px 0;
}

.dashboard-hero-image img {
  display: block;
  width: 100%;
  max-width: 640px;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.col-image {
  width: 72px;
}

.nav-credentials-inner > a.tensor-erp-launcher {
  position: static;
  order: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 10px;
}

.nav-credentials-inner > a.tensor-erp-launcher:hover {
  background: rgba(255, 255, 255, 0.28);
}

