/* Reset & Variables */
:root {
  --primary: #991b1b; /* Premium Maroon/Deep Red */
  --primary-dark: #7f1d1d; /* Even darker shade for hover */
  --secondary: #475569; /* Slate */
  --bg-body: #f8fafc; /* Very light slate gray */
  --bg-surface: #ffffff;
  --text-main: #1e293b; /* Slate 800 */
  --text-muted: #64748b; /* Slate 500 */
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --radius: 6px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ... existing code ... */

/* New Pill Buttons for Vendor Agreement Dashboard */
.btn-pill-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  padding: 0.35rem 1rem; /* Compact padding */
  border-radius: 999px; /* Capsule shape */
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}

.btn-pill-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-pill-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #ffffff;
  color: var(--primary); /* Text uses primary color */
  border: 1px solid var(--border-light);
  padding: 0.35rem 1rem; /* Compact padding */
  border-radius: 999px; /* Capsule shape */
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}

.btn-pill-light:hover {
  background-color: #f8fafc;
  border-color: var(--primary); /* Border highlight on hover */
  color: var(--primary-dark);
}

/* Update alerts */
.alert-error {
  background-color: #fef2f2;
  color: #7f1d1d; /* Darker red text */
  border-color: #fecaca;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* Typography */
h1, h2, h3, h4, h5, h6 { margin-top: 0; margin-bottom: 0.75rem; font-weight: 600; color: #0f172a; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin-top: 0; margin-bottom: 1rem; }
.muted { color: var(--text-muted); font-size: 0.875rem; }
.text-center { text-align: center; }

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start; /* Ensure sidebar doesn't stretch weirdly */
}

.main {
  flex: 1;
  min-width: 0; /* Prevent flex overflow */
}

/* Admin full-width layout with zero outer margin for sidebar */
.admin-layout {
  gap: 0;
  margin: 0;
  padding: 0;
}
.admin-layout .sidebar {
  border-radius: 0;
  margin: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.admin-layout .main {
  padding: 2rem;
  margin-left: 300px;
  background: #f3f4f6;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--primary-dark);
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav { display: flex; align-items: center; gap: 1.5rem; }
.navbar-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
}
.navbar-nav a:hover { color: var(--primary); }
.navbar-nav span { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 80px; /* Offset for navbar */
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.sidebar h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
}

.sidebar a {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  color: var(--text-main);
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-align: left;
}

.sidebar a i {
  margin-right: 0.5rem;
  font-size: 1.1em; /* Slightly larger icon */
}

.sidebar a:hover {
  background-color: #fef2f2; /* Light red tint */
  color: var(--primary);
}

.sidebar a.active {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

/* Cards & Panels */
.card {
  background: var(--bg-surface);
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.card h3 {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

/* Stats & Charts */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.pill-group {
  display: inline-flex;
  gap: 0.5rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
}
.pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.form-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.btn-back {
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  background: #fff;
  font-size: 0.85rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
}
/* Two-column form grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

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

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-md); /* Added shadow as requested */
}

.chart-title {
  text-align: center;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Forms */
.form-row { margin-bottom: 1.25rem; }
.form-row label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #334155;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Form actions row */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Info alert */
.info-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  color: #0c4a6e;
  margin-top: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background-color: #fff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn:hover { background-color: #f1f5f9; border-color: #cbd5e1; }

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

.btn.primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-danger {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-danger:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline-danger {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-danger:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.success {
  background-color: #22c55e;
  border-color: #22c55e;
  color: white;
}
.btn.success:hover {
  background-color: #16a34a;
  border-color: #16a34a;
}

.btn.danger {
  background-color: #ef4444;
  border-color: #ef4444;
  color: white;
}
.btn.danger:hover { background-color: #dc2626; }

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background-color: #f8fafc; }

/* Utilities */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.w-100 { width: 100%; }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}
