/* Dukkapu — dukkapu.css */
/* Shared styles: CSS variables, reset, typography, modals, toasts, utilities */
/* Loaded on every page before page-specific stylesheets */

/* ── Google Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:ital,wght@0,700;1,700&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────── */
:root {
  --navy:      #0a2a6e;
  --blue:      #0d3a8a;
  --accent:    #006699;
  --cyan:      #00aacc;
  --base:      #f8f7f4;
  --panel:     #ffffff;
  --border:    #e2e0da;
  --text:      #1a1a2e;
  --muted:     #6b6b80;
  --success:   #00875a;
  --warning:   #c47d00;
  --danger:    #c0392b;

  /* Category colours */
  --cat-goods:    #1a5276;
  --cat-services: #1e8449;
  --cat-digital:  #6c3483;
  --cat-agri:     #7d6608;
  --cat-build:    #784212;
  --cat-logistics:#17202a;

  --r:  6px;
  --r2: 12px;
  --sh: 0 1px 4px rgba(10,42,110,0.08);

  font-size: 16px;
}

/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: 12px;
  width: 90%; max-width: 540px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(16px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h3 { font-size: 0.95rem; font-weight: 700; }
.modal-close {
  background: none; border: none; font-size: 1.1rem;
  color: var(--muted); line-height: 1; padding: 0.2rem;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
  display: flex; gap: 0.65rem; justify-content: flex-end;
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1rem; border-radius: 8px; font-size: 0.82rem;
  font-weight: 600; border: 1.5px solid transparent;
  transition: all 0.12s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #005580; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--base); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.75rem; }

/* ── Status badges ────────────────────────────────────────────────── */
.status {
  display: inline-block; padding: 0.2rem 0.55rem;
  border-radius: 20px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.s-open, .s-active     { background: #dcfce7; color: #166534; }
.s-pending, .s-draft   { background: #fef9c3; color: #854d0e; }
.s-quoted              { background: #e0f2fe; color: #0369a1; }
.s-negotiating         { background: #fce7f3; color: #9d174d; }
.s-awarded, .s-confirmed { background: #f3e8ff; color: #7e22ce; }
.s-closed, .s-cancelled { background: #f1f5f9; color: #64748b; }
.s-processing          { background: #fff7ed; color: #c2410c; }
.s-delivered           { background: #dcfce7; color: #166534; }
.s-completed           { background: #dcfce7; color: #166534; }
.s-rejected, .s-failed { background: #fee2e2; color: #991b1b; }

/* ── Empty state ──────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.85rem; line-height: 1.6; }

/* ── Form fields ──────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.85rem; }
.field label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
  border: 1.5px solid var(--border); border-radius: 8px;
  padding: 0.6rem 0.8rem; font-size: 0.85rem; background: var(--base);
  transition: border-color 0.12s; color: var(--text); outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field-hint { font-size: 0.7rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Toggle switch ────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 0.65rem; }
.toggle {
  width: 38px; height: 20px; border-radius: 10px;
  background: var(--border); border: none; position: relative;
  transition: background 0.2s; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.2s;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(18px); }
.toggle-label { font-size: 0.82rem; color: var(--text); }

/* ── Spec tags ────────────────────────────────────────────────────── */
.spec-tag {
  display: inline-block; padding: 0.15rem 0.5rem;
  background: var(--base); border: 1px solid var(--border);
  border-radius: 4px; font-size: 0.68rem; color: var(--muted);
}

/* ── Section card ─────────────────────────────────────────────────── */
.section-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 1.25rem;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border);
}
.section-title { font-size: 0.88rem; font-weight: 700; }

/* ── Shimmer skeleton ─────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position:  1000px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--base) 25%, #e8eef5 50%, var(--base) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

/* ── Utility ──────────────────────────────────────────────────────── */
.text-muted  { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-700 { font-weight: 700; }
.mb-0   { margin-bottom: 0; }

/* ── Responsive: hide on mobile ───────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
