/* ========================================
   NudgePay Dashboard — CSS
   ======================================== */

:root {
  --navy: #1B2A4A;
  --navy-light: #243558;
  --navy-lighter: #2D4070;
  --navy-dark: #141F38;
  --amber: #E8913A;
  --amber-hover: #D47E2F;
  --amber-light: rgba(232, 145, 58, 0.12);
  --green: #34C77B;
  --green-bg: rgba(52, 199, 123, 0.1);
  --green-text: #27A566;
  --red: #E95454;
  --red-bg: rgba(233, 84, 84, 0.1);
  --orange: #F0963C;
  --orange-bg: rgba(240, 150, 60, 0.1);
  --yellow: #E8C547;
  --yellow-bg: rgba(232, 197, 71, 0.12);
  --bg: #F4F6F9;
  --card-bg: #FFFFFF;
  --border: #E4E8EF;
  --text-primary: #1B2A4A;
  --text-secondary: #6B7A94;
  --text-muted: #9AA5B8;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(27,42,74,0.06), 0 1px 2px rgba(27,42,74,0.04);
  --shadow: 0 4px 12px rgba(27,42,74,0.08), 0 1px 4px rgba(27,42,74,0.04);
  --shadow-lg: 0 12px 40px rgba(27,42,74,0.12), 0 4px 12px rgba(27,42,74,0.06);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--amber);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #FFFFFF;
  background: rgba(232, 145, 58, 0.15);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--amber);
  border-radius: 0 3px 3px 0;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--amber);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.upgrade-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--amber), #D47E2F);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(232, 145, 58, 0.3);
}

.upgrade-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232, 145, 58, 0.4);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ========================================
   MAIN WRAPPER
   ======================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ========================================
   TOPBAR
   ======================================== */
.topbar {
  height: var(--topbar-height);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  margin-right: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}

.topbar-icon-btn:hover {
  border-color: var(--navy-lighter);
  color: var(--navy);
  background: var(--bg);
}

.notification-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  position: absolute;
  top: 8px;
  right: 8px;
  border: 2px solid var(--card-bg);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}

/* ========================================
   CONTENT AREA
   ======================================== */
.content {
  flex: 1;
  padding: 28px 32px 40px;
  max-width: 1280px;
  width: 100%;
}

.view {
  animation: fadeIn 0.3s ease;
}

.view.hidden {
  display: none;
}

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

/* ========================================
   CARDS (shared)
   ======================================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.card-link {
  font-size: 0.85rem;
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.card-link:hover {
  color: var(--amber-hover);
}

/* ========================================
   DASHBOARD — STATS GRID
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrap.outstanding {
  background: var(--amber-light);
  color: var(--amber);
}

.stat-icon-wrap.collected {
  background: var(--green-bg);
  color: var(--green-text);
}

.stat-icon-wrap.reminders {
  background: rgba(106, 130, 251, 0.1);
  color: #6A82FB;
}

.stat-icon-wrap.rate {
  background: var(--green-bg);
  color: var(--green-text);
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.rate-value {
  color: var(--green-text);
}

.stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-sub.positive {
  color: var(--green-text);
  font-weight: 600;
}

/* ========================================
   DASHBOARD — TWO-COLUMN
   ======================================== */
.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Activity Feed */
.activity-card .card-header {
  padding-bottom: 16px;
}

.activity-feed {
  padding: 8px 0;
}

.activity-item {
  display: flex;
  gap: 16px;
  padding: 14px 24px;
  position: relative;
  transition: background var(--transition);
}

.activity-item:hover {
  background: var(--bg);
}

.activity-item.payment {
  background: var(--green-bg);
}

.activity-item.payment:hover {
  background: rgba(52, 199, 123, 0.14);
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.reminder-dot {
  background: #6A82FB;
}

.payment-dot {
  background: var(--green);
}

.import-dot {
  background: var(--amber);
}

.activity-content p {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.activity-content strong {
  font-weight: 600;
}

.activity-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
}

/* Attention Card */
.badge-count {
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.attention-list {
  padding: 8px 0;
}

.attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.attention-item:last-child {
  border-bottom: none;
}

.attention-item:hover {
  background: var(--bg);
}

.attention-client {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--navy);
}

.attention-amount {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.attention-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overdue-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.overdue-badge.red {
  background: var(--red-bg);
  color: var(--red);
}

.overdue-badge.orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.overdue-badge.yellow {
  background: var(--yellow-bg);
  color: #B89C20;
}

.overdue-badge.gray {
  background: #F0F2F5;
  color: var(--text-secondary);
}

.btn-escalate {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-escalate:hover {
  background: var(--red);
  color: #fff;
}

/* ========================================
   INVOICES VIEW
   ======================================== */
.invoices-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.filter-btn:hover {
  color: var(--navy);
  background: var(--bg);
}

.filter-btn.active {
  background: var(--navy);
  color: #fff;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 42px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  min-width: 240px;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--amber);
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  width: 100%;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.invoices-table-card {
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.invoices-table {
  width: 100%;
  border-collapse: collapse;
}

.invoices-table th {
  text-align: left;
  padding: 14px 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.invoices-table td {
  padding: 16px 20px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

.invoices-table tbody tr {
  transition: background var(--transition);
}

.invoices-table tbody tr:hover {
  background: var(--bg);
}

.inv-number {
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--navy);
}

.amount {
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

.reminders-count {
  color: var(--text-secondary);
  text-align: center;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.paid {
  background: var(--green-bg);
  color: var(--green-text);
}

.status-badge.overdue {
  background: var(--red-bg);
  color: var(--red);
}

.status-badge.due-soon {
  background: var(--yellow-bg);
  color: #B89C20;
}

.status-badge.pending {
  background: #F0F2F5;
  color: var(--text-secondary);
}

.btn-view {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.btn-view:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

/* ========================================
   REMINDERS VIEW
   ======================================== */
.reminder-schedule-card {
  margin-bottom: 24px;
}

.badge-active {
  background: var(--green-bg);
  color: var(--green-text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.reminder-timeline {
  padding: 32px 24px;
  position: relative;
}

.reminder-step {
  display: flex;
  gap: 20px;
  position: relative;
  margin-bottom: 24px;
}

.reminder-step:last-child {
  margin-bottom: 0;
}

.step-connector {
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: -24px;
  width: 2px;
  background: var(--border);
}

.reminder-step:last-child .step-connector {
  display: none;
}

.step-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.step-card {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.step-card:hover {
  border-color: var(--navy-lighter);
  box-shadow: var(--shadow-sm);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
}

.step-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.step-timing {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.step-channels {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.channel-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.channel-tag.email {
  background: rgba(106, 130, 251, 0.1);
  color: #6A82FB;
}

.channel-tag.sms {
  background: var(--amber-light);
  color: var(--amber);
}

.step-preview {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
  border-top: 0px solid var(--border);
}

.step-preview.open {
  max-height: 200px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.preview-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* Email Preview Card */
.email-preview-card .card-header {
  flex-wrap: wrap;
  gap: 8px;
}

.preview-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-light);
  padding: 4px 12px;
  border-radius: 20px;
}

.email-preview {
  padding: 24px;
}

.email-meta {
  padding: 16px 20px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.email-field {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.field-label {
  font-weight: 700;
  color: var(--navy);
  display: inline-block;
  width: 60px;
}

.email-body {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.email-content {
  padding: 32px 28px;
}

.email-greeting {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--navy);
}

.email-content p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.email-cta-wrap {
  text-align: center;
  padding: 12px 0 8px;
}

.email-cta-btn {
  display: inline-block;
  padding: 14px 36px;
  background: var(--amber);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.01em;
}

.email-sign {
  margin-top: 20px;
  font-size: 0.88rem !important;
  color: var(--text-secondary) !important;
}

.email-footer-line {
  height: 1px;
  background: var(--border);
  margin: 24px 0 16px;
}

.email-footer-text {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
  text-align: center;
}

/* ========================================
   INTEGRATIONS VIEW
   ======================================== */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.integration-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.integration-card:hover {
  box-shadow: var(--shadow);
}

.integration-card.coming-soon {
  opacity: 0.7;
}

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

.integration-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}

.stripe-logo { background: #635BFF; }
.qb-logo { background: #2CA01C; font-size: 0.85rem; }
.fb-logo { background: #00A3F5; font-size: 0.85rem; }
.xero-logo { background: #13B5EA; }

.integration-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

.connected-status {
  background: var(--green-bg);
  color: var(--green-text);
}

.not-connected-status {
  background: #F0F2F5;
  color: var(--text-secondary);
}

.coming-soon-status {
  background: var(--amber-light);
  color: var(--amber);
}

.integration-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.integration-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.integration-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--green-text);
  font-weight: 500;
  margin-bottom: 16px;
}

.btn-integration {
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'DM Sans', sans-serif;
  border: none;
}

.btn-integration.connect {
  background: var(--navy);
  color: #fff;
}

.btn-integration.connect:hover {
  background: var(--navy-lighter);
}

.btn-integration.disconnect {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-integration.disconnect:hover {
  border-color: var(--red);
  color: var(--red);
}

.btn-integration.request {
  background: var(--amber-light);
  color: var(--amber);
}

.btn-integration.request:hover {
  background: var(--amber);
  color: #fff;
}

/* ========================================
   SETTINGS VIEW
   ======================================== */
.settings-card {
  max-width: 720px;
}

.settings-form {
  padding: 24px;
}

.form-section {
  margin-bottom: 36px;
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: #FFFFFF;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--amber);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7A94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Toggles */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-label {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--navy);
  margin-bottom: 3px;
}

.toggle-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.solo-badge {
  display: inline-block;
  background: var(--amber-light);
  color: var(--amber);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CDD5E0;
  border-radius: 26px;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--amber);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.btn-save {
  padding: 12px 32px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-save:hover {
  background: var(--navy-lighter);
}

.save-message {
  font-size: 0.85rem;
  color: var(--green-text);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-message.visible {
  opacity: 1;
}

/* ========================================
   RESPONSIVE — Tablet
   ======================================== */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .integrations-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   RESPONSIVE — Mobile
   ======================================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .user-name {
    display: none;
  }

  .content {
    padding: 20px 16px 32px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .invoices-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    min-width: auto;
  }

  .filter-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .settings-card {
    max-width: 100%;
  }

  .integrations-grid {
    grid-template-columns: 1fr;
  }

  .email-content {
    padding: 20px 16px;
  }

  .reminder-timeline {
    padding: 24px 12px;
  }

  .step-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .attention-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .attention-actions {
    width: 100%;
  }
}

/* ========================================
   UTILITY / SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CDD5E0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #A0ABB8;
}
