@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --primary: #10b981;
  --secondary: #059669;
  --primary-light: rgba(16, 185, 129, 0.1);
  --success: #10b981;
  --warning: #fbbf24;
  --danger: #f87171;
  --dark: #f8fafc;
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #020617;
  --light: #f1f5f9;
  --sidebar-width: 280px;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.05);
  --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Outfit", sans-serif;
}

body {
  background: var(--bg-main);
  min-height: 100vh;
  color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* App Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand i {
  background: var(--primary-light);
  padding: 10px;
  border-radius: 10px;
}

.sidebar-menu {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.menu-item.active {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px;
  border-radius: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

.logout-btn:hover {
  color: var(--danger);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  transition: margin-left 0.3s ease;
  width: calc(100% - var(--sidebar-width));
}

.main-header {
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title h1 {
  font-size: 1.5rem;
  color: #fff;
  font-weight: 700;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-container {
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
}

.period {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(22, 104, 6, 0.2);
}

.filters {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
}

.filter-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 1rem;
  color: #fff;
  background-color: #1e293b;
  outline: none;
  appearance: none;
}

.filter-group select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.filter-group select option {
  background-color: #1e293b;
  color: #fff;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  background-color: #243046;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  letter-spacing: -0.5px;
  word-wrap: break-word;
}

.card-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.card-change.positive {
  background: rgba(6, 214, 160, 0.1);
  color: var(--success);
}

.card-change.negative {
  background: rgba(239, 71, 111, 0.1);
  color: var(--danger);
}

.card-change.neutral {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

.table-container {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.search-box input {
  width: 100%;
  padding: 10px 40px 10px 20px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1e293b;
  color: #fff;
}

.search-box input:focus {
  background: #243046;
  border-color: var(--primary);
  outline: none;
}

.search-box i {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: #94a3b8;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  color: #cbd5e1;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 900px) {
  .mobile-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
  }

  .main-header {
    flex-direction: row-reverse;
    justify-content: space-between;
  }

  .table-container {
    padding: 1rem;
    overflow-x: hidden;
  }

  .table-header {
    flex-direction: column;
    align-items: stretch;
  }

  table thead {
    display: none;
  }

  table tbody tr {
    display: block;
    background: var(--bg-card);
    margin-bottom: 1rem;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: right;
    word-break: break-word;
    min-width: 0;
  }

  table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #888;
    font-size: 0.85rem;
    text-transform: uppercase;
    text-align: left;
    margin-right: 1rem;
  }

  /* Estabilizar tabela de perdas no mobile: O título do card continua sendo o Produto */
  .perdas-detailed-table tbody td:first-child {
    background: none !important;
    margin: 0 !important;
    padding: 0.8rem 0 !important;
    justify-content: space-between !important;
    border-radius: 0 !important;
  }

  .perdas-detailed-table tbody td:first-child::before {
    display: block !important;
  }

  .perdas-detailed-table tbody td:nth-child(2) {
    background: rgba(255, 255, 255, 0.03) !important;
    margin: -1.5rem -1.5rem 1rem -1.5rem !important;
    padding: 1rem 1.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    justify-content: center !important;
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
  }

  .perdas-detailed-table tbody td:nth-child(2)::before {
    display: none !important;
  }

  .perdas-detailed-table tbody td:nth-child(2) strong {
    font-size: 1.1rem;
    color: var(--primary);
  }

  table tbody td:first-child:not(.perdas-detailed-table td) {
    background: rgba(255, 255, 255, 0.03);
    margin: -1.5rem -1.5rem 1rem -1.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    justify-content: center;
    border-radius: 16px 16px 0 0;
  }

  table tbody td:first-child:not(.perdas-detailed-table td)::before {
    display: none;
  }

  table tbody td:first-child strong {
    font-size: 1.1rem;
    color: var(--primary);
  }
}

.table-responsive {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.estoque-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.estoque-table th,
.estoque-table td {
  padding: 0.8rem;
  text-align: center;
  border-bottom: 1px solid #f1f1f1;
  white-space: nowrap;
  font-size: 0.9rem;
}

.estoque-table th {
  background-color: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}

.estoque-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
  background-color: var(--bg-card);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.estoque-table td:first-child {
  text-align: left;
  font-weight: 700;
  color: var(--primary);
  position: sticky;
  left: 0;
  background-color: var(--bg-card);
  z-index: 15;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.estoque-table tr:hover td {
  background-color: rgba(16, 185, 129, 0.05);
}

.stock-critical {
  color: var(--danger);
  font-weight: 600;
  background-color: rgba(239, 71, 111, 0.05);
}

.stock-warning {
  color: var(--warning);
  font-weight: 600;
}

.stock-ok {
  color: var(--primary);
  font-weight: 600;
}

.stock-empty {
  color: #ccc;
}

.perdas-charts-row,
.charts-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {

  .perdas-charts-row,
  .charts-row {
    flex-direction: column;
  }
}

.chart-card {
  flex: 1 1 450px;
  /* Base de 450px, mas pode encolher ou crescer */
  background: #1e293b;
  padding: 1.25rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
  /* Permite encolher abaixo da base de flex se necessário */
}

@media (max-width: 900px) {
  .chart-card {
    flex: 1 1 100%;
    min-width: 100% !important;
    margin-bottom: 1rem;
  }

  .chart-wrapper {
    height: 300px !important;
  }

  .custom-legend {
    grid-template-columns: 1fr !important;
    max-height: 250px;
    overflow-y: auto;
  }

  .chart-header {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .chart-wrapper {
    height: 250px !important;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Maior destaque para os gráficos de curva ABC no desktop */
@media (min-width: 1024px) {
  .perdas-curva-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
  }

  .perdas-curva-row .chart-card {
    min-width: 0;
    /* Permite que o grid controle o tamanho */
  }

  .perdas-curva-row .chart-wrapper {
    height: 350px;
  }
}

/* Ajuste para mobile e tablets menores para garantir que não quebre */
@media (max-width: 1023px) {
  .perdas-curva-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
}



.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-title-main {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.chart-header i {
  color: var(--primary);
  background: rgba(22, 104, 6, 0.2);
  padding: 8px;
  border-radius: 8px;
}

.chart-wrapper {
  position: relative;
  height: 350px;
  width: 100%;
}

.custom-legend {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #a0a6b5;
  padding: 6px 10px;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.legend-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-value {
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
}


.btn-filtrar {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  min-height: 48px;
  width: 100%;
}

.btn-filtrar:hover {
  background: var(--secondary);
  box-shadow: 0 4px 12px rgba(22, 104, 6, 0.2);
}

#legend-perdas-motivo,
#legend-perdas-categoria {
  width: 100%;
}

#legend-perdas-motivo .legend-item,
#legend-perdas-categoria .legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-right: 8px;
}

#legend-perdas-motivo .legend-label,
#legend-perdas-categoria .legend-label {
  flex: 1;
  width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
}

#legend-perdas-motivo .legend-value,
#legend-perdas-categoria .legend-value {
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 600px) {

  #legend-perdas-motivo .legend-item,
  #legend-perdas-categoria .legend-item {
    font-size: 0.8rem;
  }

  #legend-perdas-motivo .legend-value,
  #legend-perdas-categoria .legend-value {
    font-size: 0.8rem;
  }
}

.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 767px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* DRG Retiro - Cubo BI Styles */
.drg-content-wrapper {
  display: grid;
  gap: 16px;
  grid-template-columns: 320px 1fr;
  margin-top: 1rem;
}

.drg-panel {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.drg-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.35), rgba(31, 41, 55, 0));
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  color: #94a3b8;
}

.drg-fields {
  padding: 12px;
  display: grid;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.drg-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #1f2937;
  color: var(--light);
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.drg-chip:hover {
  background: #2d3748;
  transform: translateY(-2px);
}

.drg-chip[data-type="measure"] {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.drg-chip[data-type="dimension"] {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
}

.drg-chip:active {
  cursor: grabbing;
}

.drg-actions {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-direction: column;
}

.drg-shelves {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.drg-shelf {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px;
  min-height: 60px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: rgba(2, 6, 23, 0.3);
  transition: all 0.2s ease;
}

.drg-shelf.drag-over {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--primary);
}

.drg-shelf-label {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.drg-hint {
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 4px;
  font-style: italic;
}

.drg-viz {
  padding: 12px;
}

#drg-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

#drg-summary .drg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #cfe1ff;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
}

#drg-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

#drg-pivot {
  width: 100%;
  border-collapse: collapse;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

#drg-pivot thead th {
  position: sticky;
  top: 0;
  background: rgba(17, 24, 39, 0.9);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: grab;
  white-space: nowrap;
  z-index: 10;
}

#drg-pivot thead th:first-child {
  cursor: default;
}

#drg-pivot tbody td {
  padding: 10px 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  font-size: 0.85rem;
  color: #cbd5e1;
}

#drg-pivot tbody td:first-child {
  font-weight: 600;
  color: var(--primary);
  position: sticky;
  left: 0;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(4px);
  z-index: 5;
}

#drg-pivot tbody tr:hover td {
  background: rgba(16, 185, 129, 0.05);
}

.btn-secondary {
  background: transparent;
  color: var(--light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
  width: 100%;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.menu-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  padding-left: 16px;
}

.menu-category:first-child {
  margin-top: 0;
}

@media (max-width: 1200px) {
  .drg-content-wrapper {
    grid-template-columns: 1fr;
  }

  .drg-fields-panel {
    order: 2;
  }

  .drg-viz-panel {
    order: 1;
  }
}

@media (max-width: 900px) {
  .drg-actions {
    flex-direction: row;
  }

  #drg-pivot {
    font-size: 0.75rem;
  }

  #drg-pivot thead th,
  #drg-pivot tbody td {
    padding: 8px;
  }
}