/* ==========================================================
   Gurudeva Kudumbayogam Web App — Dark Green Theme
   Author: Filanza Systems
   Purpose: Elegant, green-toned responsive theme
   ========================================================== */

/* ---------- Global ---------- */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Poppins", "Inter", "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  background: linear-gradient(145deg, #f8fbf8 0%, #edf5ee 100%);
  color: #212529;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ---------- Color Palette ---------- */
:root {
  --primary: #176b3a; /* Deep green */
  --primary-light: #2e8b57;
  --primary-dark: #0e4d2d;
  --accent: #22c55e;
  --text-dark: #1f2937;
}

/* ---------- Navbar ---------- */
.navbar {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  border: none;
  padding: 0.6rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.navbar-brand {
  font-weight: 700;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.navbar-brand img {
  height: 32px;
}
.navbar .btn {
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}
.navbar .btn:hover {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
}

/* ---------- Cards ---------- */
.card {
  border: none;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.card h3 {
  font-size: 1.7rem;
  color: var(--primary);
  margin: 0;
  font-weight: 700;
}
.card small {
  color: #6c757d;
}

/* ---------- Dashboard Cards ---------- */
.dashboard-card {
  background: linear-gradient(145deg, #ffffff 0%, #f0f6f0 100%);
  border-radius: 1rem;
  text-align: center;
  padding: 1.2rem;
}
.dashboard-card h3 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--primary);
}
.dashboard-card small {
  display: block;
  color: #6c757d;
}

/* ---------- Tables ---------- */
.table {
  font-size: 0.9rem;
  width: 100%;
}
.table thead {
  background: #e6f0ea;
  color: var(--text-dark);
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}
.table-striped tbody tr:nth-child(odd) {
  background-color: #f9fbf9;
}
.table-hover tbody tr:hover {
  background-color: #e5f4e5;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: 8px;
  transition: all 0.2s ease;
}
.btn-primary {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
}
.btn-primary:hover {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 100%);
}
.btn-outline-secondary {
  border-color: #ced4da;
  color: #495057;
}
.btn-outline-secondary:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

/* ---------- Forms ---------- */
.form-label {
  font-weight: 600;
  color: #495057;
}
.form-control, .form-select {
  border-radius: 8px;
  font-size: 0.9rem;
  border-color: #d0d5db;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.15rem rgba(23,107,58,0.2);
}

/* ---------- Modals ---------- */
.modal-content {
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.modal-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-bottom: none;
}
.modal-title {
  font-weight: 600;
}
.modal-footer {
  border-top: none;
}

/* ---------- DataTables ---------- */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 5px 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: none !important;
  background: transparent !important;
  color: var(--primary) !important;
  margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: #fff !important;
  border-radius: 6px;
}
.dataTables_wrapper .dataTables_info {
  color: #6c757d;
  padding-top: 0.75rem;
}

/* ---------- Charts ---------- */
canvas {
  max-height: 320px;
}
.chart-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 1rem;
}
.chart-card h6 {
  font-weight: 600;
  color: #495057;
}

/* ---------- Badges ---------- */
.badge.bg-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-light)) !important;
  font-weight: 500;
  font-size: 0.75rem;
  border-radius: 0.4rem;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1rem;
  }
  .navbar .btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  .table {
    font-size: 0.85rem;
  }
  .table td, .table th {
    white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 1rem !important;
  }
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .btn {
    padding: 6px 10px;
  }
  .form-control, .form-select {
    font-size: 0.85rem;
  }
  .dashboard-card h3 {
    font-size: 1.4rem;
  }
}

/* ---------- Utilities ---------- */
.text-muted-small {
  color: #adb5bd;
  font-size: 0.85rem;
}
.shadow-sm-hover:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}
.rounded-12 {
  border-radius: 12px !important;
}
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  color: #fff;
}
a.text-primary:hover { text-decoration: underline; }
.modal-body p { margin-bottom: .5rem; }
