:root {
  --sidebar-width: 260px;
  --header-height: 72px;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #3b82f6;
  --body-bg: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--body-bg);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar.open,
.sidebar.sidebar-visible {
  transform: translateX(0);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1035;
}

.sidebar-overlay.show {
  display: block;
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-sidebar-pin {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.btn-sidebar-pin:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-sidebar-pin.pinned {
  color: #60a5fa;
}

@media (max-width: 991.98px) {
  .btn-sidebar-pin {
    display: none;
  }
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-name {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.sidebar-logo {
  max-width: 100%;
  height: 40px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.sidebar-brand .brand-sub {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.sidebar-nav {
  padding: 0.75rem 0;
  flex: 1;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.5rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav .nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
  border-left-color: var(--sidebar-active);
  font-weight: 600;
}

.sidebar-nav .nav-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.8;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.4;
  margin-top: auto;
}

/* ── Top header ── */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* Tehdasvärit – yläpalkki erottuu heti */
.top-header.tehdas-3093 {
  background: #dbeafe;
  border-bottom-color: #93c5fd;
}

.top-header.tehdas-3096 {
  background: #dcfce7;
  border-bottom-color: #86efac;
}

.header-env {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.8rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.header-env::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.header-env.env-testi {
  color: #7c2d12;
  background: #fef3c7;
  border-color: #f59e0b;
}

.header-env.env-kehitys {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #3b82f6;
}

.header-env.env-tuotanto {
  color: #14532d;
  background: #dcfce7;
  border-color: #22c55e;
}

.header-tehdas {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.top-header.tehdas-3093 .header-tehdas {
  color: #1e3a8a;
}

.top-header.tehdas-3096 .header-tehdas {
  color: #14532d;
}

.header-tehdas i {
  font-size: 1rem;
  opacity: 0.9;
}

.btn-hamburger {
  background: none;
  border: none;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  color: #475569;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-hamburger:hover {
  background: #f1f5f9;
}

.header-logo {
  display: flex;
  flex-direction: column;
}

.header-brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-merp-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.header-lt-logo {
  height: 36px;
  object-fit: contain;
}

.header-brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1e293b;
  line-height: 1.1;
}

.header-brand-sub {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.2;
}

.header-spacer {
  flex: 1;
}

.header-date {
  color: #64748b;
  font-size: 0.85rem;
  display: none;
}

@media (min-width: 768px) {
  .header-date {
    display: block;
  }
}

/* ── User menu ── */
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 2rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.user-menu-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  text-align: left;
  line-height: 1.2;
}

.user-info-text .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.user-info-text .user-role {
  font-size: 0.72rem;
  color: #94a3b8;
}

.dropdown-menu .dropdown-item.active {
  background-color: #eff6ff;
  color: #1e40af;
}

.dropdown-menu {
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  min-width: 200px;
}

.dropdown-item {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.dropdown-item i {
  width: 1.25rem;
  margin-right: 0.5rem;
  color: #94a3b8;
}

.dropdown-item.text-danger i {
  color: #ef4444;
}

/* ── Main content ── */
.main-wrapper {
  transition: margin-left 0.3s ease;
}

.main-content {
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-height));
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1.25rem;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.content-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: visible;
}

.list-tabs {
  border-bottom: none;
  gap: 0.25rem;
}

.list-tabs .nav-link {
  color: #64748b;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.5rem 0.5rem 0 0;
}

.list-tabs .nav-link:hover {
  color: #334155;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.list-tabs .nav-link.active {
  color: #1e40af;
  background: #fff;
  border-color: #e2e8f0;
  border-bottom-color: #fff;
  margin-bottom: -1px;
}

.list-tabs .badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  margin-left: 0.25rem;
}

.list-tabs .nav-link.active .badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.ve-ryhma-tabs {
  gap: 0.4rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.ve-ryhma-tabs .nav-link {
  color: #475569;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}

.ve-ryhma-tabs .nav-link:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.ve-ryhma-tabs .nav-link.active {
  color: #fff;
  background: #334155;
}

.ve-ryhma-tabs .badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
  margin-left: 0.25rem;
}

.ve-ryhma-tabs .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.content-card-tabs {
  border-top-left-radius: 0;
}

.content-card > .table-responsive {
  border-radius: 0 0 0.625rem 0.625rem;
  overflow-x: auto;
}

/* Lookup-pickerin valikko ei leikkaudu taulukon scroll-wrapperiin */
.table-responsive.table-overflow-visible {
  overflow: visible;
}

.content-card > .table-hscroll-wrap {
  border-radius: 0 0 0.625rem 0.625rem;
  overflow: hidden;
}

.content-card > .table-hscroll-wrap .table-hscroll-main {
  overflow-x: auto;
  border-radius: 0;
}

.table-hscroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.table-hscroll-top-inner {
  height: 1px;
}

.table-hscroll-top::-webkit-scrollbar,
.table-hscroll-main::-webkit-scrollbar {
  height: 10px;
}

.table-hscroll-top::-webkit-scrollbar-thumb,
.table-hscroll-main::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.table-hscroll-top::-webkit-scrollbar-thumb:hover,
.table-hscroll-main::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.table-hscroll-top::-webkit-scrollbar-track,
.table-hscroll-main::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.content-card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.content-card-toolbar .dropdown-menu {
  max-height: min(70vh, 480px);
  overflow-y: auto;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 640px;
}

.search-box .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
}

.search-box .form-control {
  padding-left: 2.25rem;
  border-color: #e2e8f0;
}

.data-table {
  font-size: 0.875rem;
}

.data-table thead th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
  vertical-align: top;
}

.data-table thead th:not(:last-child),
.data-table tbody td:not(:last-child) {
  border-right: 1px solid #e8ecf0;
}

.data-table thead th .sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}

.data-table thead th .sort-link:hover {
  color: #3b82f6;
}

.data-table thead th .sort-link i {
  font-size: 0.7rem;
  color: #3b82f6;
}

.data-table mark {
  background: #fde047;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 0.15rem;
}

.data-table tbody td {
  padding: 0.45rem 0.65rem;
  vertical-align: top;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.data-table td.cell-sisalto {
  padding: 0.2rem 0.35rem;
  margin: 0;
  min-width: 14rem;
}

.data-table .sisalto-table,
.data-table .sisalto-table tbody,
.data-table .sisalto-table tr,
.data-table .sisalto-table td {
  border: none !important;
  box-shadow: none;
  background: transparent;
}

.sisalto-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  font-size: 0.875rem;
  border: none;
}

.sisalto-table td {
  padding: 0.1rem 0;
  margin: 0;
  vertical-align: top;
  border: none !important;
  color: inherit;
}

.sisalto-table .sisalto-nimike {
  padding: 0.1rem 0.4rem 0.1rem 0;
  margin: 0;
}

.sisalto-table .sisalto-meta {
  white-space: nowrap;
  color: #64748b;
  padding: 0.1rem 0;
  margin: 0;
}

.sisalto-table tr + tr td {
  padding-top: 0.1rem;
  border: none !important;
}

.list-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(241, 245, 249, 0.92);
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.list-loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.list-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.list-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #cbd5e1;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: list-loading-spin 0.7s linear infinite;
}

.list-loading-text {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

@keyframes list-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.data-table .cell-editable .cell-input {
  min-width: 8rem;
  max-width: 100%;
}

.data-table .cell-display.text-success {
  color: #198754 !important;
  font-weight: 500;
}

.data-table tr.row-editing .row-actions .btn {
  vertical-align: middle;
}

.table-global-editing .cell-editable .cell-display {
  display: none !important;
}

.table-global-editing .cell-editable .cell-input {
  display: block !important;
}

.table-global-editing .row-actions {
  visibility: hidden;
}

.content-card.table-edit-mode .content-card-toolbar {
  background: #fffbeb;
  border-bottom-color: #fde68a;
}

.data-table .cell-input.text-success {
  color: #198754 !important;
  border-color: #198754;
  font-weight: 500;
}

.data-table .col-row-num,
.data-table .row-num {
  width: 3rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-link {
  color: #1e293b;
  font-weight: 500;
  text-decoration: none;
}

.table-link:hover {
  color: #3b82f6;
}

.detail-dl dt {
  color: #64748b;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
}

.detail-dl dd {
  margin-bottom: 0.65rem;
  color: #334155;
}

.detail-dl dd:last-child {
  margin-bottom: 0;
}

.nimike-page-toolbar {
  margin-bottom: 0.65rem;
}

.nimike-links-card {
  margin-top: 0.65rem;
}

.nimike-header-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.paper-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #cbd5e1;
}

.paper-form-cell {
  padding: 0.45rem 0.7rem 0.5rem;
  background: #fff;
}

.paper-form-cell:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.paper-form-label {
  margin-bottom: 0.15rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.paper-form-value {
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.paper-form-span {
  grid-column: 1 / -1;
}

.paper-form-value-pre {
  white-space: pre-line;
  font-weight: 500;
}

.paper-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.paper-form-head .paper-form-label {
  margin-bottom: 0.15rem;
}

.paper-form-head .badge {
  flex: 0 0 auto;
  margin-top: -0.15rem;
}

@media (max-width: 767.98px) {
  .paper-form {
    grid-template-columns: 1fr;
  }

  .paper-form-cell:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (min-width: 1200px) {
  .paper-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .paper-form-cell:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .paper-form::after {
    content: "";
    background: #fff;
  }
}

.era-info-field {
  min-height: 4.5rem;
  height: 100%;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}

.era-info-label {
  margin-bottom: 0.25rem;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.era-info-value {
  color: #0f172a;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
}

.era-info-value-multiline {
  white-space: pre-line;
}

.nimike-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.nimike-link-grid-stack {
  flex-direction: column;
  align-items: flex-start;
}

.nimike-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.nimike-link-grid-stack .nimike-link-card {
  width: 16rem;
  max-width: 100%;
}

.nimike-origin-flow-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.nimike-origin-flow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: max-content;
  margin-inline: auto;
}

.nimike-origin-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nimike-origin-col-sources {
  align-items: flex-end;
}

.nimike-origin-col-targets {
  align-items: flex-start;
}

.nimike-origin-col .nimike-link-card {
  width: 16rem;
  max-width: 100%;
}

.nimike-origin-arrow {
  position: relative;
  width: 4.5rem;
  height: 2px;
  flex: 0 0 4.5rem;
  background: #2563eb;
}

.nimike-origin-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #2563eb;
}

.nimike-origin-current {
  display: flex;
  justify-content: center;
}

.nimike-link-card-current {
  width: 16rem;
  max-width: 100%;
  border-width: 3px;
  text-align: center;
  align-items: center;
}

@media (max-width: 991.98px) {
  .nimike-origin-flow {
    flex-direction: column;
    width: 100%;
  }

  .nimike-origin-col-sources,
  .nimike-origin-col-targets,
  .nimike-origin-current {
    align-items: center;
    justify-content: center;
  }

  .nimike-origin-arrow {
    width: 2px;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    background: #2563eb;
  }

  .nimike-origin-arrow::after {
    top: auto;
    right: 50%;
    bottom: 0;
    transform: translateX(50%);
    border-top: 11px solid #2563eb;
    border-right: 7px solid transparent;
    border-bottom: 0;
    border-left: 7px solid transparent;
  }
}

.nimike-link-card:hover {
  color: inherit;
}

.nimike-link-card-materiaali,
.nimike-link-card-current.nimike-link-card-materiaali,
.nimike-type-badge-materiaali {
  background: #fee2e2;
  border-color: #dc2626;
}

.nimike-type-badge-materiaali,
.nimike-type-badge-valmis,
.nimike-type-badge-uusiointi,
.nimike-type-badge-uusiointivalmis {
  color: #0f172a;
  border-style: solid;
  border-width: 1px;
}

.nimike-link-card-materiaali:hover {
  background: #fecaca;
  border-color: #b91c1c;
}

.nimike-link-card-valmis,
.nimike-link-card-current.nimike-link-card-valmis,
.nimike-type-badge-valmis {
  background: #dcfce7;
  border-color: #16a34a;
}

.nimike-link-card-valmis:hover {
  background: #bbf7d0;
  border-color: #15803d;
}

.nimike-link-card-uusiointi,
.nimike-link-card-current.nimike-link-card-uusiointi,
.nimike-type-badge-uusiointi {
  background: #fef9c3;
  border-color: #eab308;
}

.nimike-link-card-uusiointi:hover {
  background: #fef08a;
  border-color: #ca8a04;
}

.nimike-link-card-uusiointivalmis,
.nimike-link-card-current.nimike-link-card-uusiointivalmis,
.nimike-type-badge-uusiointivalmis {
  background: #ffedd5;
  border-color: #ea580c;
}

.nimike-link-card-uusiointivalmis:hover {
  background: #fed7aa;
  border-color: #c2410c;
}

.asiakas-nimike-group td {
  background: #f8fafc;
  font-weight: 600;
  color: #0f172a;
}

.asiakas-nimike-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  vertical-align: -0.05rem;
  margin-right: 0.4rem;
}

.asiakas-nimike-dot-materiaali { background: #dc2626; }
.asiakas-nimike-dot-uusiointi { background: #eab308; }
.asiakas-nimike-dot-valmis { background: #16a34a; }
.asiakas-nimike-dot-uusiointivalmis { background: #ea580c; }

.btn-nimike-uusiointi {
  color: #713f12;
  background: #fef9c3;
  border-color: #fde047;
}
.btn-nimike-uusiointi:hover,
.btn-nimike-uusiointi:focus {
  color: #713f12;
  background: #fef08a;
  border-color: #facc15;
}

.btn-nimike-materiaali {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.btn-nimike-materiaali:hover,
.btn-nimike-materiaali:focus {
  color: #991b1b;
  background: #fecaca;
  border-color: #f87171;
}

.btn-nimike-valmis {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.btn-nimike-valmis:hover,
.btn-nimike-valmis:focus {
  color: #166534;
  background: #bbf7d0;
  border-color: #4ade80;
}

.btn-nimike-uusiointivalmis {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}
.btn-nimike-uusiointivalmis:hover,
.btn-nimike-uusiointivalmis:focus {
  color: #9a3412;
  background: #fed7aa;
  border-color: #fb923c;
}

.nimike-link-name {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.nimike-link-customer {
  color: #64748b;
  font-size: 0.82rem;
}

#kuvaModal .modal-dialog {
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
}

#kuvaModal .modal-content,
#kuvaModal #kuvaUploadForm {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

#kuvaModal .modal-header,
#kuvaModal .modal-footer {
  flex: 0 0 auto;
}

#kuvaModal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.kuva-crop-stage {
  height: min(36vh, 340px);
  max-height: min(36vh, 340px);
  overflow: hidden;
  background: #0f172a;
  border-radius: 0.5rem;
}

.kuva-crop-stage img,
.kuva-crop-stage .cropper-container {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.doc-thumb {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #f8fafc;
}

.modal-drag-handle {
  cursor: move;
  user-select: none;
}

.modal-dialog.is-dragging {
  transition: none;
}

.tm-detail-page .page-toolbar {
  margin-bottom: 0.75rem;
}

.tm-detail-page .page-title {
  font-size: 1.25rem;
}

.tm-summary-card .content-card-toolbar {
  padding: 0.55rem 0.85rem;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.tm-summary-head-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tm-summary-nro {
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
}

.tm-summary-kone {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.tm-summary-otsikko {
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.tm-tila-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.tm-tila-badge--ajossa {
  background: #dcfce7;
  color: #166534;
}

.tm-tila-badge--suunnitelma {
  background: #dbeafe;
  color: #1d4ed8;
}

.tm-tila-badge--valmis {
  background: #f1f5f9;
  color: #64748b;
}

.tm-summary-body {
  padding: 0.55rem 0.85rem 0.65rem;
  border-top: 1px solid #e2e8f0;
}

.tm-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem 1rem;
}

@media (max-width: 991.98px) {
  .tm-summary-grid {
    grid-template-columns: 1fr;
  }
}

.tm-summary-block-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.tm-kv-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tm-kv {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tm-kv dt {
  flex: 0 0 auto;
  min-width: 4.5rem;
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.tm-kv dd {
  margin: 0;
  color: #334155;
  min-width: 0;
}

.detail-text-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.detail-text {
  white-space: pre-wrap;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #0f172a;
}

.tm-card-viewable {
  cursor: pointer;
}

.sisalto-summary-total td {
  border-top: 1px solid #e2e8f0;
}

.ve-varastoera-card .ve-scroll-wrap {
  border-radius: 0 0 0.625rem 0.625rem;
  overflow: hidden;
  background: #fff;
}

.ve-varastoera-card .ve-scroll-main {
  overflow: auto;
  max-height: min(520px, 55vh);
  -webkit-overflow-scrolling: touch;
}

.ve-varastoera-card .ve-scroll-main .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

.ve-varastoera-card .ve-scroll-main .data-table {
  margin-bottom: 0;
}

.ve-varastoera-card .table-hscroll-top::-webkit-scrollbar,
.ve-varastoera-card .ve-scroll-main::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.ve-varastoera-card .ve-scroll-main::-webkit-scrollbar-thumb,
.ve-varastoera-card .table-hscroll-top::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

.ve-varastoera-card .ve-scroll-main::-webkit-scrollbar-thumb:hover,
.ve-varastoera-card .table-hscroll-top::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.ve-varastoera-card .ve-scroll-main::-webkit-scrollbar-track,
.ve-varastoera-card .table-hscroll-top::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.ve-tuote-table .ve-aika-edit-btn {
  vertical-align: baseline;
  line-height: 1;
  color: #64748b;
}

.ve-tuote-table .ve-aika-edit-btn:hover {
  color: #0f172a;
}

.ve-tuote-table .ve-aika-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ve-tuote-table .ve-aika-edit.d-none {
  display: none !important;
}

.ve-tuote-table .ve-okt-tunnus {
  font-weight: 600;
  white-space: nowrap;
}

.ve-tuote-table .ve-lisatiedot {
  max-width: 12rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.ve-tuote-table .ve-kesto-poikkeama {
  color: #c62828;
  font-weight: 600;
}

.ve-tuote-table .ve-tulosta-btn {
  white-space: nowrap;
}

.ve-tuote-table .ve-kesk-pop {
  font-size: inherit;
  line-height: inherit;
  vertical-align: baseline;
}

.ve-kesk-popover {
  max-width: 22rem;
}

.ve-kesk-popover .popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-right: 0.65rem;
}

.ve-kesk-popover .ve-kesk-pop-title-text {
  flex: 1;
  min-width: 0;
}

.ve-kesk-popover .ve-kesk-pop-close {
  font-size: 0.65rem;
  margin: 0;
  padding: 0.25rem;
  opacity: 0.7;
}

.ve-kesk-popover .ve-kesk-pop-close:hover {
  opacity: 1;
}

.ve-kesk-popover .popover-body {
  padding: 0.6rem 0.75rem;
}

.ve-kesk-item + .ve-kesk-item {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #e2e8f0;
}

.ve-kesk-item-time {
  font-size: 0.82rem;
}

.ve-kesk-item-kesto {
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

.ve-kesk-item-syy {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.ve-kesk-item-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.ve-kesk-panel {
  background: #f8fafc;
}

.ve-kesk-list-table {
  font-size: 0.85rem;
  background: #fff;
}

.ve-kesk-list-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
  font-weight: 600;
  border-bottom-color: #e2e8f0;
}

.ve-kesk-list-syy {
  max-width: 18rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.ve-add-row td {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  vertical-align: middle;
}

.ve-add-icon-cell {
  width: 2rem;
  text-align: center;
  font-size: 1.1rem;
}

.ve-add-row .form-control,
.ve-add-row .form-select {
  min-width: 0;
}

.varastoera-filter-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.varastoera-filter-link:hover {
  text-decoration: underline;
}

.varastoera-filter-link.active {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ── Column filters ── */
.col-filter-btn {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.8rem;
  vertical-align: middle;
}

.col-filter-btn:hover {
  color: #3b82f6;
}

.col-filter-btn.active {
  color: #3b82f6;
}

.col-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #eff6ff;
  border-bottom: 1px solid #e2e8f0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 2rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  color: #334155;
}

.filter-chip .chip-col {
  font-weight: 600;
  color: #1e40af;
}

.filter-chip .chip-neg {
  color: #dc2626;
  font-weight: 500;
}

.filter-chip .chip-edit,
.filter-chip .chip-remove {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.75rem;
  line-height: 1;
}

.filter-chip .chip-edit:hover {
  color: #3b82f6;
}

.filter-chip .chip-remove:hover {
  color: #dc2626;
}

.col-filter-pop {
  position: absolute;
  z-index: 1050;
  width: 360px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
}

.col-filter-stats {
  border-top: 1px solid #e2e8f0;
  padding-top: 0.65rem;
  max-height: 220px;
  overflow-y: auto;
}

.cf-stats-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.cf-stats-mode {
  width: auto;
  min-width: 9rem;
  font-size: 0.72rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

.cf-stats-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 4.5rem;
  gap: 0.35rem;
  align-items: center;
  width: 100%;
  padding: 0.2rem 0;
  border: none;
  background: none;
  text-align: left;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  border-radius: 0.25rem;
}

.cf-stats-row:hover {
  background: #f1f5f9;
}

.cf-stats-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-stats-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.cf-stats-fill {
  display: block;
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
}

.cf-stats-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cf-stats-more {
  font-size: 0.72rem;
  margin-top: 0.35rem;
  font-style: italic;
}

/* ── Column menu drag & drop ── */
.col-drag-handle {
  cursor: grab;
  color: #94a3b8;
  flex-shrink: 0;
  padding: 0 0.15rem;
  user-select: none;
}

.col-drag-handle:hover {
  color: #475569;
}

.col-menu-item.dragging {
  opacity: 0.5;
  background: #eff6ff;
  border-radius: 0.375rem;
}

/* ── Dashboard cards ── */
.dashboard-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.dashboard-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dashboard-card .card-header i {
  color: #64748b;
}

.dashboard-card .card-body {
  padding: 0;
}

.dashboard-card .card-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 0.5rem 1rem;
  text-align: right;
}

.dashboard-card .card-footer a {
  font-size: 0.8rem;
  text-decoration: none;
}

/* ── Varastoerän QR-lukija (modaali) ── */
.ve-qr-reader-wrap {
  max-width: 100%;
}

.ve-qr-reader-wrap #veQrReader {
  overflow: hidden;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #0f172a;
}

.ve-qr-reader-wrap #veQrReader video {
  width: 100% !important;
}

#veQrScanModal .dropdown-item {
  cursor: pointer;
}

/* ── List items ── */
.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.item-list li {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}

.item-list li:last-child {
  border-bottom: none;
}

.item-list li:hover {
  background: #f8fafc;
}

.item-title {
  font-size: 0.85rem;
  color: #1e293b;
  font-weight: 500;
}

.item-title a {
  color: inherit;
  text-decoration: none;
}

.item-title a:hover {
  color: #3b82f6;
}

.item-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.badge-new {
  font-size: 0.65rem;
  vertical-align: middle;
  margin-left: 0.35rem;
}

/* ── Calendar entries ── */
.cal-entry {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.cal-date {
  flex-shrink: 0;
  width: 52px;
  text-align: center;
  background: #eff6ff;
  border-radius: 0.375rem;
  padding: 0.3rem 0.25rem;
}

.cal-date .day {
  font-size: 0.65rem;
  color: #3b82f6;
  font-weight: 600;
  text-transform: uppercase;
}

.cal-date .num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e40af;
  line-height: 1.1;
}

.cal-text {
  font-size: 0.82rem;
  color: #334155;
  padding-top: 0.15rem;
}

/* ── Shipment / incoming items ── */
.shipment-item .ship-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
}

.shipment-item .ship-customer {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 0.1rem;
}

.shipment-item .ship-detail {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.shipment-item .ship-order {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* ── Empty state ── */
.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ── SQL-debug (luettelo.asp) ── */
.sql-debug-panel {
  margin: 0 1rem 1rem;
  padding: 1rem;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.sql-debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sql-debug-meta {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.sql-debug-meta dt {
  margin: 0;
  font-weight: 600;
  color: #92400e;
}

.sql-debug-meta dd {
  margin: 0;
  word-break: break-word;
}

.sql-debug-label {
  font-weight: 600;
  color: #92400e;
  margin: 0.5rem 0 0.25rem;
}

.sql-debug-pre {
  margin: 0 0 0.5rem;
  padding: 0.65rem 0.75rem;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 0.375rem;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.sql-debug-hint code {
  font-size: 0.85em;
}

/* ── Ajolistakalenteri (koneittain) ── */
.tm-board-card {
  overflow: hidden;
}

.tm-board-scroll {
  overflow-x: auto;
}

.tm-board {
  table-layout: fixed;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.tm-board-col-head {
  min-width: 260px;
  width: 260px;
  text-align: center;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 2;
}

.tm-board-col-cell {
  vertical-align: top;
  padding: 0.5rem;
  background: #f1f5f9;
  min-width: 260px;
  width: 260px;
}

.tm-board-col-body {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tm-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  cursor: grab;
  user-select: none;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tm-card-viewable {
  cursor: pointer;
}

.tm-card-edit {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  margin: 0.15rem 0 0.35rem;
  cursor: pointer;
}

.tm-card-edit:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.tm-card-schedule {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.25rem;
}

.tm-card-stats {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
}

.tm-card-stats li {
  position: relative;
  padding-left: 0.85rem;
  color: #334155;
  font-size: 0.72rem;
  line-height: 1.4;
}

.tm-card-stats li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: #64748b;
}

.tm-card:active {
  cursor: grabbing;
}

.tm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.tm-card-nro {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.tm-card-tila {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.tm-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.2rem;
}

.tm-card-meta,
.tm-card-date {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.3;
}

.tm-card--ajossa {
  border-left: 4px solid #16a34a;
}

.tm-card--ajossa .tm-card-tila {
  background: #dcfce7;
  color: #166534;
}

.tm-card--suunnitelma {
  border-left: 4px solid #2563eb;
}

.tm-card--suunnitelma .tm-card-tila {
  background: #dbeafe;
  color: #1d4ed8;
}

.tm-card--valmis {
  border-left: 4px solid #94a3b8;
  opacity: 0.88;
}

.tm-card--valmis .tm-card-tila {
  background: #e2e8f0;
  color: #475569;
}

.tm-card-ghost {
  opacity: 0.45;
}

.tm-card-chosen {
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
}

.tm-card-drag {
  opacity: 0.95;
}

.tm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  font-size: 0.82rem;
}

.tm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tm-legend-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  display: inline-block;
}

.tm-legend-dot--ajossa { background: #16a34a; }
.tm-legend-dot--suunnitelma { background: #2563eb; }
.tm-legend-dot--valmis { background: #94a3b8; }

.tm-save-status {
  min-width: 6rem;
}

.tm-kone-dropdown {
  min-width: 14rem;
  max-width: 20rem;
}

.tm-konevalikko .tm-kone-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 18rem;
  overflow-y: auto;
  margin-bottom: 0.65rem;
}

.tm-kone-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.88rem;
}

.tm-kone-row:hover {
  background: #f1f5f9;
}

.tm-kone-row.is-selected {
  background: #eff6ff;
}

.tm-kone-row .form-check-input {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.tm-kone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.65rem;
}

.tm-kone-actions .btn-primary {
  margin-left: auto;
}

/* ── Desktop: collapsible sidebar ── */
@media (min-width: 992px) {
  .main-wrapper {
    margin-left: 0;
  }

  .main-wrapper.sidebar-open {
    margin-left: var(--sidebar-width);
  }

  .sidebar-overlay {
    display: none !important;
  }
}
