/* Techwon Portal — component styles.
   Written as plain CSS (no @apply) because the Tailwind CDN only processes
   utility classes found in markup, not directives inside linked stylesheets. */

/* Brand tokens taken from techwon.pk */
:root {
  --navy-950: #070B1C;
  --navy-900: #08193C;
  --navy-800: #0E2A5C;
  --navy-700: #143a7a;
  --brand-400: #4E92EC;
  --brand-600: #2563EB;
  --brand-700: #1d4ed8;
  --cyan-400: #22D3EE;
  --cyan-300: #5FC8F5;
  --ink-hi: #F4F8FF;
  --ink-mid: #EAF1FF;
  --ink-mute: #9FB0D4;
  --grad-brand: linear-gradient(135deg, #4E92EC, #2563EB);
  --grad-accent: linear-gradient(90deg, #4E92EC, #22D3EE);
}

* { -webkit-tap-highlight-color: transparent; }
body { overflow-x: clip; }

/* ── Loading spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid #cbd5e1;
  border-top-color: var(--brand-600);
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 10px 40px -18px rgba(15, 23, 42, .18);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: .75rem; padding: .625rem 1rem;
  font-size: .875rem; font-weight: 500; line-height: 1.25rem;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s, color .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: 0 8px 20px -10px rgba(37,99,235,.6); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-navy { background: var(--navy-900); color: #fff; }
.btn-navy:hover:not(:disabled) { background: var(--navy-800); }
.btn-ghost { background: #fff; color: #334155; border-color: #e2e8f0; }
.btn-ghost:hover:not(:disabled) { background: #f8fafc; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-sm { padding: .375rem .75rem; font-size: .75rem; border-radius: .5rem; }

/* ── Form controls ──────────────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  border-radius: .75rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: .625rem .75rem;
  font-size: .875rem;
  color: #1e293b;
  font-family: inherit;
}
.textarea { min-height: 84px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.label {
  display: block; margin-bottom: .375rem;
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: #64748b;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  border-radius: 9999px; padding: .25rem .625rem;
  font-size: .7rem; font-weight: 600; line-height: 1rem;
  white-space: nowrap;
}

/* ── Sidebar navigation ─────────────────────────────────────────────────── */
.nav-link {
  display: flex; align-items: center; gap: .75rem;
  border-radius: .75rem; padding: .625rem .75rem;
  font-size: .875rem; font-weight: 600;
  color: var(--ink-mute); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: var(--ink-hi); }
.nav-link.active {
  background: linear-gradient(90deg, rgba(78,146,236,.22), rgba(34,211,238,.10));
  color: var(--ink-hi);
  box-shadow: inset 2px 0 0 var(--cyan-400);
}
.nav-link .ico { width: 18px; height: 18px; flex: none; }

/* Sidebar shell — mirrors the dark navy of techwon.pk */
.sidebar-bg {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(37,99,235,.22), rgba(7,11,28,0) 60%),
    var(--navy-900);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}
table.data { width: 100%; min-width: 640px; font-size: .875rem; border-collapse: collapse; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  background: #f8fafc;
  padding: .75rem 1rem;
  text-align: left;
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: #64748b; white-space: nowrap;
}
table.data tbody td { border-top: 1px solid #f1f5f9; padding: .75rem 1rem; vertical-align: middle; }
table.data tbody tr:hover { background: #f8fafc; }

/* ── Progress bar ───────────────────────────────────────────────────────── */
.bar { height: 8px; border-radius: 9999px; background: #e2e8f0; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 9999px; transition: width .4s ease; }

/* ── Pipeline board ─────────────────────────────────────────────────────── */
.board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .75rem; }
.board-col { flex: 0 0 280px; }

/* ── Animation ──────────────────────────────────────────────────────────── */
.fade-in { animation: fade .25s ease-out both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.toast {
  pointer-events: auto;
  border-radius: .75rem; padding: .75rem 1rem;
  color: #fff; font-size: .875rem; font-weight: 500;
  box-shadow: 0 12px 32px -10px rgba(15,23,42,.4);
  animation: fade .2s ease-out both;
  max-width: 340px;
}
.toast.ok    { background: #16a34a; }
.toast.err   { background: #dc2626; }
.toast.info  { background: var(--navy-900); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Print (invoices / quotations) ──────────────────────────────────────── */
@media print {
  .no-print, aside, header { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  main { padding: 0 !important; }
}

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
