/* ===== Global ===== */
:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --bg: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===== Main card container ===== */
.main-card {
  width: 97%;
  max-width: 1600px;
  margin: 0 auto;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
}

.container-fluid {
  padding-top: 20px !important;
  padding-bottom: 20px !important;
}

/* ===== Cards ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card-header {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.card-header h6 {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 0;
  margin: 24px auto 12px;
  max-width: 600px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ===== Buttons ===== */
.btn {
  min-width: 120px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-sm {
  min-width: auto;
  border-radius: 6px;
  font-size: 0.8125rem;
}

/* ===== Supplier Nav ===== */
.supplier-nav {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
}

.supplier-nav .nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition);
  border: none;
  background: transparent;
}

.supplier-nav .nav-pill:hover {
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
}

.supplier-nav .nav-pill.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.supplier-nav .nav-pill i {
  font-size: 0.9rem;
}

.supplier-nav .nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}

.supplier-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.supplier-nav-header h5 {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  margin: 0;
}

.supplier-nav-header .user-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.supplier-nav-header .header-actions .btn {
  min-width: auto;
  font-size: 0.8125rem;
  border-radius: 6px;
}

/* ===== Welcome bar ===== */
.welcome-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

/* ===== Service tiles ===== */
.svc-tile {
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.svc-tile:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.svc-tile .svc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.svc-tile .svc-icon.bg-primary-subtle { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.svc-tile .svc-icon.bg-success-subtle { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.svc-tile .svc-icon.bg-warning-subtle { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.svc-tile .svc-icon.bg-info-subtle { background: rgba(6, 182, 212, 0.1); color: #06b6d4; }

.svc-tile .svc-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== Stat cards ===== */
.stat-card {
  border-left: 4px solid;
  border-radius: var(--radius-sm) !important;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-card .stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== Tables ===== */
.table {
  font-size: 0.8125rem;
}

.table thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  background: var(--surface-alt);
}

.table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-color: var(--border);
}

.table-hover tbody tr:hover {
  background-color: rgba(79, 70, 229, 0.03);
}

.recent-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recent-table td {
  font-size: 0.8125rem;
}

/* ===== Badges ===== */
.badge {
  font-weight: 500;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

/* ===== Announcements ===== */
.announcement-item {
  border-left: 3px solid;
  border-radius: 0 4px 4px 0;
  background: var(--surface-alt);
  margin-bottom: 4px;
}

/* ===== Forms ===== */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-label {
  font-weight: 500;
  color: var(--text);
  font-size: 0.8125rem;
}

/* ===== Upload drop zone ===== */
#drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--transition);
  background: var(--surface-alt);
}

#drop-zone:hover {
  border-color: var(--primary-light);
  background: rgba(79, 70, 229, 0.03);
}

#drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.06);
  box-shadow: inset 0 0 0 2px rgba(79, 70, 229, 0.1);
}

#drop-zone p:first-child {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== Alert refinements ===== */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Progress bar ===== */
.progress {
  border-radius: 6px;
  background: var(--surface-alt);
}

.progress-bar {
  background: var(--primary);
  border-radius: 6px;
  font-size: 0.7rem;
}

/* ===== File list ===== */
.file-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-entry span { flex: 1; }
.file-entry button { margin-left: 10px; }

.file-entry .progress {
  width: 320px;
  margin-left: 10px;
  margin-right: 10px;
  height: 20px;
}

.highlight-user {
  background-color: rgba(79, 70, 229, 0.06);
}

/* ===== Square buttons (admin) ===== */
.square-btn {
  padding: 1.5rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 1 / 1;
  font-size: 1.1rem;
  transform: scale(0.75);
  transform-origin: center;
}

.square-btn .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* ===== Section headings ===== */
.section-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ===== Empty states ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.875rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .main-card {
    width: 100%;
    border-radius: 0 !important;
  }

  .supplier-nav {
    gap: 1px;
    padding: 4px;
  }

  .supplier-nav .nav-pill {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  .supplier-nav .nav-divider {
    display: none;
  }

  .container-fluid {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
}
