/* ProjFin - Professional theme */
:root {
  --projfin-primary: #0d6efd;
  --projfin-primary-dark: #0a58ca;
  --projfin-sidebar-bg: #1e293b;
  --projfin-card-shadow: 0 1px 3px rgba(0,0,0,.08);
  --projfin-card-radius: 8px;
  --projfin-body-bg: #f8fafc;
}

body {
  background-color: var(--projfin-body-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #334155;
}

/* Navbar */
.navbar-projfin {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  padding: 0.5rem 0;
}

.navbar-projfin .navbar-brand {
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff !important;
  letter-spacing: 0.02em;
}

.navbar-projfin .nav-link {
  color: rgba(255,255,255,.9) !important;
  font-weight: 500;
  padding: 0.5rem 0.75rem !important;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.navbar-projfin .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,.12);
}

.navbar-projfin .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.18);
}

.navbar-projfin .btn-outline-danger {
  border-color: rgba(255,255,255,.4);
  color: #f87171;
}

.navbar-projfin .btn-outline-danger:hover {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

/* Cards */
.card-projfin {
  border: 1px solid #e2e8f0;
  border-radius: var(--projfin-card-radius);
  box-shadow: var(--projfin-card-shadow);
  background: #fff;
}

.card-projfin .card-title {
  font-weight: 600;
  color: #0f172a;
  font-size: 1.15rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

/* Buttons */
.btn-projfin-primary {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.45rem 1rem;
}

/* Forms */
.form-label {
  font-weight: 500;
  color: #475569;
  font-size: 0.875rem;
}

.form-control, .form-select {
  border-radius: 6px;
  border-color: #cbd5e1;
}

.form-control:focus, .form-select:focus {
  border-color: var(--projfin-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .15);
}

/* Tables */
.table-projfin {
  border-radius: var(--projfin-card-radius);
  overflow: hidden;
}

.table-projfin thead th {
  background: #f1f5f9 !important;
  font-weight: 600;
  color: #334155;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem;
  border-color: #e2e8f0;
}

.table-projfin tbody td {
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}

.table-projfin tfoot td {
  background: #f8fafc !important;
  font-weight: 600;
  border-top: 2px solid #e2e8f0;
}

/* Alerts */
.alert {
  border-radius: 6px;
  border: none;
}

/* Page container */
.page-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Login / minimal layout */
.login-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: #1e3a5f;
}

.login-card {
  border-radius: var(--projfin-card-radius);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
  border: 1px solid #e2e8f0;
}

/* Home quick actions */
.quick-action-card {
  transition: transform .15s, box-shadow .15s;
  border-radius: var(--projfin-card-radius);
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 1.25rem;
  background: #fff;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  color: inherit;
}

.quick-action-card .icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* Section dividers */
.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.75rem;
}

/* Purchase bill toolbar */
.toolbar-actions {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toolbar-actions .btn {
  border-radius: 6px;
  font-weight: 500;
}

/* Icon-only buttons (e.g. Edit / Delete in grid) */
.btn-icon {
  padding: 0.35rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.btn-icon svg {
  display: block;
}

/* Full-screen loading overlay for long-running queries */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--projfin-primary);
  border-radius: 50%;
  animation: loading-spin 0.9s linear infinite;
}

.loading-overlay .loading-text {
  font-weight: 500;
  color: #475569;
  font-size: 1rem;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}
