/* Password toggle button (Bootstrap input-group) */
.password-toggle-btn {
    border-left: none;
}

/* Dashboard */

body {
  background-color: #dfe6ed;
  /* Darker slate-gray for better contrast */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #343a40;
}

.grid-stack {
  background: transparent;
}

.grid-stack-item-content {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  padding: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.grid-stack-item-content:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.grid-stack-item-content canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.item-body {
  padding: 15px;
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
}

.chart-item-body {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-header {
  color: white;
  padding: 10px;
  border-radius: 5px;
}

.item-header-readonly {
  background-color: #1e3a8a;
  /* High contrast Dark Blue */
  color: #ffffff;
  padding: 15px 20px;
  border-bottom: none;
  display: flex;
  align-items: center;
}

.item-header-readonly h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: #ffffff;
  /* White text */
  text-transform: uppercase;
  /* More executive feel */
}

/* Container and Main Heading */

.container {
  max-width: 1200px;
  margin: auto;
}

.title-section {
  background: white;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  background: linear-gradient(to right, #1e3a8a, #2563eb);
  /* Executive Gradient */
}

h1.text-center,
.title-section h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  color: #ffffff;
  /* White text on blue gradient */
  letter-spacing: -0.05rem;
  text-transform: uppercase;
  font-size: 2.5rem !important;
  margin-bottom: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tabs */
.nav-tabs .nav-link {
  color: #495057;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out;
}

.nav-tabs .nav-link.active {
  background-color: #007bff;
  color: #fff;
  border-color: #007bff #007bff #fff;
}

/* Sidebar Styling */
.sidebar {
  background-color: #f8f9fa;
  border-right: 2px solid #e9ecef;
  padding: 15px;
  border-radius: 8px;
}

.sidebar h4 {
  color: #343a40;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border: 1px solid #e9ecef;
  margin-bottom: 5px;
  border-radius: 5px;
  transition: background-color 0.2s ease;
}

.list-group-item:hover {
  background-color: #e2e6ea;
}

/* Button Styles */

.clickable-item {
  cursor: pointer;
}

.div_tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  /* Bigger font for KPI */
  font-weight: 800;
  color: #2b6cb0;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tile-item-body {
  padding: 0 !important;
  /* Remove padding to let tile fill space */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.btn-outline-primary {
  border-color: #007bff;
  color: #007bff;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.btn-outline-primary:hover {
  background-color: #007bff;
  color: #fff;
}

/* Chat Form */
#chat-form input[type="text"] {
  border-radius: 5px;
  border: 1px solid #ced4da;
}

#chat-form .btn {
  border-radius: 5px;
}

/* Spinner */

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(128, 128, 128, 0.5);
  /* grey, semi-transparent */
  display: none;
  /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 9999;
  pointer-events: auto;
  /* block clicks */
}

#loadingOverlay .spinner {
  width: 80px;
  height: 80px;
  border: 10px solid #f3f3f3;
  border-top: 10px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Table Container */
.table-container {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 10px;
  background-color: #ffffff;
}

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

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

table th {
  background-color: #f2f2f2;
}

/* Chart Area */
#chart canvas {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  #chat-form {
    flex-direction: column;
  }
}

#console {
  background-color: #1e1e1e;
  padding: 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  white-space: pre-wrap;
  /* To preserve newlines */
  border-radius: 5px;
  margin-top: 20px;
  /* You can adjust this */
  overflow-y: auto;
  /* Scroll vertically if needed */
}