/* ------------------------------------------------------------
   PayTrak Shared Stylesheet
   Used by Login, Signup, Dashboard, Clients, and Invoices.
------------------------------------------------------------ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(#eef9f3, #d9f0e3);
  color: #1f2933;
}

a {
  color: #1c7a4b;
}

/* ------------------------------------------------------------
   Standalone Card Pages (Login / Signup)
------------------------------------------------------------ */

.standalone-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.standalone-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.14);
}

.standalone-card h1 {
  margin: 0 0 6px 0;
  color: #15603c;
  font-size: 26px;
}

.standalone-card .subtitle {
  margin: 0 0 24px 0;
  color: #52616f;
  font-size: 14px;
}

.standalone-card .form-footer {
  margin-top: 18px;
  font-size: 14px;
  color: #52616f;
  text-align: center;
}

/* ------------------------------------------------------------
   Forms
------------------------------------------------------------ */

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: bold;
  color: #334155;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5c0;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.form-field textarea {
  min-height: 70px;
  resize: vertical;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(#2fa66b, #1c7a4b);
  color: #ffffff;
  width: 100%;
}

.btn-primary:hover {
  background: linear-gradient(#36b878, #1f8a54);
}

.btn-secondary {
  background: #eef3ee;
  color: #1f2933;
}

.btn-secondary:hover {
  background: #dde8dd;
}

.btn-danger {
  background: #fdecec;
  color: #b42318;
}

.btn-danger:hover {
  background: #fad6d4;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.form-error {
  background: #fdecec;
  color: #b42318;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ------------------------------------------------------------
   App Shell
------------------------------------------------------------ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #15603c;
  color: #ffffff;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 24px 24px 24px;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.nav-link {
  padding: 12px 24px;
  color: #d7f0e2;
  text-decoration: none;
  font-size: 15px;
}

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

.logout-button {
  margin: 12px 24px 0 24px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

.logout-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.main-area {
  flex-grow: 1;
  padding: 32px;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.top-header h1 {
  margin: 0 0 4px 0;
  color: #15603c;
}

.business-name {
  color: #52616f;
  font-size: 14px;
}

/* ------------------------------------------------------------
   Cards / Tables
------------------------------------------------------------ */

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
  color: #1f2933;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #e2e8e0;
  color: #52616f;
  font-size: 13px;
  text-transform: uppercase;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2ec;
  vertical-align: middle;
}

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

.empty-state {
  color: #8a97a3;
  text-align: center;
  padding: 24px;
}

/* ------------------------------------------------------------
   Status Badges
------------------------------------------------------------ */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.badge-sent {
  background: #e8f1fb;
  color: #1f5f8b;
}

.badge-paid {
  background: #e7f6ec;
  color: #1c7a4b;
}

.badge-overdue {
  background: #fdecec;
  color: #b42318;
}

/* ------------------------------------------------------------
   Dashboard Stat Tiles
------------------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-tile {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.stat-tile .stat-label {
  font-size: 13px;
  color: #52616f;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-tile .stat-value {
  font-size: 26px;
  font-weight: bold;
  color: #15603c;
}

.stat-tile.stat-highlight .stat-value {
  color: #1c7a4b;
}

.stat-tile.stat-warning .stat-value {
  color: #b45309;
}

.stat-tile.stat-danger .stat-value {
  color: #b42318;
}

/* ------------------------------------------------------------
   Modal
------------------------------------------------------------ */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 35, 25, 0.5);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.32);
}

.modal-card h2 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
