:root {
  --bg: #050509;
  --bg-alt: #101018;
  --tile: #181825;
  --tile-hover: #232338;
  --text: #f5f5f5;
  --text-inverse: #ffffff;
  --muted: #a1a1b5;
  --accent: #4f8cff;
  --accent-dark: #7c5cff;
  --danger: #ff4f6a;
  --success: #3dd68c;
  --border: #2b2b3a;
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-light: rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-alt: #ffffff;
  --tile: #ffffff;
  --tile-hover: #f0f1f3;
  --text: #1a1a1a;
  --text-inverse: #ffffff;
  --muted: #6b7280;
  --accent: #3b82f6;
  --accent-dark: #6366f1;
  --danger: #dc2626;
  --success: #059669;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.05);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

#app-root {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* AUTH */

#auth-container,
#app-container {
  width: 100%;
}

.auth-card {
  max-width: 420px;
  margin: 40px auto;
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 24px 20px 28px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px var(--shadow);
}

.app-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}

.auth-logo .logo-img {
  width: 140px;
  height: auto;
  border-radius: 12px;
}

.app-subtitle {
  margin: 4px 0 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-toggle {
  display: flex;
  background: var(--bg);
  padding: 3px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--tile);
  color: var(--text);
}

.auth-form label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.auth-form input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
}

.btn-primary {
  width: 100%;
  padding: 10px 0;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--text-inverse);
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
  cursor: pointer;
}

.btn-outline,
.btn-outline-sm {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

.btn-outline-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-sm {
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--text-inverse);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}

.small-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}

.small-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-footer .small-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

.error-text {
  color: var(--danger);
  font-size: 12px;
  min-height: 16px;
}

.success-text {
  color: var(--success);
  font-size: 12px;
  min-height: 16px;
}

/* MAIN APP */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.online-status {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.online-status .online-text {
  display: none;
}

.online-status.online {
  background: rgba(76, 175, 80, 0.15);
  color: #4CAF50;
}

.online-status.offline {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.online-status.syncing {
  background: rgba(255, 152, 0, 0.15);
  color: #FF9800;
}

.language-select {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.language-select:hover {
  border-color: var(--accent);
  background: var(--tile);
}

.language-select:focus {
  outline: none;
  border-color: var(--accent);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.notification-container {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #F44336;
  color: white;
  font-size: 10px;
  font-weight: bold;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 320px;
  max-height: 400px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

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

.notification-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  text-decoration: underline;
}

.notification-list {
  max-height: 340px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.notification-item:hover {
  background: var(--tile);
}

.notification-item.unread {
  background: rgba(99, 102, 241, 0.08);
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

.notification-icon.success {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
}

.notification-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.notification-icon.promo {
  background: rgba(168, 85, 247, 0.15);
  color: #A855F7;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}

.notification-message {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

#screen-container {
  padding: 10px 10px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}

.screen-header h2 {
  margin: 0;
  font-size: 18px;
}

.btn-back {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.btn-voice-mic {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #5856d6 100%);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-voice-mic:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(88, 86, 214, 0.4);
}

.btn-voice-mic:active {
  transform: scale(0.95);
}

/* TILES */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.tile {
  background: var(--tile);
  border-radius: 14px;
  padding: 16px 14px 18px;
  border: 1px solid var(--border);
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  min-height: 95px;
}

.tile-full {
  grid-column: 1 / -1;
}

.tile:hover {
  background: var(--tile-hover);
}

.tile-icon {
  font-size: 24px;
  margin-top: 2px;
  color: var(--accent);
}

.tile-text h2,
.tile-text h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.tile-text p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* TALK TO WORK - Voice Command Button */
.command-mic-container {
  position: relative;
  margin-bottom: 16px;
}

.command-mic-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.talk-to-work-btn {
  min-height: 100px;
  padding: 24px 28px;
}

.talk-to-work-btn .command-mic-icon {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.talk-to-work-btn .command-mic-text h3 {
  font-size: 22px;
}

.talk-to-work-btn .command-mic-text p {
  font-size: 14px;
}

.command-mic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(102, 126, 234, 0.5);
}

.command-mic-btn:active {
  transform: scale(0.98);
}

.command-mic-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: white;
}

.command-mic-text h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.command-mic-text p {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

/* Recording Overlay */
.command-mic-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.command-mic-overlay.hidden {
  display: none;
}

.command-mic-modal {
  background: var(--bg-alt);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.command-mic-recording {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.mic-icon-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
}

#command-mic-status {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.command-mic-transcript {
  font-size: 14px;
  color: var(--muted);
  min-height: 40px;
  margin-bottom: 24px;
  font-style: italic;
}

.command-mic-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.command-mic-actions .btn {
  padding: 14px 24px;
  font-size: 16px;
  border-radius: 12px;
}

/* Processing state */
.command-mic-modal.processing .pulse-ring {
  animation: none;
  border-color: var(--muted);
}

.command-mic-modal.processing .mic-icon-large i {
  animation: spin 1s linear infinite;
}

.command-mic-modal.processing .mic-icon-large i::before {
  content: "\f110";
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Primary tile highlight */
.tile-primary {
  border: 2px solid var(--accent);
  background: var(--tile);
}

.tile-primary:hover {
  background: var(--tile-hover);
}

/* DASHBOARD STATS */

.btn-new-invoice {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.dashboard-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--tile) 0%, var(--tile) 100%);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.stat-column {
  text-align: center;
}

.stat-column .stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.stat-column .stat-value {
  font-size: 20px;
  font-weight: 700;
}

.referrals-banner {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--tile);
  border: 2px solid var(--accent);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 12px;
}

.referrals-banner:hover {
  background: var(--tile-hover);
  transform: translateY(-2px);
}

.referrals-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.referrals-banner-content i {
  font-size: 24px;
  color: var(--accent);
  flex-shrink: 0;
}

.referrals-banner-content h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.referrals-banner-content p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.stats-section {
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--tile);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-light);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card-blue {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.1) 0%, var(--tile) 100%);
  border-color: rgba(79, 140, 255, 0.3);
}

.stat-card-green {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, var(--tile) 100%);
  border-color: rgba(76, 175, 80, 0.3);
}

.stat-card-orange {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, var(--tile) 100%);
  border-color: rgba(255, 152, 0, 0.3);
}

.stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* FORMS */

.form,
.form-inline {
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
}

.form-row {
  margin-bottom: 10px;
}

.form-row label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.form-row input,
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.form-row-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.form-row-inline > div {
  flex: 1;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.form-inline input {
  flex: 1 1 48%;
  min-width: 0;
}

.helper-card {
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
}

.helper-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.helper-results {
  margin-top: 8px;
  font-size: 13px;
}

/* LINE ITEMS */

#line-items {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px;
  background: var(--bg);
  margin-bottom: 8px;
}

.line-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .line-item-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px;
    background: var(--tile);
    border-radius: 8px;
    margin-bottom: 8px;
  }
  
  .btn-remove-line {
    width: 100%;
    height: 32px;
  }
}

.line-item-row input {
  padding: 6px;
  font-size: 12px;
}

.btn-remove-line {
  border-radius: 999px;
  border: none;
  background: var(--tile);
  color: var(--danger);
  width: 24px;
  height: 24px;
  cursor: pointer;
}

/* TOTALS */

.totals-box {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  background: var(--bg);
  font-size: 13px;
  margin: 10px 0;
}

.totals-box > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.totals-main span:last-child {
  font-weight: 700;
}

/* TABS */

.tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn.active {
  background: var(--accent);
  color: var(--text);
}

.tab-btn:hover:not(.active) {
  background: var(--border);
}

/* LISTS */

.list {
  margin-top: 8px;
}

.list-item {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.list-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.list-item-sub {
  font-size: 11px;
  color: var(--muted);
}

/* PHOTOS */

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.photo-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.photo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* SETTINGS */

.logo-preview img {
  max-width: 120px;
  max-height: 60px;
  display: block;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* REFERRALS */

.referral-card {
  background: var(--bg-alt);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 13px;
}

.referral-card p {
  margin-top: 0;
}

.ref-link-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.ref-link-row input {
  flex: 1;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.referral-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 11px;
}

.referral-stats div span {
  display: block;
  color: var(--muted);
  margin-bottom: 2px;
}

/* TOASTS */

.toast {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 10px 30px var(--shadow-light);
  z-index: 999;
}

/* RESPONSIVE */

@media (max-width: 600px) {
  .tile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tile {
    min-height: 60px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-card {
    padding: 20px;
    min-height: 100px;
  }
  
  .stat-value {
    font-size: 1.75rem;
  }
  
  .form-row-inline {
    flex-direction: column;
  }
  
  .form-inline input {
    flex: 1 1 100%;
  }
  
  .referral-stats {
    flex-direction: column;
    gap: 8px;
  }
}

@media (min-width: 700px) {
  .auth-card {
    margin-top: 60px;
  }
}

/* TRIAL BANNER */

.trial-banner {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--text-inverse);
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.trial-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.trial-banner i {
  font-size: 18px;
}

.trial-banner-content span {
  font-size: 14px;
  font-weight: 500;
}

.trial-banner .btn-sm {
  background: var(--bg-alt);
  color: var(--text);
  border: none;
}

/* PRICING PAGE */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

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

.pricing-card {
  background: var(--tile);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow);
}

.pricing-card-featured {
  border-color: var(--accent);
  box-shadow: 0 8px 30px var(--shadow-light);
}

.pricing-card h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: var(--accent);
}

.pricing-card .price {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-card .price span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 400;
}

.trial-notice {
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 24px 0;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  text-align: left;
}

.features-list li {
  padding: 10px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.features-list i {
  color: var(--success);
  font-size: 16px;
}

.feature-highlight {
  color: var(--accent);
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 8px;
}

.feature-highlight i {
  color: var(--accent);
  font-size: 18px;
}

.btn-subscribe {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
}

.badge-popular,
.badge-limited {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-popular {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.badge-limited {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success {
  background: var(--success);
  color: white;
}

.badge-danger {
  background: var(--danger);
  color: white;
}

.badge-category {
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.badge-category:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--shadow);
}

.badge-category.active {
  background: var(--accent-dark);
  box-shadow: 0 2px 8px var(--shadow);
}

.addon-section {
  max-width: 800px;
  margin: 40px auto 20px;
  padding: 0 20px;
}

.addon-section h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.addon-notice {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px 0;
}

.addon-card {
  background: var(--tile);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s;
}

.addon-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--bg-alt);
}

.addon-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  margin: 0;
}

.addon-checkbox input[type="checkbox"] {
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

.addon-details {
  flex: 1;
}

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

.addon-header strong {
  font-size: 16px;
  color: var(--text);
}

.addon-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.addon-description {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  text-align: left;
}

/* FIX TEXT BOX OVERFLOW */

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="date"],
.form-row input[type="number"],
.form-row textarea,
.form-row select {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.line-item input {
  min-width: 0;
  max-width: 100%;
}

.form-row-inline > div {
  flex: 1;
  min-width: 0;
}

.form-row-inline > div input {
  width: 100%;
  min-width: 0;
}

/* SUBSCRIPTION STATUS BADGE */

.subscription-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.subscription-badge.trial {
  background: var(--accent);
  color: var(--text-inverse);
}

.subscription-badge.active {
  background: var(--success);
  color: var(--text-inverse);
}

.subscription-badge.expired {
  background: var(--danger);
  color: var(--text-inverse);
}

/* REFERRAL PROMO */
.referral-promo {
  max-width: 800px;
  margin: 40px auto;
  padding: 30px;
  background: linear-gradient(135deg, var(--accent) 0%, #764ba2 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  color: white;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.referral-icon {
  font-size: 48px;
  flex-shrink: 0;
  opacity: 0.9;
}

.referral-content h3 {
  margin: 0 0 8px 0;
  font-size: 24px;
  color: white;
}

.referral-content p {
  margin: 0 0 12px 0;
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.95;
}

.referral-content p:last-child {
  margin-bottom: 0;
}

.referral-note {
  font-size: 13px;
  opacity: 0.85;
  font-style: italic;
}

/* TOUR SECTION */
.tour-section {
  max-width: 400px;
  margin: 30px auto 40px;
  text-align: center;
}

#btn-take-tour {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tour-description {
  margin: 10px 0 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* TOUR BANNER */
.tour-banner {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 12px 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tour-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.tour-banner-content i {
  font-size: 18px;
}

.tour-banner-content span {
  font-size: 14px;
  font-weight: 500;
}

.tour-banner .btn-sm {
  background: white;
  color: #f5576c;
  border: none;
  font-weight: 600;
}

.tour-banner .btn-sm:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* TOUR MODE DISABLED FORMS */
.tour-mode input,
.tour-mode textarea,
.tour-mode button[type="submit"],
.tour-mode button.btn-primary:not(#btn-exit-tour),
.tour-mode .btn-subscribe {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

/* DETAIL VIEW */
.detail-view {
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.detail-header-left h3 {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 24px;
}

.detail-header-left p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.detail-header-right {
  text-align: right;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  margin: 0 0 12px 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.detail-section p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.detail-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.detail-items-table th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
}

.detail-items-table td {
  padding: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

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

.detail-totals {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  text-align: right;
}

.detail-totals-row {
  display: flex;
  justify-content: flex-end;
  gap: 40px;
  margin: 8px 0;
}

.detail-totals-row.total {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.detail-totals-label {
  color: var(--muted);
  min-width: 100px;
}

.detail-totals-value {
  color: var(--text);
  font-weight: 600;
  min-width: 120px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn-convert-quote {
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: var(--text-inverse);
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-convert-quote:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-convert-quote:active:not(:disabled) {
  transform: translateY(0);
}

.btn-convert-quote:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-convert-quote i {
  font-size: 16px;
}

.payment-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.payment-status-badge.unpaid {
  background: rgba(244, 67, 54, 0.15);
  color: #F44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.payment-status-badge.paid {
  background: rgba(76, 175, 80, 0.15);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.payment-status-badge.pending {
  background: rgba(255, 152, 0, 0.15);
  color: #FF9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

/* PAYMENT COLLECTION STATUS */
.feature-status-card {
  background: var(--tile);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}

.feature-status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.feature-status-header i {
  font-size: 24px;
  color: var(--accent);
}

.feature-status-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.feature-status-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
}

.status-active {
  background: rgba(76, 175, 80, 0.15);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge i {
  font-size: 16px;
}

.feature-status-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* FEATURE PROMO BOX */
.feature-promo-box {
  margin: 30px auto;
  max-width: 600px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  box-shadow: 0 8px 30px rgba(76, 175, 80, 0.3);
  color: white;
}

.feature-promo-icon {
  font-size: 40px;
  flex-shrink: 0;
  opacity: 0.95;
}

.feature-promo-content h4 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: white;
}

.feature-promo-content p {
  margin: 0 0 16px 0;
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.5;
}

.feature-promo-pricing {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 12px;
  border-radius: 8px;
}

.feature-price-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.feature-price-option .price-label {
  opacity: 0.9;
}

.feature-price-option .price-value {
  font-weight: 700;
  font-size: 14px;
}

.feature-included .price-value {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-included i {
  font-size: 16px;
}

/* INVOICE PREVIEW */
.invoice-preview {
  margin-top: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.invoice-preview-header h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.preview-badge {
  font-size: 11px;
  padding: 4px 12px;
  background: var(--accent);
  color: white;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.invoice-preview-card {
  background: var(--tile);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px var(--shadow-light);
  font-size: 14px;
  position: relative;
}

.invoice-preview-logo {
  position: absolute;
  top: 20px;
  left: 20px;
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}

.logo-placeholder i {
  font-size: 24px;
  margin-bottom: 4px;
}

.logo-placeholder span {
  font-size: 9px;
  text-align: center;
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.invoice-preview-business {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.invoice-preview-business strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}

.invoice-preview-business div {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.invoice-preview-details {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.invoice-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.invoice-preview-row span:first-child {
  color: var(--muted);
  font-size: 13px;
}

.invoice-preview-row strong {
  color: var(--text);
  font-size: 14px;
}

.invoice-preview-items {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.invoice-preview-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  gap: 16px;
}

.invoice-preview-item span:first-child {
  flex: 1;
  color: var(--text);
}

.invoice-preview-item span:last-child {
  font-weight: 600;
  color: var(--text);
}

.invoice-preview-totals {
  display: grid;
  gap: 8px;
}

.invoice-preview-total {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  font-size: 16px;
}

.invoice-preview-total strong {
  color: var(--accent);
  font-size: 18px;
}

.invoice-preview-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.invoice-preview-footer i {
  font-size: 14px;
}

@media (max-width: 600px) {
  .referral-promo {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }
  
  .referral-icon {
    font-size: 36px;
  }
  
  .referral-content h3 {
    font-size: 20px;
  }
  
  .feature-promo-box {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .feature-promo-icon {
    font-size: 32px;
  }
  
  .invoice-preview-card {
    padding: 20px;
  }
  
  .invoice-preview-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-alt);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
  overflow: hidden;
}

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

.modal-close {
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--muted);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--tile-hover);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

/* Voice Transcript Modal */
.voice-pulse {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.voice-pulse.recording {
  background: rgba(239, 68, 68, 0.2);
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.voice-pulse.recording::before {
  content: '🎤';
  font-size: 36px;
}

.voice-pulse.processing {
  background: rgba(59, 130, 246, 0.2);
  animation: pulse-processing 1s ease-in-out infinite;
}

.voice-pulse.processing::before {
  content: '⚙️';
  font-size: 36px;
  animation: spin 1s linear infinite;
}

.voice-pulse.success {
  background: rgba(34, 197, 94, 0.2);
}

.voice-pulse.success::before {
  content: '✅';
  font-size: 36px;
}

.voice-pulse.error {
  background: rgba(239, 68, 68, 0.2);
}

.voice-pulse.error::before {
  content: '❌';
  font-size: 36px;
}

@keyframes pulse-recording {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
  }
}

@keyframes pulse-processing {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Small inline spinner for buttons */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Button Danger */
.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-danger.disabled,
.btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Secondary */
.btn-secondary {
  background: var(--tile);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--tile-hover);
}

/* Landing Page Styles */
.landing-hero {
  text-align: center;
  padding: 60px 20px 50px;
  max-width: 700px;
  margin: 0 auto;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.landing-title {
  font-size: 42px;
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.15;
  color: var(--text);
}

.landing-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 32px;
  line-height: 1.6;
}

.btn-trial-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-trial-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.5);
}

.landing-note {
  font-size: 14px;
  color: var(--muted);
  margin-top: 16px;
}

/* Features Grid */
.landing-features {
  padding: 50px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.landing-section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 40px;
  color: var(--text);
}

.features-grid-landing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature-card-landing {
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s;
}

.feature-card-landing:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--shadow);
}

.feature-icon-landing {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--accent);
}

.feature-card-landing h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}

.feature-card-landing p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Trust Signals */
.landing-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 40px 20px;
  background: var(--tile);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.trust-item i {
  font-size: 20px;
  color: var(--success);
}

/* CTA Section */
.landing-cta-section {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 0 auto;
}

.landing-cta-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.landing-cta-section > p {
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 30px;
}

.landing-pricing-note {
  margin-top: 24px;
}

.landing-pricing-note p {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 12px;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-text-link:hover {
  color: var(--accent-dark);
}

/* Tour Section Landing */
.tour-section-landing {
  text-align: center;
  padding: 40px 20px 60px;
}

.tour-divider {
  position: relative;
  margin-bottom: 30px;
}

.tour-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.tour-divider span {
  position: relative;
  background: var(--bg);
  padding: 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.btn-outline-landing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-landing:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.tour-description-landing {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}

/* Plans Modal */
.plans-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10003;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.plans-modal-overlay.active {
  display: flex;
}

.plans-modal-content {
  background: var(--bg-alt);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px var(--shadow);
}

.plans-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-alt);
}

.plans-modal-header h2 {
  margin: 0;
  font-size: 22px;
  color: var(--text);
}

.plans-modal-body {
  padding: 16px;
}

.plan-option {
  position: relative;
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.plan-option.plan-featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.08));
}

.plan-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.plan-badge.plan-badge-limited {
  background: #f59e0b;
}

.plan-info h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--text);
}

.plan-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.plan-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.plan-option .btn-primary {
  flex-shrink: 0;
  padding: 12px 20px;
  font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .landing-title {
    font-size: 32px;
  }
  
  .landing-subtitle {
    font-size: 16px;
  }
  
  .btn-trial-cta {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
  }
  
  .landing-section-title {
    font-size: 24px;
  }
  
  .features-grid-landing {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .feature-card-landing {
    padding: 20px 16px;
  }
  
  .feature-icon-landing {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .feature-card-landing h3 {
    font-size: 15px;
  }
  
  .feature-card-landing p {
    font-size: 12px;
  }
  
  .landing-trust {
    gap: 16px;
    padding: 30px 20px;
  }
  
  .trust-item {
    font-size: 12px;
  }
  
  .landing-cta-section h2 {
    font-size: 26px;
  }
  
  .plan-option {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .plan-option .btn-primary {
    width: 100%;
  }
}

/* Calendar Styles */
.calendar-container {
  padding: 16px;
}

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

.calendar-nav h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

.calendar-grid {
  background: var(--tile);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 20px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.calendar-weekdays span {
  padding: 12px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  position: relative;
  min-height: 50px;
}

.calendar-day:hover {
  background: var(--tile-hover);
}

.calendar-day.other-month {
  color: var(--muted);
  opacity: 0.5;
}

.calendar-day.today {
  background: rgba(79, 140, 255, 0.15);
  color: var(--accent);
  font-weight: 700;
}

.calendar-day.selected {
  background: var(--accent);
  color: white;
  border-radius: 8px;
}

.calendar-day .day-number {
  font-size: 14px;
  font-weight: 500;
}

.calendar-day .event-dots {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.calendar-day .event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.calendar-day .event-dot:nth-child(2) {
  background: var(--success);
}

.calendar-day .event-dot:nth-child(3) {
  background: var(--danger);
}

.calendar-day-events {
  background: var(--tile);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
}

.calendar-day-events h4 {
  margin: 0 0 12px 0;
  color: var(--text);
  font-size: 16px;
}

#calendar-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calendar-event-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-alt);
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.calendar-event-item:hover {
  background: var(--tile-hover);
  border-color: var(--accent);
}

.calendar-event-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 60px;
}

.calendar-event-info {
  flex: 1;
}

.calendar-event-title {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.calendar-event-client {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.calendar-event-link {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.calendar-event-link i {
  color: var(--accent);
}

.calendar-no-events {
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 14px;
}

/* Calendar Modal */
#calendar-event-modal.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#calendar-event-modal.hidden {
  display: none;
}

#calendar-event-modal .modal-content {
  background: var(--bg-alt);
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

#calendar-event-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--tile);
}

#calendar-event-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
}

#calendar-event-form {
  padding: 20px;
}

#calendar-event-form .form-row {
  margin-bottom: 16px;
}

#calendar-event-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

#calendar-event-form input,
#calendar-event-form select,
#calendar-event-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

#calendar-event-form input:focus,
#calendar-event-form select:focus,
#calendar-event-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

@media (max-width: 600px) {
  .calendar-day {
    min-height: 40px;
    padding: 4px;
  }
  
  .calendar-day .day-number {
    font-size: 12px;
  }
  
  .calendar-weekdays span {
    font-size: 10px;
    padding: 8px 2px;
  }
  
  .calendar-event-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .calendar-event-time {
    min-width: unset;
  }
}

/* ===== SWIPE TO REVEAL ACTIONS ===== */
.swipe-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 8px;
}

.swipe-content {
  position: relative;
  z-index: 2;
  background: var(--tile);
  border-radius: 12px;
  transition: transform 0.2s ease-out;
  touch-action: pan-y pinch-zoom;
  will-change: transform;
}

.swipe-content.dragging {
  transition: none;
}

.swipe-actions {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  z-index: 1;
}

.swipe-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.swipe-action i {
  font-size: 16px;
}

.swipe-action.edit-action {
  background: var(--accent);
}

.swipe-action.archive-action {
  background: #f59e0b;
}

.swipe-action.delete-action {
  background: var(--danger);
}

.swipe-action.unarchive-action {
  background: var(--success);
}

.swipe-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 11px;
  opacity: 0.6;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 1;
}

.swipe-hint i {
  animation: swipeHint 1.5s ease-in-out infinite;
}

@keyframes swipeHint {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

/* Delete confirmation modal */
.delete-confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.delete-confirm-modal.hidden {
  display: none;
}

.delete-confirm-content {
  background: var(--bg-alt);
  border-radius: 16px;
  padding: 24px;
  max-width: 340px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px var(--shadow);
}

.delete-confirm-content h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--danger);
}

.delete-confirm-content p {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 14px;
}

.delete-confirm-buttons {
  display: flex;
  gap: 12px;
}

.delete-confirm-buttons button {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.delete-confirm-buttons .btn-cancel {
  background: var(--tile);
  color: var(--text);
  border: 1px solid var(--border);
}

.delete-confirm-buttons .btn-delete {
  background: var(--danger);
  color: white;
}

/* Swipeable calendar events */
.calendar-event-item-swipe .swipe-content {
  padding: 0;
}

.calendar-event-item-swipe .swipe-content .list-item {
  background: transparent;
  border: none;
  margin: 0;
}

/* ===== MULTI-SELECT MODE ===== */

/* Selection checkbox */
.select-checkbox {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 28px;
  height: 28px;
  background: var(--bg-alt);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}

.select-checkbox i {
  color: white;
  font-size: 12px;
  opacity: 0;
}

/* Show checkboxes in multi-select mode */
body.multi-select-mode .select-checkbox {
  transform: translateY(-50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

body.multi-select-mode .swipe-container {
  padding-left: 40px;
}

body.multi-select-mode .swipe-content {
  transform: none !important;
}

/* Selected state */
.swipe-container.selected .select-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.swipe-container.selected .select-checkbox i {
  opacity: 1;
}

.swipe-container.selected .swipe-content {
  background: var(--accent-alpha, rgba(37, 99, 235, 0.1));
}

/* Selection bar at bottom */
#selection-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10001;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 20px var(--shadow);
}

#selection-bar.visible {
  transform: translateY(0);
}

.selection-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.selection-cancel {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tile);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.selection-count {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
}

.selection-bar-actions {
  display: flex;
  gap: 8px;
}

.selection-action {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: white;
}

.selection-action.archive-action {
  background: #f59e0b;
}

.selection-action.delete-action {
  background: var(--danger);
}

/* Hide bottom nav when selection bar is visible */
body.multi-select-mode .bottom-nav {
  transform: translateY(100%);
}

/* Prevent text selection during long-press */
.swipe-content {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
