/* ===================================================
   Lawn Patrol Turf Enforcement – Main Stylesheet
   =================================================== */

/* ---- Reset & Variables ---- */
:root {
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-light: #dcfce7;
  --red: #ef4444;
  --red-light: #fee2e2;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --yellow: #eab308;
  --yellow-light: #fef9c3;
  --blue: #3b82f6;
  --blue-light: #dbeafe;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --bg: #f0fdf4;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --header-h: 70px;
  --mobile-nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --transition: all .2s ease;
}

[data-theme="dark"] {
  --bg: #0f1a12;
  --surface: #1a2e1d;
  --surface2: #162419;
  --border: #2d4a33;
  --text: #e2f0e5;
  --text-muted: #88b090;
  --green-light: #1a3d23;
  --red-light: #3d1a1a;
  --orange-light: #3d2a14;
  --yellow-light: #3d370e;
  --blue-light: #1a2b3d;
  --purple-light: #2a1d3d;
}
[data-theme="dark"] .badge.paypal  { background: #0a2a40; color: #5ab3f0; }
[data-theme="dark"] .badge.cashapp { background: #0a2d18; color: #00d632; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}

/* ---- Header ---- */
#main-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1.5rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--green-dark);
  white-space: nowrap;
}
.header-brand i { color: var(--green); font-size: 1.3rem; }
.header-brand strong { font-weight: 800; }
.header-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  flex-shrink: 0;
}

#desktop-nav {
  display: flex;
  gap: .25rem;
  flex: 1;
}

.nav-btn {
  background: none;
  border: none;
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-btn:hover { background: var(--green-light); color: var(--green-dark); }
.nav-btn.active { background: var(--green); color: #fff; }

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}
#theme-toggle:hover { background: var(--green-light); color: var(--green-dark); }

/* ---- Main Content ---- */
#app-main {
  margin-top: var(--header-h);
  padding: 1.5rem 1.25rem 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: calc(var(--mobile-nav-h) + 1rem);
}

/* ---- Tab Sections ---- */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ---- Section Header ---- */
.section-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.section-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  flex: 1;
  min-width: 150px;
}
.section-date { color: var(--text-muted); font-size: .9rem; margin-top: .4rem; }
.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ---- Stat Grid ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-grid.small {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.stat-card .stat-icon {
  font-size: 1.4rem;
  margin-bottom: .2rem;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-card.green { border-left: 4px solid var(--green); }
.stat-card.green .stat-value { color: var(--green-dark); }
.stat-card.red { border-left: 4px solid var(--red); }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.orange { border-left: 4px solid var(--orange); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.blue { border-left: 4px solid var(--blue); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.purple { border-left: 4px solid var(--purple); }
.stat-card.purple .stat-value { color: var(--purple); }

/* ---- Dashboard Grid ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.dash-card h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
}
.dash-card h2 i { color: var(--green); }
.dash-card.full-width { margin-top: 1rem; }

/* ---- Alert Items ---- */
.alert-item {
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  transition: var(--transition);
}
.alert-item:hover { filter: brightness(.96); }
.alert-item.red { background: var(--red-light); color: #9b1c1c; border-left: 3px solid var(--red); }
.alert-item.orange { background: var(--orange-light); color: #9a3412; border-left: 3px solid var(--orange); }
.alert-item.yellow { background: var(--yellow-light); color: #854d0e; border-left: 3px solid var(--yellow); }
.alert-item.blue { background: var(--blue-light); color: #1e3a8a; border-left: 3px solid var(--blue); }

/* ---- Card List ---- */
.card-list { display: flex; flex-direction: column; gap: .75rem; }

/* ---- Customer Card ---- */
.customer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}
.customer-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.customer-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customer-info { flex: 1; min-width: 0; }
.customer-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .15rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.customer-address { font-size: .82rem; color: var(--text-muted); margin-bottom: .3rem; }
.customer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .8rem;
}
.meta-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: .2rem .55rem;
  border-radius: 20px;
  display: flex; align-items: center; gap: .3rem;
  color: var(--text-muted);
}
.meta-chip i { font-size: .75rem; }
.card-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* ---- Schedule Card ---- */
.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.schedule-card:hover { box-shadow: var(--shadow-lg); }
.schedule-date-box {
  text-align: center;
  min-width: 54px;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
}
.schedule-date-box .day { font-size: 1.5rem; line-height: 1; }
.schedule-date-box .month { font-size: .7rem; text-transform: uppercase; }
.schedule-info { flex: 1; min-width: 0; }
.schedule-name { font-weight: 700; margin-bottom: .25rem; }
.schedule-addr { font-size: .82rem; color: var(--text-muted); }

/* ---- Payment Row ---- */
.payment-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.payment-customer { font-weight: 700; flex: 1; min-width: 120px; }
.payment-date { font-size: .82rem; color: var(--text-muted); }
.payment-amount { font-size: 1.1rem; font-weight: 700; }

/* ---- Badges / Status ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .6rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.overdue { background: var(--red-light); color: #b91c1c; }
.badge.today { background: var(--orange-light); color: #c2410c; }
.badge.tomorrow { background: var(--yellow-light); color: #92400e; }
.badge.thisweek { background: var(--blue-light); color: #1d4ed8; }
.badge.upcoming { background: var(--green-light); color: var(--green-dark); }
.badge.paid { background: var(--green-light); color: var(--green-dark); }
.badge.unpaid { background: var(--red-light); color: #b91c1c; }
.badge.check   { background: var(--purple-light); color: #6d28d9; }
.badge.cash    { background: var(--green-light);  color: var(--green-dark); }
.badge.venmo   { background: var(--blue-light);   color: #1d4ed8; }
.badge.paypal  { background: #e8f3fb; color: #0070ba; }
.badge.cashapp { background: #d4f8e0; color: #00693e; }
.badge.sms { background: var(--blue-light); color: #1d4ed8; }
.badge.inactive { background: var(--red-light); color: #b91c1c; }
.badge.notes { background: var(--yellow-light); color: #92400e; cursor: pointer; }
.badge.notes:hover { filter: brightness(.95); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--green); color: var(--green-dark); }
.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--green-light); color: var(--green-dark); }
.btn-sm { padding: .35rem .7rem; font-size: .78rem; }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ---- Filter Pills ---- */
.filter-pills { display: flex; gap: .35rem; flex-wrap: wrap; }
.pill {
  padding: .35rem .85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.pill:hover { border-color: var(--green); color: var(--green-dark); }
.pill.active { background: var(--green); color: #fff; border-color: var(--green); }

/* ---- Search ---- */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap i {
  position: absolute;
  left: .75rem;
  color: var(--text-muted);
  pointer-events: none;
}
.search-wrap input {
  padding: .55rem .75rem .55rem 2.2rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  width: 220px;
  transition: var(--transition);
}
.search-wrap input:focus { outline: none; border-color: var(--green); }

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-box.wide-modal { max-width: 780px; }
.modal-box.small-modal { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: .3rem;
  border-radius: 50%;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--red-light); color: var(--red); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ---- Form ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.readonly-input { background: var(--surface2) !important; cursor: default; }

.select-input {
  padding: .5rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
}
.select-input:focus { outline: none; border-color: var(--green); }

/* ---- Toggle ---- */
.toggle-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: .75rem;
  cursor: pointer;
  font-size: .9rem !important;
  font-weight: 500 !important;
  color: var(--text) !important;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-label input:checked + .toggle-switch { background: var(--green); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(20px); }

/* ---- Notes Display ---- */
.notes-display {
  padding: 1.5rem;
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}

/* ---- Mobile Nav ---- */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
}
#mobile-nav::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.mob-nav-btn {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 500;
  padding: .4rem .25rem;
  transition: var(--transition);
  height: 100%;
  white-space: nowrap;
}
.mob-nav-btn span {
  white-space: nowrap;
}
.mob-nav-btn i { font-size: 1rem; }
.mob-nav-btn.active { color: var(--green-dark); }
.mob-nav-btn.active i {
  background: var(--green-light);
  padding: .25rem .55rem;
  border-radius: 20px;
  color: var(--green-dark);
}

/* ---- Business Banner ---- */
.business-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #0a1a0c 0%, #1a3d1e 50%, #0f2d12 100%);
  border: 2px solid #4a9e50;
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  flex-wrap: wrap;
}
.banner-logo {
  height: 90px;
  width: 90px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}
.banner-info {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.banner-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f5c842;
  text-shadow: 1px 2px 4px rgba(0,0,0,.6);
  letter-spacing: .02em;
}
.banner-owner {
  font-size: .9rem;
  font-weight: 600;
  color: #ffffff;
  display: flex; align-items: center; gap: .4rem;
}
.banner-phone {
  font-size: 1rem;
  font-weight: 700;
  color: #f5c842;
  display: flex; align-items: center; gap: .4rem;
}
.banner-slogan {
  font-size: .82rem;
  color: #a8d5a0;
  font-style: italic;
  margin-top: .15rem;
}
@media (max-width: 480px) {
  .banner-logo { height: 68px; width: 68px; }
  .banner-name { font-size: 1.05rem; }
}

/* ---- Info Banner ---- */
.info-banner {
  background: var(--blue-light);
  border: 1px solid #93c5fd;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  font-size: .88rem;
  margin-bottom: 1rem;
  color: #1e40af;
}
.info-banner i { font-size: 1.1rem; margin-top: .1rem; flex-shrink: 0; }

/* ---- Reminders ---- */
.reminder-settings {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: .9rem;
}
.reminder-settings label { display: flex; align-items: center; gap: .5rem; }
.reminder-settings select { padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }

/* Recipient Numbers */
.recipient-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.recipient-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.recipient-row.primary { border-left: 4px solid var(--green); }
.recipient-label { font-weight: 700; font-size: .92rem; flex: 1; min-width: 100px; }
.recipient-phone { font-size: .88rem; color: var(--text-muted); display: flex; align-items: center; gap: .35rem; }
.add-recipient-row {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: .25rem;
}
.add-recipient-row input {
  padding: .55rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  flex: 1;
  min-width: 130px;
  transition: var(--transition);
}
.add-recipient-row input:focus { outline: none; border-color: var(--green); }

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .5rem;
  flex-wrap: wrap;
  background: var(--surface);
  transition: var(--transition);
}
.reminder-item:hover { border-color: var(--green); box-shadow: var(--shadow); }
.reminder-info { flex: 1; min-width: 150px; }
.reminder-name { font-weight: 700; font-size: .95rem; margin-bottom: .15rem; }
.reminder-date { font-size: .82rem; color: var(--text-muted); }
.reminder-notes { font-size: .78rem; color: var(--orange); margin-top: .2rem; }
.reminder-send-btns { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

.bulk-reminder { display: flex; gap: .75rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.bulk-reminder textarea {
  flex: 1;
  min-width: 200px;
  padding: .6rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
}
.bulk-reminder textarea:focus { outline: none; border-color: var(--green); }

.sms-link-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  flex-wrap: wrap;
}
.sms-link-name { font-weight: 600; flex: 1; min-width: 120px; }

/* ---- Report Table ---- */
.report-table-wrap { margin-top: 1rem; overflow-x: auto; }
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.report-table th {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: .65rem .85rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.report-table td {
  border: 1px solid var(--border);
  padding: .65rem .85rem;
  color: var(--text);
  vertical-align: middle;
}
.report-table tr:hover td { background: var(--surface2); }
.report-table tfoot td {
  font-weight: 700;
  background: var(--green-light);
  color: var(--green-dark);
}

/* ---- Recent Cuts (mini rows) ---- */
.recent-cut-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.recent-cut-row:last-child { border-bottom: none; }
.recent-name { flex: 1; font-weight: 600; }
.recent-date { color: var(--text-muted); font-size: .8rem; }
.recent-amount { font-weight: 700; }

/* ---- History Table ---- */
.history-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.history-table th {
  padding: .6rem .85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  font-size: .78rem;
  text-transform: uppercase;
}
.history-table td {
  padding: .6rem .85rem;
  border: 1px solid var(--border);
}
.history-table tr:hover td { background: var(--surface2); }

/* ---- Invoice ---- */
#invoice-content {
  padding: 2rem;
  font-size: .92rem;
  line-height: 1.6;
}
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.invoice-brand { font-size: 1.2rem; font-weight: 800; color: var(--green-dark); display:flex; flex-direction:column; gap:.15rem; }
.invoice-brand span { display: block; font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.invoice-meta { text-align: right; }
.invoice-meta .inv-number { font-size: 1.1rem; font-weight: 700; }
.invoice-section { margin-bottom: 1.5rem; }
.invoice-section h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .5rem; }
.invoice-to { font-weight: 600; }
.invoice-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.invoice-table th {
  background: var(--green);
  color: #fff;
  padding: .6rem .85rem;
  text-align: left;
  font-size: .82rem;
}
.invoice-table td { padding: .6rem .85rem; border-bottom: 1px solid var(--border); }
.invoice-total { text-align: right; font-size: 1.1rem; }
.invoice-total .total-row { display: flex; justify-content: flex-end; gap: 1.5rem; padding: .4rem 0; }
.invoice-total .grand-total { font-size: 1.3rem; font-weight: 800; color: var(--green-dark); border-top: 2px solid var(--green); padding-top: .5rem; }
.invoice-footer { text-align: center; font-size: .8rem; color: var(--text-muted); margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: .75rem 1.5rem;
  border-radius: 20px;
  font-size: .88rem;
  font-weight: 500;
  z-index: 900;
  box-shadow: var(--shadow-lg);
  animation: fadeIn .3s ease;
  white-space: nowrap;
}
.toast.hidden { display: none; }
.toast.success { background: var(--green-dark); }
.toast.error { background: var(--red); }

@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; color: var(--border); }
.empty-state p { font-size: 1rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  #desktop-nav { display: none; }
  #mobile-nav { display: flex; }
  #app-main { padding: 1rem .9rem calc(var(--mobile-nav-h) + 1.5rem); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .customer-card { flex-wrap: wrap; }
  .card-actions { width: 100%; justify-content: flex-end; }
  .header-actions { width: 100%; }
  .search-wrap input { width: 100%; }
  .section-header { flex-direction: column; }
  .modal-box { max-height: 85vh; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .schedule-card { flex-wrap: wrap; }
  .payment-row { flex-direction: column; align-items: flex-start; }
}

/* ---- Print Styles ---- */
@media print {
  #main-header, #mobile-nav, .modal-header.no-print { display: none !important; }
  .modal-overlay { position: static !important; background: none !important; padding: 0 !important; }
  .modal-box { box-shadow: none !important; max-height: none !important; max-width: 100% !important; }
  body { background: white !important; }
  #invoice-content { padding: 1rem !important; }
}
