/* ── Financial Report — scoped under .app-financial ─────────────────────── */
/*
  All selectors are prefixed with .app-financial so they apply only inside
  the Financial Report window and don't leak into the OS shell chrome.
*/

.app-financial {
  font-family: "Google Sans", system-ui, sans-serif;
  color: #1f2937;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Navigation */
.app-financial .nav {
  background: #1a56db;
  color: white;
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.app-financial .nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  margin-right: 1rem;
}
.app-financial .nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}
.app-financial .nav-link:hover,
.app-financial .nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

/* Layout */
.app-financial .container {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  overflow-y: auto;
  flex: 1;
}
.app-financial .card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.app-financial .card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

/* Forms */
.app-financial .form-group { margin-bottom: 1rem; }
.app-financial .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: #374151;
}
.app-financial .form-input,
.app-financial .form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
}
.app-financial .form-input:focus,
.app-financial .form-select:focus {
  outline: none;
  border-color: #1a56db;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.2);
}

/* Buttons */
.app-financial .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.app-financial .btn-primary { background: #1a56db; color: white; }
.app-financial .btn-primary:hover { background: #1e40af; }
.app-financial .btn-secondary { background: white; color: #374151; border-color: #d1d5db; }
.app-financial .btn-secondary:hover { background: #f9fafb; }
.app-financial .btn-danger { background: #dc2626; color: white; }
.app-financial .btn-danger:hover { background: #b91c1c; }
.app-financial .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.app-financial .btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Table */
.app-financial .table-wrap { overflow-x: auto; }
.app-financial table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.app-financial th,
.app-financial td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
.app-financial th { background: #f9fafb; font-weight: 600; color: #374151; }
.app-financial .text-right { text-align: right; }
.app-financial .text-center { text-align: center; }
.app-financial .font-bold { font-weight: 700; }
.app-financial .text-green { color: #059669; }
.app-financial .text-red { color: #dc2626; }

/* Journal lines sub-table */
.app-financial .lines-row td {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  border-bottom: 1px solid #f3f4f6;
}

/* Settings */
.app-financial .setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
}
.app-financial .setting-item:last-child { border-bottom: none; }
.app-financial .setting-label { font-weight: 500; }
.app-financial .setting-desc { font-size: 0.8rem; color: #6b7280; }

/* Totals row */
.app-financial .total-row td,
.app-financial .total-row th {
  border-top: 2px solid #374151;
  font-weight: 700;
}

/* Alert */
.app-financial .alert {
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.app-financial .alert-success { background: #d1fae5; color: #065f46; }
.app-financial .alert-error { background: #fee2e2; color: #991b1b; }
.app-financial .alert-info { background: #dbeafe; color: #1e40af; }

/* Entry card */
.app-financial .entry-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.app-financial .entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.app-financial .entry-date { font-size: 0.8rem; color: #6b7280; }
.app-financial .entry-desc { font-weight: 500; }

/* Account management */
.app-financial .account-type-section {
  margin-bottom: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  overflow: hidden;
}
.app-financial .account-type-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}
.app-financial .account-type-header-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.app-financial .account-row {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  gap: 0.25rem;
}
.app-financial .account-row:last-child { border-bottom: none; }
.app-financial .account-row-code { font-size: 0.8rem; color: #6b7280; min-width: 5rem; }
.app-financial .account-row-sep { color: #9ca3af; }
.app-financial .account-row-name { flex: 1; font-size: 0.9rem; }
.app-financial .account-row-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.app-financial .account-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  align-items: center;
}
.app-financial .account-inline-form .form-input,
.app-financial .account-inline-form .form-select {
  flex: 1;
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #fff;
}
.app-financial .account-type-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  gap: 0.5rem;
}
.app-financial .account-type-row:last-child { border-bottom: none; }
.app-financial .account-type-row-name { font-weight: 500; font-size: 0.9rem; }
.app-financial .account-type-row-role { font-size: 0.8rem; color: #6b7280; }
.app-financial .account-type-row-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}
.app-financial .account-type-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  align-items: center;
}
.app-financial .account-type-inline-form .form-input,
.app-financial .account-type-inline-form .form-select {
  flex: 1;
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #fff;
}
.app-financial .account-type-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e5e7eb;
  align-items: center;
  margin-top: 0.5rem;
}
.app-financial .account-type-add-form .form-input,
.app-financial .account-type-add-form .form-select {
  flex: 1;
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #fff;
}
.app-financial .account-type-add-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  width: 100%;
  margin-bottom: 0.25rem;
}
.app-financial .btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.2rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.app-financial .btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.app-financial .btn-danger:hover { background: #fecaca; }

/* Responsive */
@media (max-width: 640px) {
  .app-financial .nav { padding: 0.5rem; }
  .app-financial .container { padding: 0 0.5rem; margin: 1rem auto; }
  .app-financial .card { padding: 1rem; }
}
