/* ── Invox Manager Styles ─────────────────────────────────────────────────── */

:root {
  --invox-primary: #1a56db;
  --invox-primary-dark: #1447b0;
  --invox-secondary: #7c3aed;
  --invox-success: #059669;
  --invox-danger: #dc2626;
  --invox-warning: #d97706;
  --invox-gray: #6b7280;
  --invox-light: #f9fafb;
  --invox-border: #e5e7eb;
  --invox-white: #ffffff;
  --invox-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --invox-shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --invox-radius: 8px;
}

/* ── Wrap ──────────────────────────────────────────────────────────────────── */
.invox-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #111827; }
.invox-auth-wrap { max-width: 480px; margin: 40px auto; padding: 20px; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.invox-card { background: var(--invox-white); border: 1px solid var(--invox-border); border-radius: var(--invox-radius); padding: 24px; box-shadow: var(--invox-shadow); margin-bottom: 20px; }
.invox-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--invox-border); }
.invox-form-card { max-width: 700px; }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
.invox-logo-area { text-align: center; margin-bottom: 16px; }
.invox-brand { font-size: 22px; font-weight: 700; color: var(--invox-primary); }
.invox-auth-wrap .invox-card h2 { text-align: center; margin-top: 0; color: #111827; }
.invox-link-text { text-align: center; font-size: 14px; margin-top: 12px; color: var(--invox-gray); }
.invox-link-text a { color: var(--invox-primary); }

/* ── Messages ─────────────────────────────────────────────────────────────── */
.invox-msg { padding: 12px 16px; border-radius: var(--invox-radius); margin-bottom: 16px; font-size: 14px; }
.invox-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.invox-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.invox-nav { background: var(--invox-primary); border-radius: var(--invox-radius); margin-bottom: 24px; }
.invox-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.invox-nav ul li a { display: block; padding: 12px 16px; color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; font-weight: 500; transition: background .15s; border-radius: var(--invox-radius); }
.invox-nav ul li a:hover, .invox-nav-active a { background: rgba(255,255,255,.15); color: #fff !important; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.invox-dashboard-header { margin-bottom: 20px; }
.invox-dashboard-header h1 { margin: 0 0 4px; font-size: 24px; }
.invox-dashboard-header p  { margin: 0; color: var(--invox-gray); }
.invox-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.invox-stat-card { background: var(--invox-white); border-radius: var(--invox-radius); padding: 20px; box-shadow: var(--invox-shadow); display: flex; flex-direction: column; align-items: center; text-align: center; border-top: 4px solid transparent; }
.invox-stat-blue   { border-top-color: var(--invox-primary); }
.invox-stat-purple { border-top-color: var(--invox-secondary); }
.invox-stat-green  { border-top-color: var(--invox-success); }
.invox-stat-orange { border-top-color: var(--invox-warning); }
.stat-icon { font-size: 28px; margin-bottom: 8px; }
.stat-num  { font-size: 28px; font-weight: 700; color: #111827; }
.stat-label{ font-size: 13px; color: var(--invox-gray); margin-top: 4px; }
.invox-quick-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Page Header ──────────────────────────────────────────────────────────── */
.invox-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.invox-page-header h2 { margin: 0; font-size: 22px; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.invox-form { display: flex; flex-direction: column; gap: 14px; }
.invox-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.invox-field { display: flex; flex-direction: column; gap: 5px; }
.invox-field label { font-size: 13px; font-weight: 600; color: #374151; }
.invox-field input, .invox-field select, .invox-field textarea {
  padding: 9px 12px; border: 1px solid var(--invox-border); border-radius: 6px;
  font-size: 14px; width: 100%; box-sizing: border-box; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.invox-field input:focus, .invox-field select:focus, .invox-field textarea:focus {
  outline: none; border-color: var(--invox-primary); box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
.invox-field-full { grid-column: 1 / -1; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.invox-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: background .15s, opacity .15s; }
.invox-btn:disabled { opacity: .6; cursor: not-allowed; }
.invox-btn-primary   { background: var(--invox-primary); color: #fff; }
.invox-btn-primary:hover { background: var(--invox-primary-dark); color: #fff; }
.invox-btn-secondary { background: var(--invox-secondary); color: #fff; }
.invox-btn-outline   { background: transparent; color: var(--invox-primary); border: 1.5px solid var(--invox-primary); }
.invox-btn-outline:hover { background: var(--invox-primary); color: #fff; }
.invox-btn-sm  { padding: 4px 10px; font-size: 12px; border-radius: 4px; cursor: pointer; border: 1px solid var(--invox-border); background: var(--invox-light); font-weight: 500; }
.invox-btn-edit   { background: #eff6ff; color: var(--invox-primary); border-color: #bfdbfe; }
.invox-btn-danger { background: #fee2e2; color: var(--invox-danger); border-color: #fca5a5; }
.invox-btn-pdf    { background: #f0fdf4; color: var(--invox-success); border-color: #86efac; text-decoration: none; }
.invox-btn-email  { background: #fdf4ff; color: var(--invox-secondary); border-color: #e9d5ff; }
.invox-btn-pay    { background: #fffbeb; color: var(--invox-warning); border-color: #fcd34d; }

/* ── Table ────────────────────────────────────────────────────────────────── */
.invox-table { width: 100%; border-collapse: collapse; background: var(--invox-white); border-radius: var(--invox-radius); overflow: hidden; box-shadow: var(--invox-shadow); }
.invox-table th { background: var(--invox-primary); color: #fff; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; }
.invox-table td { padding: 10px 12px; border-bottom: 1px solid var(--invox-border); font-size: 13px; vertical-align: middle; }
.invox-table tr:last-child td { border-bottom: none; }
.invox-table tr:nth-child(even) td { background: var(--invox-light); }
.invox-table tr:hover td { background: #eff6ff; }
.invox-items-table th, .invox-items-table td { padding: 7px 8px; }
.invox-items-table input { padding: 5px 7px; font-size: 13px; }

/* ── Items / Totals ───────────────────────────────────────────────────────── */
.invox-items-wrap { margin-bottom: 12px; overflow-x: auto; }
.invox-totals-wrap { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.invox-totals-table { width: 320px; }
.invox-totals-table td { padding: 5px 8px; font-size: 14px; border: none; }
.invox-totals-table td:last-child { text-align: right; font-weight: 600; }
.grand-total-row td { background: var(--invox-primary) !important; color: #fff; font-size: 15px; padding: 8px; border-radius: 4px; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.invox-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.invox-badge-unpaid  { background: #fee2e2; color: #991b1b; }
.invox-badge-partial { background: #fef3c7; color: #92400e; }
.invox-badge-paid    { background: #d1fae5; color: #065f46; }
.invox-badge-draft   { background: #f3f4f6; color: #374151; }
.invox-badge-sent    { background: #eff6ff; color: #1d4ed8; }
.invox-badge-accepted{ background: #d1fae5; color: #065f46; }
.invox-badge-rejected{ background: #fee2e2; color: #991b1b; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.invox-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.invox-modal-content { background: var(--invox-white); border-radius: var(--invox-radius); padding: 24px; width: 100%; max-width: 520px; box-shadow: var(--invox-shadow-md); max-height: 90vh; overflow-y: auto; }
.invox-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.invox-modal-header h3 { margin: 0; }
.invox-modal-close { font-size: 22px; cursor: pointer; color: var(--invox-gray); line-height: 1; }
.invox-modal-close:hover { color: var(--invox-danger); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .invox-form-grid { grid-template-columns: 1fr; }
  .invox-stats-grid { grid-template-columns: 1fr 1fr; }
  .invox-nav ul li a { padding: 10px 12px; font-size: 13px; }
  .invox-table { font-size: 12px; }
  .invox-table th, .invox-table td { padding: 8px 6px; }
}
@media (max-width: 420px) {
  .invox-stats-grid { grid-template-columns: 1fr; }
}
