/**
 * Demipoint Digital — Invoice Generator Styles
 * Internal-Tool standard: 20px-28px card radii, no pill buttons.
 * Single-page A4 print optimization.
 */

:root {
  --radius-panel: 24px;
  --radius-card: 20px;
  --radius-input: 12px;
  --radius-btn: 12px;
  --radius-badge: 6px;

  --bg-app: #09090b;
  --bg-surface: #121215;
  --bg-card: #18181b;
  --border-subtle: #27272a;
  --border-focus: #52525b;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --brand-primary: #3b82f6;
  --brand-hover: #2563eb;
  --status-success: #10b981;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.invoice-app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem 1rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.tool-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-panel);
  padding: 1.5rem;
}

.tool-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem;
}

/* Form Styles */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.35rem; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  padding: 0.65rem 0.85rem;
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}
.btn-primary { background-color: var(--brand-primary); color: #fff; }
.btn-primary:hover { background-color: var(--brand-hover); }
.btn-secondary { background-color: var(--bg-card); border-color: var(--border-subtle); color: var(--text-primary); }
.btn-secondary:hover { border-color: var(--border-focus); }

/* A4 Live Invoice Document Preview */
.invoice-sheet {
  background-color: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  line-height: 1.4;
  position: relative;
  min-height: 800px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.sheet-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.sheet-table th {
  text-align: left;
  background-color: #f8fafc;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #475569;
}
.sheet-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.totals-table {
  width: 280px;
  margin-left: auto;
  border-collapse: collapse;
}
.totals-table td {
  padding: 0.4rem 0.5rem;
}

.sheet-bank-details {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.82rem;
  margin-top: 1.5rem;
}

/* Watermark */
.demipoint-watermark {
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print, header, .editor-grid > div:first-child, .growth-loop-banner {
    display: none !important;
  }
  .invoice-app-container {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .editor-grid {
    display: block !important;
  }
  .invoice-sheet {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 1cm !important;
    min-height: auto !important;
  }
}
