/* ============================================================
   Vendor Portal - Core Stylesheet
   Font: Plus Jakarta Sans
   ============================================================ */

:root {
  --admin-primary:   #1e3a5f;
  --admin-accent:    #0ea5e9;
  --vendor-primary:  #1a3c2a;
  --vendor-accent:   #22c55e;
  --sidebar-w:       260px;
  --topbar-h:        60px;
  --surface:         #ffffff;
  --bg:              #f1f5f9;
  --border:          #e2e8f0;
  --text-primary:    #0f172a;
  --text-secondary:  #64748b;
  --text-muted:      #94a3b8;
  --radius:          12px;
  --radius-sm:       8px;
  --shadow-sm:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:          0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.12);
  --transition:      all .18s ease;
}

/* Theme overrides per role */
.theme-admin  { --primary: var(--admin-primary);  --accent: var(--admin-accent); }
.theme-vendor { --primary: var(--vendor-primary); --accent: var(--vendor-accent); }

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; color: var(--text-primary); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ============================================================ LAYOUT */
.app-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: var(--transition);
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.brand-sub  { font-size: 10px; font-weight: 500; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: 1px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.72);
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover   { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active  { background: rgba(255,255,255,.18); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--accent); border-radius: 0 4px 4px 0;
}
.nav-icon { width: 17px; height: 17px; opacity: .8; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 10px; color: rgba(255,255,255,.45); text-transform: uppercase; letter-spacing: .5px; }
.logout-btn {
  background: none; border: none;
  color: rgba(255,255,255,.5);
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

/* MAIN */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.sidebar-toggle {
  background: none; border: none;
  color: var(--text-secondary); padding: 6px;
  border-radius: 6px; transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text-primary); }
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; color: var(--text-primary); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-display { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.alert-container { padding: 12px 24px 0; }
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 4px;
  animation: slideDown .2s ease;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-close   { margin-left: auto; background: none; border: none; color: inherit; font-size: 18px; padding: 0 4px; opacity: .6; cursor: pointer; }
.alert-close:hover { opacity: 1; }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ============================================================ CARDS */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.card-body  { padding: 22px; }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex; align-items: flex-start; gap: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon-blue   { background: #eff6ff; color: #1d4ed8; }
.kpi-icon-green  { background: #f0fdf4; color: #16a34a; }
.kpi-icon-orange { background: #fff7ed; color: #c2410c; }
.kpi-icon-purple { background: #faf5ff; color: #7c3aed; }
.kpi-icon-red    { background: #fef2f2; color: #dc2626; }
.kpi-icon-teal   { background: #f0fdfa; color: #0f766e; }
.kpi-data {}
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-top: 3px; }

/* ============================================================ STATUS BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.badge-draft        { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.badge-published    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-partial      { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-closed       { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-awarded      { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-cancelled    { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-submitted    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-under-review { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.badge-shortlisted  { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
.badge-rejected     { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-l1           { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.badge-pending      { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-approved     { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  border: none; transition: var(--transition);
  cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-secondary { background: var(--bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger  { background: #dc2626; color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }
.btn svg { width: 15px; height: 15px; }

/* ============================================================ TABLES */
.table-container { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.data-table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
.data-table thead th {
  padding: 11px 14px;
  text-align: left; font-size: 12px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody td { padding: 11px 14px; vertical-align: middle; }
.data-table tbody tr:last-child { border-bottom: none; }

/* ============================================================ FORMS */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit;
  color: var(--text-primary);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
.form-text     { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.text-danger   { color: #dc2626; font-size: 12px; }
select.form-control { appearance: auto; }

/* Grid */
.form-row { display: grid; gap: 16px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ============================================================ PAGE HEADERS */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header-left {}
.page-header h1 { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-header p  { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ============================================================ COMPARATIVE TABLE */
.comparative-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comparative-table th,
.comparative-table td { padding: 10px 12px; border: 1px solid var(--border); }
.comparative-table thead th { background: #f8fafc; font-weight: 700; font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .4px; }
.comparative-table .l1-cell { background: #fefce8 !important; font-weight: 700; }
.comparative-table .l1-highlight { border: 2px solid #eab308; }
.vendor-header-col { text-align: center; min-width: 150px; background: var(--primary) !important; color: #fff !important; }

/* ============================================================ RATING STARS */
.stars { color: #f59e0b; letter-spacing: 2px; font-size: 14px; }

/* ============================================================ PROGRESS BARS */
.progress { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width .5s ease; }
.progress-bar-blue   { background: var(--admin-accent); }
.progress-bar-green  { background: #16a34a; }
.progress-bar-orange { background: #f97316; }

/* ============================================================ EMPTY STATE */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state svg { width: 56px; height: 56px; opacity: .3; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.empty-state p  { font-size: 13.5px; margin-top: 6px; }

/* ============================================================ SYNCFUSION OVERRIDES */
.e-grid .e-headercell { background: var(--bg) !important; font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 12px !important; font-weight: 700 !important; color: var(--text-secondary) !important; text-transform: uppercase; letter-spacing: .5px; }
.e-grid .e-rowcell    { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 13.5px !important; }
.e-grid               { border-radius: var(--radius) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-sm) !important; }
.e-toolbar            { background: var(--surface) !important; border-bottom: 1px solid var(--border) !important; }
.e-btn                { font-family: 'Plus Jakarta Sans', sans-serif !important; }
.e-chart              { font-family: 'Plus Jakarta Sans', sans-serif !important; }

/* ============================================================ RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; transition: left .25s ease; }
  .sidebar.open { left: 0; }
  .form-row.cols-2,
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================ ANIMATIONS */
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
@keyframes fadeIn    { from { opacity:0; } to { opacity:1; } }
.fade-in { animation: fadeIn .25s ease; }

/* ============================================================ AUTH PAGES */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #0f2542 100%);
}
.auth-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.auth-title    { font-size: 22px; font-weight: 800; text-align: center; color: var(--text-primary); }
.auth-subtitle { font-size: 13.5px; text-align: center; color: var(--text-secondary); margin-top: 6px; }
.auth-links    { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-secondary); }
.auth-links a  { color: var(--admin-accent); font-weight: 600; }
.auth-links a:hover { text-decoration: underline; }

/* ============================================================ MISC */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.font-mono    { font-family: 'JetBrains Mono', monospace; }
.font-bold    { font-weight: 700; }
.text-success { color: #16a34a; }
.text-danger  { color: #dc2626; }
.text-warning { color: #ca8a04; }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 12.5px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-10 { gap: 10px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.w-full { width: 100%; }
