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

body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #333;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

body {
  overflow-x: hidden;
}

#dashboardGrid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.dashboard-tile {
  background: white;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.tile-small {
  grid-column: span 3;
}

.tile-medium {
  grid-column: span 6;
}

.tile-large {
  grid-column: span 12;
}

.tile-content canvas {
  width: 100% !important;
  height: 320px !important;
}

.tile-toolbar {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
}

.edit-mode .tile-toolbar {
  display: flex;
  gap: 4px;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 340px;
  height: 100%;
  background: white;
  padding: 20px;
  box-shadow: -3px 0 12px rgba(0,0,0,0.15);
  transition: right 0.3s ease;
  z-index: 999;
}

.settings-panel.open {
  right: 0;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-panel input,
.settings-panel select {
  width: 100%;
  margin-bottom: 12px;
  padding: 6px;
}

.settings-panel button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.settings-panel h4{
  margin-top:20px;
  margin-bottom:6px;
  font-size:14px;
  border-bottom:1px solid #eee;
  padding-bottom:4px;
}

.settings-panel label{
  display:block;
  margin-top:8px;
  font-size:13px;
}

.settings-panel input,
.settings-panel select{
  width:100%;
  margin-top:4px;
  padding:6px;
}

.settings-panel button{
  margin-top:15px;
}
.dashboard {
  max-width: 1400px;
  margin: auto;
  padding: 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 25px;
}

.cards {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 200px;
  text-align: center;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.card .value {
  font-size: 2rem;
  margin-top: 10px;
  color: #007acc;
}

.table-section {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

th, td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

th {
  background: #f0f0f0;
}

.charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}


.chart-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  height: 380px;
}

.chart-card canvas {
  height: 300px !important;
}

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  z-index: 9999;
}

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

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.growth-indicator {
  margin-top: 5px;
  font-size: 14px;
}

.growth-up {
  color: #16a34a;
}

.growth-down {
  color: #dc2626;
}

.quick-filters {
  margin: 10px 0 20px 0;
}

.quick-filters button {
  margin-right: 8px;
  padding: 6px 12px;
  border: none;
  background: #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.quick-filters button:hover {
  background: #d1d5db;
}

.quick-filters button.active {
  background: #2563eb;
  color: white;
}

/* dropdown for monthly button */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  background: white;
  border-radius: 6px;
  box-shadow: 0 5px 12px rgba(0,0,0,0.12);
  padding: 8px;
  top: 36px;
  z-index: 10;
}

.dropdown-menu div {
  padding: 6px 10px;
  cursor: pointer;
}

.dropdown-menu div:hover {
  background: #f3f4f6;
}

.filter-summary-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 20px 0;
}

.filter-summary {
  padding: 10px 14px;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
}

.clear-filters {
  padding: 6px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.clear-filters:hover {
  background: #dc2626;
}

.edit-dashboard-btn {
  margin-bottom: 15px;
  padding: 8px 14px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.edit-dashboard-btn:hover {
  background: #1d4ed8;
}


.chart-card canvas {
  width: 100% !important;
  height: 300px !important;
}

.dashboard-tile {
  background: white;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: relative;
}

.tile-toolbar {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
}

.tile-toolbar button {
  border: none;
  background: #f3f4f6;
  margin-left: 4px;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 6px;
}

.tile-toolbar button:hover {
  background: #e5e7eb;
}

.edit-mode .tile-toolbar {
  display: block;
}

/* inline title editor */
.tile-title-editor{
width:100%;
border:1px solid #ccc;
border-radius:4px;
padding:4px;
}

/* layout locking hides toolbars */
.layout-locked .tile-toolbar{
display:none;
}
