/* LOGIN PAGE */
.login-page {
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background-color: #e6f4ea;
}

.login-container {
  background: white;
  padding: 3rem 2rem;
  width: 420px;
  max-width: 90%;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-logo img {
  width: 60px;
  margin-bottom: 0.5rem;
}

.login-logo h2 {
  margin-bottom: 2rem;
  font-size: 1.3rem;
  color: #d01414;
}

.login-form input {
  display: block;
  margin: 0 auto 1rem;
  padding: 0.75rem;
  width: 90%;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.login-form button {
  background: #d01414;
  color: white;
  border: none;
  padding: 0.75rem;
  width: 90%;
  cursor: pointer;
  border-radius: 6px;
  font-weight: bold;
  transition: background 0.3s;
}

.login-form button:hover {
  background: #ff7f7f;
}

.password {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  cursor: pointer;
}

/* index */
/* ====== TOÀN TRANG ====== */
body {
  overflow-x: hidden;
}

body,
html {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
}

.wrapper {
  display: flex;
  min-height: 100vh;
  /* height: auto để nội dung kéo dãn được */
  height: auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: 240px;
  background-color: #d01414;
  color: white;
  transition: width 0.3s ease;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: 0;
}

/* Sidebar hover effects */
.sidebar-item {
  padding: 10px 15px;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.sidebar-item.active,
.sidebar-item:focus {
  background-color: #0d6efd;
  color: white !important;
}

#sidebar img {
  transition: transform 0.3s ease;
}

#sidebar img:hover {
  transform: scale(1.1);
}

.main-content {
  flex-grow: 1;
  transition: margin-left 0.3s ease;
}

.wrapper.sidebar-collapsed .main-content {
  margin-left: 0;
}

.toggle-btn {
  border: none;
  background: none;
  font-size: 1.5rem;
  color: #d01414;
  margin-right: 10px;
  cursor: pointer;
}

/* ====== NỘI DUNG CHÍNH ====== */
.content-area {
  flex: 1;
  padding: 20px;
  background-color: #f4fdf6;
  overflow-y: auto;
}

.card {
  border: none;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  padding: 6px 10px;
  margin-left: 10px;
  border: 1px solid #ced4da;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  padding: 4px 8px;
  margin-right: 5px;
}

table.dataTable td,
table.dataTable th {
  vertical-align: middle;
}

.dataTables_length select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 6px 12px;
  padding-right: 36px;
  /* chừa nhiều chỗ cho mũi tên */
  border-radius: 8px;
  border: 1px solid #ced4da;
  background-color: #fff;
  font-size: 14px;
  min-width: 70px;
  /* Ép chiều rộng tối thiểu đủ */
}

.dataTables_length {
  display: flex;
  align-items: center;
  gap: 8px;
}

.select2-container .select2-selection--single {
  height: 38px !important;
  /* same as .form-control */
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px;
  /* aligns vertically */
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
  right: 10px;
}

.select2-container--default .select2-selection--single {
  background-color: white;
}

/* Make Select2 full width like Bootstrap inputs */
.select2-container {
  width: 100% !important;
}

.rotate-180 {
  transform: rotate(180deg);
  transition: transform 0.2s;
}

.custom-spinner-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
}

.custom-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* infomation */
.card-header {
  background-color: #d01414;
}

.form-control,
.form-select {
  border-radius: 0.5rem;
  box-shadow: none;
  transition: all 0.2s;
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-success {
  border-radius: 0.5rem;
}

/* bill-household */
.household-info {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.household-info h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: #495057;
  font-weight: bold;
}

.household-info .row {
  margin-bottom: 10px;
}

.household-info .col-md-6 {
  font-size: 1rem;
}

.household-info .label {
  font-weight: bold;
  color: #6c757d;
}

.household-info .value {
  font-weight: normal;
  color: #343a40;
}

.btn-excel {
  min-width: 150px;
  height: 40px;
}

canvas {
  width: 100% !important;
  height: auto !important;
}

.flex-grow-1>canvas {
  height: 300px !important;
}

.card-dashboard {
  border-radius: 10px;
  background: #fff;
  height: 100%;
}

.chart-wrapper {
  height: 300px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}