/* Shared theme CSS for LittleSaving
 * Import this in every HTML page after Tailwind CSS
 */

/* ===========================
   Core Reusable Components
   =========================== */

/* Primary CTA Button */
.btn-primary {
  background: #386641;
  transition: all 0.3s ease;
}
.btn-primary:hover {
  background: #3D7E52;
  box-shadow: 0 0 20px rgba(56, 102, 65, 0.4);
  transform: translateY(-1px);
}

/* Social Login Button */
.social-btn {
  transition: all 0.3s ease;
  border: 1px solid #1F2226;
}
.social-btn:hover {
  border-color: #386641;
  background: rgba(56, 102, 65, 0.08);
  transform: translateY(-1px);
}

/* Input Field */
.input-field {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.input-field:focus {
  border-color: #386641;
  box-shadow: 0 0 0 3px rgba(56, 102, 65, 0.15);
  outline: none;
}

/* Viền lỗi validation — màu error. Đặt sau :focus để thắng cả khi đang
   gõ. Trước đây class này được dùng ở mọi trang auth nhưng chưa từng
   được định nghĩa, nên register/join/reset-password không có viền đỏ. */
.error-border,
.error-border:focus {
  /* !important: Tailwind CDN chèn CSS sau file này, border-* utility
     cùng độ ưu tiên sẽ thắng nếu không có. */
  border-color: #B91C1C !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

/* Link Hover */
.link-hover:hover {
  color: #22C55E;
}

/* Card with Shadow */
.card-glow {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ===========================
   Checkboxes (Context-Specific)
   =========================== */

/* Base Checkbox */
.checkbox-custom {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

/* Login Page: White bg, black tick */
#loginForm .checkbox-custom {
  background-color: #ffffff;
  border: 1px solid #ffffff;
}
#loginForm .checkbox-custom:checked {
  background-color: #ffffff;
  border-color: #ffffff;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='black' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

/* Register Page: Green bg, white tick */
#registerForm .checkbox-custom {
  background-color: #0A0A0A;
  border: 1px solid #1F2226;
  transition: all 0.2s ease;
}
#registerForm .checkbox-custom:checked {
  background-color: #386641;
  border-color: #386641;
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

/* ===========================
   Dashboard & Reports Components
   =========================== */

/* KPI Card */
.kpi-card {
  background: #121212;
  border: 1px solid #1F2226;
  border-radius: 1rem;
  transition: all 0.3s ease;
}
.kpi-card:hover {
  border-color: #386641;
  box-shadow: 0 0 24px rgba(56, 102, 65, 0.1);
  transform: translateY(-2px);
  position: relative;
  z-index: 10;
}

/* Pending Row — dòng trong khối "Cần xử lý" và danh sách chính trên bills.html.
   Bỏ viền/nền riêng; phân cách bằng kẻ dưới; dòng cuối không kẻ. */
.pending-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #1F2226;
}
.pending-row:last-child {
  border-bottom: 0;
}
/* Dòng trong danh sách chính bọc nội dung trong một flex cha duy nhất —
   dàn full width để icon/info/right xếp đúng. Selector chỉ trúng khi
   phần tử con đầu và duy nhất là một flex row. */
.pending-row > .pending-row-inner {
  flex: 1 1 auto;
  min-width: 0;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}
.badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #FACC15;
}
.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
}
.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
}
.badge-muted {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}

/* Navigation Link */
.nav-link {
  color: #6B7280;
  transition: all 0.2s ease;
  border-radius: 0.5rem;
  padding: 6px 12px;
  font-size: 0.8rem;
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(56, 102, 65, 0.1);
}
.nav-link.active {
  color: #22C55E;
  background: rgba(56, 102, 65, 0.12);
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #1F2226;
}
.data-table td {
  padding: 12px 16px;
  color: #E2E8F0;
  border-bottom: 1px solid rgba(31, 34, 38, 0.8);
}
.data-table tbody tr:hover td {
  background-color: rgba(56, 102, 65, 0.06);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #0A0A0A;
}
::-webkit-scrollbar-thumb {
  background: #1F2226;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #386641;
}

/* Tab Navigation */
.tab-btn {
  color: #6B7280;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  white-space: nowrap;
}
.tab-btn:hover {
  color: #ffffff;
}
.tab-btn.active {
  color: #22C55E;
  border-bottom-color: #22C55E;
}

/* Tab Panel */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Avatar Circle */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 280px;
}

/* ===========================
   Autofill Fix
   =========================== */

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #121212 inset;
  -webkit-text-fill-color: #ffffff;
}

/* Date picker icon hiện đúng trên dark background. Không có dòng này,
   Chrome tự ẩn indicator (opacity: 0) vì thiếu color-scheme. */
input[type='date'],
input[type='time'] {
  color-scheme: dark;
}

