.tmtt-page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 20px;
}

.tmtt-header {
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--portal-brand-start, #667eea) 0%,
    var(--portal-brand-end, #764ba2) 100%
  );
  box-shadow: var(--portal-shadow-panel, 0 8px 24px rgba(79, 70, 229, 0.18));
}

.tmtt-header h1 {
  margin: 0;
  font-size: 24px;
}

.tmtt-header p {
  margin: 8px 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.tmtt-block-title {
  font-size: 14px;
  font-weight: 600;
}

.tmtt-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.tmtt-field input {
  height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.tmtt-field input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.tmtt-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tmtt-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tmtt-btn-primary {
  background: #4f46e5;
  color: #fff;
}

.tmtt-btn-primary:hover:not(:disabled) {
  background: #4338ca;
}

.tmtt-btn-success {
  background: #16a34a;
  color: #fff;
}

.tmtt-btn-success:hover:not(:disabled) {
  background: #15803d;
}

.tmtt-btn-ghost {
  background: #f1f5f9;
  color: #334155;
}

.tmtt-btn-ghost:hover {
  background: #e2e8f0;
}

.tmtt-error-banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.tmtt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.tmtt-kpi-card {
  padding: 14px;
  border-radius: 10px;
  border-left: 4px solid #64748b;
  background: #fff;
  box-shadow: var(--portal-shadow-soft, 0 2px 8px rgba(15, 23, 42, 0.08));
}

.tmtt-kpi-card.tone-danger {
  border-left-color: #ef4444;
}

.tmtt-kpi-card.tone-warning {
  border-left-color: #f59e0b;
}

.tmtt-kpi-label {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.tmtt-kpi-value {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
}

.tmtt-kpi-unit {
  font-size: 12px;
  margin-left: 4px;
  color: #64748b;
}

.tmtt-chart-grid {
  display: grid;
  gap: 12px;
}

.tmtt-chart-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.tmtt-chart-card h3 {
  margin: 0;
  font-size: 14px;
}

.tmtt-chart-canvas {
  width: 100%;
  height: 360px;
  margin-top: 8px;
}

.tmtt-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tmtt-detail-count {
  margin-left: 6px;
  color: #64748b;
  font-size: 13px;
}

.tmtt-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tmtt-detail-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.tmtt-detail-table {
  width: 100%;
  min-width: 1500px;
  border-collapse: collapse;
  font-size: 12px;
}

.tmtt-detail-table th,
.tmtt-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.tmtt-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.tmtt-sort-btn {
  border: none;
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.tmtt-sort-indicator {
  color: #64748b;
  min-width: 10px;
}

.tmtt-detail-table tbody tr:hover {
  background: #f8fafc;
}

.tmtt-detail-table .is-numeric {
  text-align: right;
}

.tmtt-detail-table .is-danger {
  color: #dc2626;
}

.tmtt-detail-table .is-warning {
  color: #d97706;
}

.tmtt-empty-row {
  text-align: center;
  padding: 20px;
  color: #94a3b8;
}

.tmtt-empty-state {
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

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

@media (max-width: 900px) {
  .tmtt-page {
    padding: 12px;
  }

  .tmtt-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tmtt-detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
