﻿/* =====================================================
 * Student Savings System - Styles
 * ===================================================== */

* { font-family: 'Prompt', sans-serif; }
body { -webkit-font-smoothing: antialiased; }

/* ============ FORM CONTROLS ============ */
.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background: white;
  outline: none;
}
.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ============ BUTTONS ============ */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.btn-primary:hover { background: linear-gradient(135deg, #1d4ed8, #1e40af); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
.btn-secondary {
  background: white;
  color: #374151;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-success { background: linear-gradient(135deg, #059669, #047857); color: white; font-weight: 500; font-size: 0.875rem; padding: 0.5rem 1rem; border-radius: 0.75rem; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }
.btn-success:hover { transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; font-weight: 500; font-size: 0.875rem; padding: 0.5rem 1rem; border-radius: 0.75rem; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.75rem; border-radius: 0.5rem; }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; font-weight: 500; font-size: 0.875rem; padding: 0.5rem 1rem; border-radius: 0.75rem; border: none; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; }

/* ============ CARDS ============ */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f3f4f6;
  overflow: hidden;
}
.card-header {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.card-body { padding: 1rem; }
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #f3f4f6;
  transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ============ SIDEBAR ============ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 2px;
}
.nav-item:hover { background: #eff6ff; color: #2563eb; }
.nav-item.active { background: #2563eb; color: white; font-weight: 500; }
.nav-item.active i { color: white; }
.nav-divider { height: 1px; background: #e5e7eb; margin: 0.5rem 0; }

/* ============ TABLE ============ */
.desktop-table { display: table; width: 100%; }
.desktop-table th {
  background: #f8fafc;
  padding: 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.desktop-table td {
  padding: 0.625rem 0.75rem;
  font-size: 0.8125rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.desktop-table tr:hover td { background: #f8fafc; }
.mobile-cards { display: none; }

@media (max-width: 768px) {
  .desktop-table { display: none; }
  .mobile-cards { display: block; }
  .mobile-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border: 1px solid #f1f5f9;
  }
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
  }
  .mobile-card-label { color: #64748b; }
  .mobile-card-value { font-weight: 500; color: #1e293b; }
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red { background: #fecaca; color: #b91c1c; }
.badge-gray { background: #f3f4f6; color: #4b5563; }

/* ============ PAGINATION ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1rem;
}
.page-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  transition: all 0.15s;
}
.page-btn:hover { background: #f3f4f6; }
.page-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ SAVINGS GRID ============ */
.savings-grid-input {
  width: 50px;
  padding: 4px;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.15s;
}
.savings-grid-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
  outline: none;
}
.savings-grid-input.has-value { background: #dbeafe; border-color: #93c5fd; font-weight: 600; }

/* ============ PRINT ============ */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; top: 0; left: 0; width: 100%; }
}

/* ============ LOADING ============ */
.spinner {
  border: 3px solid #e5e7eb;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============ MISC ============ */
.text-money { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.5px; }
.overflow-x-scroll { -webkit-overflow-scrolling: touch; }
.savings-table-wrapper { overflow-x: auto; max-width: 100%; }
