:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --bg: #f4f5fb;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-md: 0 4px 12px rgba(16,24,40,0.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at 20% 20%, #eef2ff 0%, transparent 45%),
              radial-gradient(circle at 80% 80%, #f5f3ff 0%, transparent 45%),
              linear-gradient(160deg, #fafbff 0%, #f4f5fb 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.login-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(79,70,229,0.35);
}

.login-header h1 {
  font-size: 21px;
  margin: 0;
  letter-spacing: -0.02em;
}

.login-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 24px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: #cbd5e1; background: #f9fafb; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border: none;
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
  padding: 12px 18px;
  font-size: 15px;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

/* ---------- App shell ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.topbar-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, #7c3aed 100%);
}
.topbar-inner { padding: 16px 20px; }
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.topbar-row h1 {
  font-size: 19px;
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}
.search-wrap input:focus { outline: none; border-color: var(--primary); }
.search-icon {
  position: absolute;
  left: 10px;
  top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Dashboard stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px;
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s;
  border-top: 3px solid var(--primary);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- Orders table ---------- */
.table-wrap {
  margin: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
th {
  background: #f9fafb;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4b5563;
}
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #fafaff; }
tr.is-hold { background: #fef2f2; }
tr.is-hold:hover { background: #fee2e2; }

.status-select {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  min-width: 128px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.status-select:focus { outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,0.15); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.badge-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.modal-box h2 { margin: 0 0 16px; font-size: 17px; font-weight: 700; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.import-msg {
  padding: 8px 20px 14px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Industry showcase ---------- */
.showcase-hero {
  text-align: center;
  padding: 56px 20px 32px;
  background: linear-gradient(160deg, #fafbff 0%, #eef2ff 100%);
}
.showcase-hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.showcase-hero p { color: var(--muted); font-size: 15px; max-width: 560px; margin: 0 auto; }

.industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.industry-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  border-top: 4px solid var(--card-accent, var(--primary));
}
.industry-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.industry-emoji { font-size: 34px; margin-bottom: 10px; display: block; }
.industry-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.industry-card p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 40px; }
.industry-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.stage-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 12%, white);
  color: var(--card-accent, var(--primary));
}
.industry-card .btn-primary {
  background: var(--card-accent, var(--primary));
  box-shadow: none;
  width: 100%;
}
.demo-creds {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}
.demo-creds code { background: #f3f4f6; padding: 2px 5px; border-radius: 4px; }
