/* styles.css — Custom design layer on top of Tailwind (CDN, no build step,
   so this file is written in plain CSS rather than @apply). */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@1,500&display=swap');

:root {
  --wg-navy: #10172a;
  --wg-navy-light: #1b2540;
  --wg-indigo: #4338ca;
  --wg-amber: #b45309;
  --wg-bg: #f6f7fb;
}

html, body { font-family: 'Inter', system-ui, sans-serif; background: var(--wg-bg); }
.font-signature { font-family: 'Playfair Display', serif; }

/* ---------- Layout ---------- */
#sidebar {
  background: linear-gradient(180deg, var(--wg-navy) 0%, var(--wg-navy-light) 100%);
}

.sidebar-link {
  width: 100%; display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 500; color: #cbd5e1;
  background: transparent; border: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-link[data-active="true"] { background: rgba(255,255,255,0.15); color: #fff; }

/* ---------- Cards & form controls ---------- */
.card {
  background: #fff; border-radius: 1rem; border: 1px solid #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); padding: 1.25rem;
}
.card-title {
  font-size: 0.8rem; font-weight: 600; color: #1e293b; margin-bottom: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.field-label {
  display: block; font-size: 0.72rem; font-weight: 500; color: #64748b; margin-bottom: 0.25rem;
}
.input {
  width: 100%; border-radius: 0.5rem; border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem; font-size: 0.875rem; color: #1e293b; background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.input:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
.input-sm {
  width: 100%; border-radius: 0.375rem; border: 1px solid #e2e8f0;
  padding: 0.35rem 0.5rem; font-size: 0.875rem;
}
.input-sm:focus { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: #4f46e5; color: #fff; font-size: 0.875rem; font-weight: 600;
  padding: 0.6rem 1rem; border-radius: 0.5rem; border: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06); transition: background-color .15s ease, transform .1s ease;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: #fff; color: #334155; font-size: 0.85rem; font-weight: 500;
  padding: 0.6rem 1rem; border-radius: 0.5rem; border: 1px solid #e2e8f0; cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.btn-secondary:hover { background: #f8fafc; }
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
  padding: 0.3rem 0.4rem; border-radius: 0.375rem; color: #64748b; background: transparent; border: none; cursor: pointer;
}
.icon-btn:hover { background: #f1f5f9; }

/* ---------- Loading skeleton ---------- */
.skeleton { background: #e2e8f0; border-radius: 0.5rem; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- Toasts ---------- */
#toast-host { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200; display: flex; flex-direction: column; gap: 0.5rem; }
.toast-item { opacity: 0; transform: translateY(8px); transition: all .25s ease; }
.toast-show { opacity: 1; transform: translateY(0); }

/* ---------- Dialog pop animation ---------- */
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.anim-pop { animation: pop .18s ease-out; }

/* ---------- A4 invoice sheet ---------- */
.a4-sheet {
  width: 794px;
  min-height: 1123px;
  background: #fff;
  padding: 32px 40px;
  margin: 0 auto;
  color: #1e293b;
  box-sizing: border-box;
}
.b-cell { border: 1px solid #cbd5e1; padding: 6px 8px; }

/* ---------- Dark mode ---------- */
.dark body { background: #0b1120; }
.dark .card { background: #0f172a; border-color: #1e293b; }
.dark .card-title { color: #e2e8f0; }
.dark .input, .dark .input-sm { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.dark .btn-secondary { background: #1e293b; border-color: #334155; color: #e2e8f0; }
.dark .btn-secondary:hover { background: #273449; }
.dark table { color: #cbd5e1; }
.dark #page-root, .dark main { color: #e2e8f0; }
.dark .field-label { color: #94a3b8; }

/* ---------- Print ---------- */
@media print {
  body * { visibility: hidden; }
  .a4-sheet, .a4-sheet * { visibility: visible; }
  .a4-sheet { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
