/* assets/css/style.css - Diyora Mandal Modern Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Gujarati:wght@400;500;600;700&display=swap');

:root {
  --primary: #0f172a;          /* Slate Navy */
  --primary-light: #1e293b;
  --accent: #2563eb;           /* Royal Blue */
  --accent-light: #3b82f6;
  --emerald: #059669;          /* Jama / Savings Green */
  --emerald-light: #10b981;
  --emerald-bg: #ecfdf5;
  --rose: #e11d48;             /* Upad / Loan Coral */
  --rose-light: #f43f5e;
  --rose-bg: #fff1f2;
  --amber: #d97706;            /* Interest / Warning Amber */
  --amber-light: #f59e0b;
  --amber-bg: #fffbeb;
  --gold: #b45309;             /* Mataji Fund Gold */
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,0.08), 0 2px 6px -1px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15,23,42,0.12), 0 4px 12px -2px rgba(15,23,42,0.06);
  --shadow-glow: 0 0 24px rgba(37,99,235,0.18);
  --font-main: 'Outfit', 'Noto Sans Gujarati', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 84px; /* Space for mobile bottom bar */
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 30px;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

/* App Header / Top Navigation */
.app-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Desktop Nav Links */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-quick-add {
  background: var(--emerald-light);
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-quick-add:hover {
  background: var(--emerald);
  transform: translateY(-1px);
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}

.mobile-nav-item i {
  font-size: 1.25rem;
}

.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-item.center-action {
  position: relative;
  top: -12px;
}

.center-action-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
  border: 3px solid #ffffff;
}

/* Main Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem 1.5rem;
  }
}

/* Section Title & Action Headers */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card.hero-silak {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  grid-column: span 2;
}

@media (min-width: 1200px) {
  .metric-card.hero-silak {
    grid-column: span 1;
  }
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.hero-silak .metric-label {
  color: #94a3b8;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.icon-blue { background: #dbeafe; color: #1d4ed8; }
.icon-emerald { background: #d1fae5; color: #047857; }
.icon-rose { background: #ffe4e6; color: #be123c; }
.icon-amber { background: #fef3c7; color: #b45309; }
.icon-gold { background: #fef3c7; color: #b45309; }
.icon-slate { background: rgba(255,255,255,0.15); color: #fff; }

.metric-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.hero-silak .metric-value {
  color: #ffffff;
  font-size: 1.7rem;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-silak .metric-sub {
  color: #cbd5e1;
}

/* Card Wrapper */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #ffffff;
}

@media (min-width: 640px) {
  .card-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
}

.card-body.no-padding {
  padding: 0;
}

/* Tables (Desktop) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

.data-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Month Tabs / Pills */
.tabs-scroll-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.4rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-pill {
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s;
}

.tab-pill:hover {
  background: #e2e8f0;
  color: var(--primary);
}

.tab-pill.active {
  background: var(--amber);
  color: #ffffff;
  border-color: var(--amber);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

.tab-pill .pill-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.72rem;
}

.tab-pill.active .pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #ffe4e6; color: #9f1239; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }

.btn-success { background: var(--emerald); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { background: #be123c; }

.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:hover { background: #b45309; }

.btn-outline {
  background: #ffffff;
  border-color: var(--card-border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Quick Action Grid on Mobile */
.action-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .action-tiles-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.action-tile {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.action-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.tile-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.tile-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--card-border);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Forms */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.92rem;
  font-family: inherit;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Mobile Member Cards */
.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .mobile-card-list {
    display: none;
  }
}

@media (max-width: 767px) {
  .desktop-table-view {
    display: none;
  }
}

.member-item-card {
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
}

.member-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.member-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.member-accounts-tag {
  background: #f1f5f9;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.member-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--card-border);
  font-size: 0.86rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.25s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* WhatsApp Share Button */
.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  border: none;
}
.btn-whatsapp:hover {
  background: #128C7E;
  color: #ffffff;
}
