/* ==========================================================================
   BizInvoice.help - Main Stylesheet
   Tagline: Free Business Invoice Help Instantly.
   ========================================================================== */

:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --accent: #4f46e5;
  --success: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: #f1f5f9;
  color: var(--slate-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  background-color: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-container {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.brand-title .brand-accent {
  color: var(--primary);
}

.brand-title .brand-help {
  color: #2563eb;
  font-weight: 700;
  font-size: 0.9em;
}

.brand-tagline {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
}

.nav-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

.tpbill-header-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: var(--white);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.25);
  transition: all 0.2s;
  text-decoration: none;
}

.tpbill-header-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 58, 138, 0.35);
  color: var(--white);
  text-decoration: none;
}

.tpbill-header-pill .pill-badge {
  background-color: #fbbf24;
  color: #78350f;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Notice Bar (Zero Registration & Temp Storage)
   ========================================================================== */
.privacy-ribbon {
  background: #f8fafc;
  border-bottom: 1px solid var(--slate-200);
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  flex-wrap: wrap;
}

.privacy-ribbon .badge-green {
  background-color: #dcfce7;
  color: #166534;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

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

/* ==========================================================================
   Left Panel: Controls, Settings & Prompt
   ========================================================================== */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 0.875rem 1.25rem;
  background-color: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.25rem;
}

/* Business Profile Form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.785rem;
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.required {
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: var(--slate-800);
  background-color: var(--white);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

/* Logo Upload Area */
.logo-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-preview-box {
  width: 60px;
  height: 60px;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--slate-50);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.logo-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-upload-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.btn-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.785rem;
  font-weight: 600;
  color: var(--slate-700);
  background-color: var(--slate-100);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upload-label:hover {
  background-color: var(--slate-200);
}

.logo-help-text {
  font-size: 0.7rem;
  color: var(--slate-500);
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.725rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

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

/* Prompt Box */
.prompt-card {
  border: 2px solid #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.prompt-card-header {
  background: linear-gradient(to right, #eff6ff, #f8fafc);
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-badge {
  background: #2563eb;
  color: var(--white);
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.prompt-textarea {
  width: 100%;
  min-height: 160px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 0.85rem;
  background-color: #fcfdfe;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.prompt-textarea:focus {
  border-color: #2563eb;
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Quick Example Chips */
.presets-section {
  margin-top: 0.75rem;
}

.presets-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate-600);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.preset-chip {
  background-color: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
  border-radius: 9999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-chip:hover {
  background-color: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.preset-chip.active {
  background-color: #1e40af;
  color: var(--white);
  border-color: #1e40af;
}

/* Prompt Syntax Hint */
.syntax-helper {
  margin-top: 0.85rem;
  padding: 0.75rem;
  background-color: #f8fafc;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--slate-600);
}

.syntax-helper summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  outline: none;
}

.syntax-helper pre {
  margin-top: 0.5rem;
  background-color: #1e293b;
  color: #f8fafc;
  padding: 0.6rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.725rem;
}

/* ==========================================================================
   Right Panel: Interactive Live Invoice Preview
   ========================================================================== */
.preview-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Action Toolbar */
.toolbar-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-600);
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

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

.animate-spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--slate-700);
  border-color: var(--slate-300);
}

.btn-secondary:hover {
  background-color: var(--slate-50);
  border-color: var(--slate-400);
}

.btn-outline-danger {
  background-color: var(--white);
  color: var(--danger);
  border-color: #fecaca;
}

.btn-outline-danger:hover {
  background-color: var(--danger-bg);
  border-color: var(--danger);
}

/* ==========================================================================
   A4 Professional Invoice Document Sheet
   ========================================================================== */
.invoice-sheet-container {
  overflow-x: auto;
  padding-bottom: 1rem;
}

.invoice-sheet {
  background-color: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate-300);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 3rem;
  position: relative;
  min-height: 900px;
  display: flex;
  flex-direction: column;
  color: #1e293b;
}

/* Inline Editable Helper Notice */
.edit-hint-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Invoice Header Area */
.inv-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  border-bottom: 2px solid var(--slate-100);
  gap: 1.5rem;
}

.inv-sender {
  flex: 1;
  max-width: 55%;
}

.inv-logo-wrap {
  margin-bottom: 0.75rem;
  max-height: 70px;
}

.inv-sender-logo {
  max-height: 65px;
  max-width: 220px;
  object-fit: contain;
}

.inv-business-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.inv-sender-meta {
  font-size: 0.825rem;
  color: var(--slate-500);
  line-height: 1.45;
}

.inv-meta-right {
  text-align: right;
  flex-shrink: 0;
}

.inv-main-heading {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.inv-details-table {
  font-size: 0.825rem;
  margin-left: auto;
}

.inv-details-table td {
  padding: 0.2rem 0.4rem;
}

.inv-details-table .label {
  font-weight: 600;
  color: var(--slate-500);
  text-align: right;
}

.inv-details-table .value {
  font-weight: 700;
  color: var(--slate-800);
  text-align: right;
}

/* Bill To & Dates Section */
.inv-client-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem 0;
}

.inv-section-title {
  font-size: 0.725rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin-bottom: 0.35rem;
}

.inv-client-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.inv-client-details {
  font-size: 0.825rem;
  color: var(--slate-600);
  line-height: 1.45;
}

/* Items Table */
.inv-table-wrapper {
  margin: 1.5rem 0;
}

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

.inv-items-table th {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--slate-200);
  padding: 0.75rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-600);
  text-align: left;
}

.inv-items-table th.col-num {
  width: 40px;
  text-align: center;
}

.inv-items-table th.col-qty {
  width: 70px;
  text-align: center;
}

.inv-items-table th.col-rate {
  width: 110px;
  text-align: right;
}

.inv-items-table th.col-amt {
  width: 130px;
  text-align: right;
}

.inv-items-table th.col-actions {
  width: 40px;
  text-align: center;
}

.inv-items-table td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--slate-200);
  font-size: 0.875rem;
  color: var(--slate-800);
  vertical-align: middle;
}

.inv-items-table td.col-num {
  text-align: center;
  color: var(--slate-400);
  font-size: 0.785rem;
}

.inv-items-table td.col-qty {
  text-align: center;
}

.inv-items-table td.col-rate {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inv-items-table td.col-amt {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.inv-items-table td.col-actions {
  text-align: center;
}

.btn-del-row {
  background: none;
  border: none;
  color: var(--slate-400);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-del-row:hover {
  color: var(--danger);
  background-color: var(--danger-bg);
}

.inv-add-row-bar {
  margin-top: 0.5rem;
}

.btn-add-item {
  background: none;
  border: 1px dashed #93c5fd;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s;
}

.btn-add-item:hover {
  background-color: #eff6ff;
  border-color: #3b82f6;
}

/* Totals and Tax Breakdown */
.inv-summary-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.inv-notes-terms {
  font-size: 0.8rem;
  color: var(--slate-600);
}

.inv-notes-block, .inv-terms-block {
  margin-bottom: 1rem;
}

.inv-notes-title {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  margin-bottom: 0.25rem;
}

.inv-totals-box {
  width: 100%;
}

.totals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.totals-table td {
  padding: 0.4rem 0;
  color: var(--slate-700);
}

.totals-table .t-label {
  text-align: left;
}

.totals-table .t-val {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.totals-table .tax-row {
  color: #1e40af;
}

.totals-table .tax-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.25rem;
}

.totals-table .grand-total-row {
  border-top: 2px solid var(--slate-800);
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.totals-table .grand-total-row td {
  padding-top: 0.75rem;
}

/* Invoice Footer & Attractive Branding */
.inv-footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  border-top: 1px dashed var(--slate-200);
}

.inv-brand-box {
  display: inline-block;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.45rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.inv-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.3;
}

.inv-brand-link:hover {
  color: #1e40af;
  text-decoration: none;
}

.inv-brand-logo-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mini-cube-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
}

.inv-brand-link strong {
  color: #1d4ed8;
  font-weight: 800;
  text-decoration: underline;
}

/* Editable content element styles */
[contenteditable="true"] {
  outline: none;
  transition: all 0.15s;
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
}

[contenteditable="true"]:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

[contenteditable="true"]:focus {
  background-color: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 0 2px #3b82f6;
}

/* ==========================================================================
   TPBiLL.com Feature Banner & Upsell
   ========================================================================== */
.tpbill-upsell-card {
  margin-top: 2rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.tpbill-upsell-card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(15, 23, 42, 0) 70%);
  pointer-events: none;
}

.tpbill-card-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.tpbill-content {
  flex: 1;
  min-width: 300px;
}

.tpbill-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(251, 191, 36, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tpbill-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.tpbill-desc {
  font-size: 0.925rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.tpbill-features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
  list-style: none;
}

.tpbill-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: #e2e8f0;
}

.tpbill-check-icon {
  color: #10b981;
  font-weight: bold;
}

.tpbill-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.btn-tpbill-glow {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tpbill-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
  color: #ffffff;
  text-decoration: none;
}

.tpbill-subtext {
  font-size: 0.725rem;
  color: #94a3b8;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--white);
  border-top: 1px solid var(--slate-200);
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 1.5rem;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

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

@media (max-width: 600px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--slate-900);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.825rem;
  color: var(--slate-600);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1440px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--slate-500);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--slate-900);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* Static Content Pages (About, Privacy, Terms, Disclaimer) */
.page-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem 2.5rem;
  background-color: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--slate-500);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--slate-200);
}

.page-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-800);
  margin: 1.75rem 0 0.75rem;
}

.page-content p {
  margin-bottom: 1rem;
  color: var(--slate-600);
  line-height: 1.7;
}

.page-content ul, .page-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--slate-600);
  line-height: 1.7;
}

.page-content li {
  margin-bottom: 0.35rem;
}

.page-content .highlight-box {
  background-color: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}

/* ==========================================================================
   Comprehensive Mobile Responsiveness (Smartphones & Tablets)
   ========================================================================== */
@media (max-width: 768px) {
  .main-wrapper {
    padding: 0.75rem 0.5rem;
  }

  .app-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card-body {
    padding: 1rem 0.85rem;
  }

  /* Force 16px font to prevent iOS Safari auto-zoom on input focus */
  .form-input, .form-select, .form-textarea, .prompt-textarea {
    font-size: 16px !important;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .prompt-textarea {
    min-height: 130px;
  }

  .preset-chips {
    gap: 0.35rem;
  }

  .preset-chip {
    padding: 0.35rem 0.65rem;
    font-size: 0.725rem;
  }

  /* Action toolbar mobile layout */
  .toolbar-card {
    padding: 0.75rem;
    gap: 0.65rem;
  }

  .toolbar-status {
    width: 100%;
    font-size: 0.785rem;
  }

  .toolbar-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #btnDownloadPdf {
    grid-column: span 2;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
  }

  .btn {
    min-height: 42px;
  }

  /* Responsive invoice sheet */
  .invoice-sheet-container {
    padding: 0 0 1rem 0;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .invoice-sheet {
    padding: 1.25rem 0.85rem;
    min-height: auto;
    border-radius: var(--radius-sm);
  }

  .inv-top-bar {
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }

  .inv-sender {
    max-width: 100%;
    width: 100%;
  }

  .inv-meta-right {
    text-align: left;
    width: 100%;
  }

  .inv-main-heading {
    font-size: 1.75rem;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  .inv-details-table {
    margin-left: 0;
    width: 100%;
  }

  .inv-details-table td {
    padding: 0.2rem 0;
  }

  .inv-details-table .label {
    text-align: left;
    width: 45%;
  }

  .inv-details-table .value {
    text-align: left;
  }

  .inv-client-section {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
  }

  .inv-payment-terms {
    text-align: left;
  }

  /* Table mobile scrolling */
  .inv-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    padding-bottom: 0.5rem;
  }

  .inv-items-table {
    min-width: 500px; /* Ensures columns maintain readability while scrolling */
  }

  .inv-summary-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .inv-totals-box {
    width: 100%;
  }

  .tpbill-upsell-card {
    padding: 1.25rem 1rem;
  }

  .tpbill-title {
    font-size: 1.25rem;
  }

  .page-container {
    padding: 1.25rem 1rem;
    margin: 1rem auto;
  }
}

/* Touch jump buttons for mobile */
.mobile-jump-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-jump-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .btn-mobile-jump {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: #ffffff;
    border: 1px solid var(--slate-300);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.785rem;
    font-weight: 600;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
  }
}

