/* === APP SHARED === */
.app-body {
  padding-top: 80px;
  min-height: 100vh;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* === HEADER === */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.app-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--fg);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-ghost {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg);
}

.btn-danger {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #FF6B6B;
}

/* === FORM === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* === TABLE === */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.invoice-table td {
  padding: 1rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.9rem;
  vertical-align: middle;
}

.invoice-table tr:hover td {
  background: var(--bg-card-hover);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
}

.status-pending { background: var(--accent-dim); color: var(--accent); }
.status-paid { background: rgba(62, 207, 142, 0.15); color: var(--success); }
.status-overdue { background: rgba(255, 107, 107, 0.15); color: #FF6B6B; }
.status-awaiting_approval { background: rgba(130, 120, 255, 0.15); color: #9D7AFF; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--fg-muted);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

/* === CARD === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* === DEMAND LETTER === */
.demand-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 12px;
  padding: 2rem;
}

.demand-box h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.demand-body {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 1.5rem 0;
}

/* === MODAL BACKDROP === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: 90%;
  max-width: 480px;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 0.875rem 1.25rem;
  color: var(--fg);
  font-size: 0.875rem;
  z-index: 300;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === AMOUNT === */
.amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* === ROW ACTIONS === */
.row-actions {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .app-container { padding: 1rem; }
  .invoice-table { font-size: 0.82rem; }
  .invoice-table td, .invoice-table th { padding: 0.5rem; }
}

/* === AUTH === */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--fg);
  margin: 0 0 0.4rem;
}

.auth-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
}

.auth-footer-text {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.auth-footer-text a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

.form-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #FF6B6B;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* === ACCOUNT SECTIONS === */
.account-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.account-section h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.account-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.account-field:last-of-type {
  border-bottom: none;
}

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

.account-field-value {
  font-size: 0.9rem;
  color: var(--fg);
}

.account-edit-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}

.account-edit-btn:hover {
  background: var(--accent-dim);
}

/* === DELETE ACCOUNT === */
.delete-section {
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.delete-section h2 {
  color: #FF6B6B;
}

.delete-warning {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}