@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ── Base Reset & Font ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
/* ── Premium Login Page ── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060b18;
  position: relative;
  overflow: hidden;
}

/* Background orbs */
.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orb-drift 14s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #1e40af 0%, transparent 70%);
  top: -150px; left: -150px;
  animation-duration: 16s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #6d28d9 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-duration: 20s;
  animation-delay: -6s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #0e7490 0%, transparent 70%);
  top: 40%; left: 60%;
  animation-duration: 12s;
  animation-delay: -3s;
  opacity: 0.2;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 30px) scale(0.97); }
}

/* Grid overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Particles */
.particle {
  position: absolute;
  border-radius: 50%;
  background: #60a5fa;
  opacity: 0;
  animation: particle-rise linear infinite;
}

@keyframes particle-rise {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.2; }
  100% { opacity: 0; transform: translateY(-120px) scale(0.3); }
}

/* Card */
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  margin: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 40px 44px 36px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 32px 80px rgba(0,0,0,0.6),
    0 0 100px rgba(30, 64, 175, 0.12);
}

/* Badge */
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(30, 64, 175, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 20px;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

/* Logo */
.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.login-logo-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 8px rgba(37, 99, 235, 0.05),
    0 0 40px rgba(37, 99, 235, 0.2);
  animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(37,99,235,0.05), 0 0 40px rgba(37,99,235,0.2); }
  50%       { box-shadow: 0 0 0 14px rgba(37,99,235,0.08), 0 0 60px rgba(37,99,235,0.3); }
}

.login-logo {
  height: 48px;
  filter: brightness(1.8) drop-shadow(0 2px 16px rgba(37,99,235,0.5));
  animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* Titles */
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}

.login-title-sub {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.login-desc {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.login-field label svg { opacity: 0.7; }

.login-field input {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #f1f5f9;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.login-field input::placeholder { color: #475569; }

.login-field input:focus {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Error */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* Button */
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.35);
  font-family: inherit;
}

.login-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.5);
}

.login-btn:hover:not(:disabled)::before { opacity: 1; }

.login-btn:active:not(:disabled) { transform: translateY(0); }

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.login-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 12px;
  color: #334155;
}

.login-footer strong { color: #475569; }
.login-dot { color: #1e293b; }
/* ── Admin CSS — Gujarat Gov Tender ops/admin panel ── */
/* Uses CSS variables from App.css :root — do not redefine them here */

/* ─────────────────────────────────────────────────────
   Admin wrap — subtle amber top-accent signals "ops mode"
───────────────────────────────────────────────────── */
.admin-content-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 40px;
  border-top: 2px solid rgba(217, 119, 6, 0.18);
}

.admin-loader {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

/* ─────────────────────────────────────────────────────
   Stat Cards — admin variant (big number + label)
   Uses --card-color CSS variable passed from StatCard.jsx
───────────────────────────────────────────────────── */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 24px;
  border-top: 3px solid var(--card-color, #2563eb);
  transition: background 0.2s, transform 0.2s;
}

.admin-stat-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.admin-stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────
   Cards
───────────────────────────────────────────────────── */
.admin-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.admin-card-header .admin-card-title { margin-bottom: 0; }

.admin-muted { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* ─────────────────────────────────────────────────────
   Table
───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(255, 255, 255, 0.025); }

.name-cell { max-width: 300px; }

.tender-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.tender-link:hover { text-decoration: underline; }

.muted { color: var(--text-muted); }

/* Admin badge (namespaced to avoid conflict with .badge in App.css) */
.admin-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-ongoing   { background: rgba(22, 163, 74, 0.2);  color: #4ade80; }
.status-completed { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.status-upcoming  { background: rgba(245, 158, 11, 0.2);  color: #fbbf24; }
.status-unknown   { background: rgba(100, 116, 139, 0.15); color: #64748b; }

.toggle-ai {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-ai.on {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.4);
  color: #4ade80;
}

.toggle-ai.off {
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.3);
  color: #64748b;
}

.toggle-ai:hover { opacity: 0.8; }

.btn-delete {
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete:hover { background: rgba(239, 68, 68, 0.25); }

/* ─────────────────────────────────────────────────────
   Scraper
───────────────────────────────────────────────────── */
.scraper-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scraper-box.large .scraper-info { font-size: 15px; }

.scraper-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scraper-row {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.scraper-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 80px;
}

.scraper-value { font-size: 13px; color: var(--text); }
.scraper-value.running { color: #fbbf24; animation: scraper-pulse 1.5s infinite; }
.scraper-value.idle    { color: #4ade80; }
.scraper-value.green   { color: #4ade80; }

@keyframes scraper-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

.btn-run-scraper {
  padding: 12px 24px;
  background: var(--primary-light);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s, transform 0.1s;
}

.btn-run-scraper:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-run-scraper:disabled { opacity: 0.6; cursor: default; }

.scraper-msg {
  padding: 10px 14px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 8px;
  color: #60a5fa;
  font-size: 13px;
}

/* ─────────────────────────────────────────────────────
   Sub-navigation (Overview / Tenders / Scraper tabs)
───────────────────────────────────────────────────── */
.admin-subnav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 24px;
  padding-top: 8px;
}

.admin-subnav-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  text-transform: capitalize;
  margin-bottom: -1px;
}

.admin-subnav-btn:hover { color: var(--text); }

.admin-subnav-btn.active {
  color: #fbbf24;
  border-bottom-color: #d97706;
}

.admin-inner { padding-top: 4px; }
/* ===== Global ===== */
:root {
  --primary: #1e3a5f;
  --primary-light: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;
  --bg: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --card: rgba(255, 255, 255, 0.05);
  --card-solid: #1e293b;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Animated background dots */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}


/* ══════════════════════════════════════════════════
   Platform Shell — nav + layout
══════════════════════════════════════════════════ */
.platform {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: var(--bg-gradient);
}

/* Top nav bar */
.platform-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(6, 11, 24, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

.platform-nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  height: 34px;
  filter: brightness(1.7) drop-shadow(0 1px 8px rgba(37, 99, 235, 0.5));
}

.nav-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1;
}

.nav-sub {
  font-size: 10px;
  color: #60a5fa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1;
}

.platform-nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tab group */
.nav-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  white-space: nowrap;
}

.nav-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

.nav-tab.active {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.nav-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

/* Sign out button */
.nav-signout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #f87171;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}

.nav-signout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* Main content area */
.platform-main {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Dashboard content */
.dashboard-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

/* ===== Stats Cards ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  border-left: 3px solid var(--accent);
  transition: all 0.3s;
  animation: card-fade-in 0.4s ease-out both;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Analytics ===== */
.analytics-section {
  margin-bottom: 20px;
}

.btn-analytics-toggle {
  padding: 10px 24px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: #60a5fa;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
}

.btn-analytics-toggle:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  animation: card-fade-in 0.4s ease-out;
}

.chart-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #60a5fa;
  margin-bottom: 16px;
}

.chart-tooltip {
  background: #1e293b;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text);
}

.chart-tooltip p {
  margin: 0;
  text-transform: capitalize;
}

/* ===== Export Button ===== */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-export:hover {
  background: linear-gradient(135deg, #047857, #065f46);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

/* ===== Main Card ===== */
main.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== Toolbar (stats + toggle + page size) ===== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background: #334155;
  border-radius: 10px;
  position: relative;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #94a3b8;
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-label input:checked + .toggle-switch {
  background: var(--primary-light);
}

.toggle-label input:checked + .toggle-switch::after {
  left: 18px;
  background: white;
}

.page-size-select {
  padding: 8px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--card-solid);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
}

.page-size-select:hover {
  border-color: var(--primary-light);
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 2;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: var(--card-solid);
  color: var(--text);
  transition: border-color 0.2s;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-bar select {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.9rem;
  background: var(--card-solid);
  color: var(--text);
  cursor: pointer;
}

.search-bar button {
  padding: 10px 24px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.search-bar button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

/* ===== Table ===== */
.table-wrapper {
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(37, 99, 235, 0.1);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #60a5fa;
  border-bottom: 1px solid var(--glass-border);
}

td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.name-cell {
  max-width: 400px;
  line-height: 1.4;
}

.tag-ai {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-view {
  padding: 4px 12px;
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-view:hover {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
}

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-ongoing {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-unknown {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.badge-ai {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(37, 99, 235, 0.2));
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.4);
}

/* ===== Links ===== */
.btn-link {
  color: #60a5fa;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.btn-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 0;
}

.pagination button {
  padding: 8px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer strong {
  color: var(--accent);
}

/* ===== States ===== */
.loader {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 1rem;
}

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

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: toast-slide-in 0.35s ease-out;
}

.toast button {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

.toast button:hover {
  color: #f1f5f9;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}


/* ===== Drawer (Tender Detail) ===== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease-out;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 401;
  width: min(680px, 100vw);
  background: linear-gradient(160deg, #1a2742 0%, #0f172a 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  animation: drawer-slide-in 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes drawer-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Sticky header */
.drawer-header {
  flex-shrink: 0;
  padding: 22px 28px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.drawer-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.drawer-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.drawer-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 12px;
}

.drawer-close:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #f87171;
}

.drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 5px;
}

.drawer-dept {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Scrollable body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  overscroll-behavior: contain;
}

/* Custom scrollbar */
.drawer-body::-webkit-scrollbar { width: 5px; }
.drawer-body::-webkit-scrollbar-track { background: transparent; }
.drawer-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
}
.drawer-body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }



@keyframes card-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ═══════════════════════════════════════════════════
   TENDER DETAIL DRAWER — inner content styles
═══════════════════════════════════════════════════ */

/* Info grid (key-value cards) */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.info-card.accent-blue  { border-left-color: #2563eb; }
.info-card.accent-gold  { border-left-color: #d97706; }
.info-card.accent-red   { border-left-color: #dc2626; }
.info-card.accent-green { border-left-color: #16a34a; }

.info-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}

.info-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.info-value {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

/* Requirement badges row */
.req-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.req-badge {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.req-badge.blue   { background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.25); }
.req-badge.gold   { background: rgba(217, 119, 6, 0.12);  border-color: rgba(217, 119, 6, 0.25); }
.req-badge.green  { background: rgba(22, 163, 74, 0.12);  border-color: rgba(22, 163, 74, 0.25); }
.req-badge.purple { background: rgba(124, 58, 237, 0.12); border-color: rgba(124, 58, 237, 0.25); }

.req-badge-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.req-badge-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

/* RFP Sections (collapsible) */
.rfp-section {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.rfp-section.section-eligibility { border-left: 3px solid #16a34a; }
.rfp-section.section-experience  { border-left: 3px solid #2563eb; }
.rfp-section.section-turnover    { border-left: 3px solid #d97706; }
.rfp-section.section-manpower    { border-left: 3px solid #7c3aed; }
.rfp-section.section-scope       { border-left: 3px solid #0891b2; }
.rfp-section.section-eval        { border-left: 3px solid #db2777; }
.rfp-section.section-conditions  { border-left: 3px solid #dc2626; }
.rfp-section.section-docs        { border-left: 3px solid #64748b; }
.rfp-section.section-prebid      { border-left: 3px solid #7c3aed; }
.rfp-section.section-tech        { border-left: 3px solid #0891b2; }

.rfp-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s;
}

.rfp-section-header:hover { background: rgba(255, 255, 255, 0.07); }

.rfp-section-icon { font-size: 1rem; }

.rfp-section-header h3 {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.rfp-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}

.rfp-chevron.open { transform: rotate(180deg); }

.rfp-section-body {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.rfp-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  white-space: pre-line;
}

.rfp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rfp-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rfp-list li::before {
  content: "•";
  color: #60a5fa;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Actions row */
.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-wrap: wrap;
}

/* Download button */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 3px 14px rgba(37, 99, 235, 0.35);
  font-family: inherit;
}

.btn-download:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-download:disabled { opacity: 0.7; cursor: default; }

.btn-download-downloading {
  background: linear-gradient(135deg, #374151, #1f2937);
  box-shadow: none;
}

.btn-download-done {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 3px 14px rgba(5, 150, 105, 0.35);
}

.dl-icon, .check-icon { font-size: 1.1rem; }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* Source link */
.btn-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #60a5fa;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-source:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: #93c5fd;
}

/* badge-contract — used in drawer header */
.badge-contract {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

/* ═══════════════════════════════════════════════════
   DEADLINE COLOR BADGE — in tender table
═══════════════════════════════════════════════════ */
.deadline-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.deadline-past {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.deadline-near {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.deadline-far {
  background: rgba(22, 163, 74, 0.12);
  color: #4ade80;
  border: 1px solid rgba(22, 163, 74, 0.25);
}
