/* ============================================================
   SUPER-REN PORTAL — Scandinavian Industrial Clean
   A premium B2B aesthetic: pristine, efficient, trustworthy
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Primary palette — deep ocean teal */
  --sr-900: #0a2e3d;
  --sr-800: #0e3f54;
  --sr-700: #13526b;
  --sr-600: #1a6d8a;
  --sr-500: #2089a8;
  --sr-400: #38a3c2;
  --sr-300: #6abdd4;
  --sr-200: #a1d6e6;
  --sr-100: #d4eef5;
  --sr-50:  #eef8fb;

  /* Accent — fresh mint */
  --sr-mint-500: #00b87a;
  --sr-mint-400: #1dd698;
  --sr-mint-100: #d0f5e8;

  /* Warm accent for urgent/CTA */
  --sr-coral: #e8614d;
  --sr-amber: #f59e0b;

  /* Neutrals */
  --sr-slate-900: #1a1d23;
  --sr-slate-700: #374151;
  --sr-slate-500: #6b7280;
  --sr-slate-300: #d1d5db;
  --sr-slate-100: #f3f4f6;
  --sr-white: #ffffff;

  /* Surfaces */
  --sr-bg: #f6f9fb;
  --sr-surface: #ffffff;
  --sr-surface-raised: #ffffff;

  /* Radii */
  --sr-radius: 10px;
  --sr-radius-lg: 16px;
  --sr-radius-sm: 6px;

  /* Shadows */
  --sr-shadow-sm: 0 1px 3px rgba(10,46,61,.06), 0 1px 2px rgba(10,46,61,.04);
  --sr-shadow: 0 4px 12px rgba(10,46,61,.08), 0 1px 3px rgba(10,46,61,.04);
  --sr-shadow-lg: 0 12px 40px rgba(10,46,61,.12), 0 4px 12px rgba(10,46,61,.06);
  --sr-shadow-glow: 0 0 0 3px rgba(32,137,168,.15);

  /* Transitions */
  --sr-ease: cubic-bezier(.4, 0, .2, 1);
  --sr-duration: 200ms;
}

/* --- Base --- */
body {
  background-color: var(--sr-bg);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--sr-slate-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }
footer { margin-top: auto; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Outfit', 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--sr-900);
  letter-spacing: -0.02em;
}

.text-muted { color: var(--sr-slate-500) !important; }

/* --- Navbar — frosted glass teal --- */
.sr-navbar {
  background: linear-gradient(135deg, var(--sr-900) 0%, var(--sr-700) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0.5rem 0;
  z-index: 100000;
}

.sr-navbar .navbar-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--sr-white) !important;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sr-navbar .navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--sr-mint-400), var(--sr-400));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--sr-white);
  box-shadow: 0 2px 8px rgba(29,214,152,.25);
}

.sr-navbar .nav-link {
  color: rgba(255,255,255,.75) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem !important;
  border-radius: var(--sr-radius-sm);
  transition: all var(--sr-duration) var(--sr-ease);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sr-navbar .nav-link:hover,
.sr-navbar .nav-link:focus {
  color: var(--sr-white) !important;
  background: rgba(255,255,255,.1);
}

.sr-navbar .nav-link.nav-admin {
  color: var(--sr-mint-400) !important;
  font-weight: 600;
}

.sr-navbar .nav-link.nav-admin:hover {
  background: rgba(29,214,152,.15);
}

.sr-navbar .nav-user {
  color: rgba(255,255,255,.5) !important;
  font-size: 0.85rem;
}

/* Mobile toggler */
.sr-navbar .navbar-toggler {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--sr-radius-sm);
  color: var(--sr-white);
  min-width: 44px;
  min-height: 44px;
}

/* Cart badge */
.badge-cart {
  position: absolute;
  top: 2px;
  right: 0;
  font-size: 0.6rem;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sr-coral) !important;
  font-weight: 700;
  border: 2px solid var(--sr-900);
}

/* --- Cards --- */
.card {
  border: none;
  border-radius: var(--sr-radius);
  box-shadow: var(--sr-shadow-sm);
  transition: box-shadow var(--sr-duration) var(--sr-ease), transform var(--sr-duration) var(--sr-ease);
  overflow: hidden;
}

.card-header {
  background: var(--sr-white);
  border-bottom: 1px solid var(--sr-slate-100);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* --- Buttons --- */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  border-radius: var(--sr-radius-sm);
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1.25rem;
  transition: all var(--sr-duration) var(--sr-ease);
  border: none;
  font-size: 0.9rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sr-600), var(--sr-700));
  color: var(--sr-white);
  box-shadow: 0 2px 8px rgba(19,82,107,.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--sr-500), var(--sr-600));
  box-shadow: 0 4px 16px rgba(19,82,107,.3);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--sr-mint-500), #009966);
  color: var(--sr-white);
  box-shadow: 0 2px 8px rgba(0,184,122,.2);
}

.btn-success:hover {
  background: linear-gradient(135deg, var(--sr-mint-400), var(--sr-mint-500));
  box-shadow: 0 4px 16px rgba(0,184,122,.3);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--sr-coral), #d14132);
  box-shadow: 0 2px 8px rgba(232,97,77,.2);
}

.btn-outline-secondary {
  border: 1.5px solid var(--sr-slate-300);
  color: var(--sr-slate-700);
  background: var(--sr-white);
}

.btn-outline-secondary:hover {
  background: var(--sr-slate-100);
  border-color: var(--sr-slate-500);
}

/* --- Forms --- */
.form-control, .form-select {
  border: 1.5px solid var(--sr-slate-300);
  border-radius: var(--sr-radius-sm);
  min-height: 44px;
  font-size: 0.95rem;
  transition: border-color var(--sr-duration) var(--sr-ease), box-shadow var(--sr-duration) var(--sr-ease);
}

.form-control:focus, .form-select:focus {
  border-color: var(--sr-500);
  box-shadow: var(--sr-shadow-glow);
}

.input-group-text {
  background: var(--sr-50);
  border: 1.5px solid var(--sr-slate-300);
  border-right: none;
  color: var(--sr-500);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--sr-slate-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --- Product Cards --- */
.product-card {
  border-radius: var(--sr-radius-lg) !important;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: var(--sr-shadow-lg);
  transform: translateY(-4px);
}

.product-card .card-img-top {
  height: 200px;
  object-fit: contain;
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--sr-50) 0%, var(--sr-white) 100%);
  border-bottom: 1px solid var(--sr-slate-100);
}

.product-card .card-body {
  padding: 1.25rem;
}

.product-card .card-title {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* --- Favorite button --- */
.btn-favorite {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--sr-slate-300);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: all var(--sr-duration) var(--sr-ease);
}

.btn-favorite:hover { color: var(--sr-coral); background: rgba(232,97,77,.08); }
.btn-favorite.active { color: var(--sr-coral); }

/* --- Quantity input --- */
.qty-input {
  width: 70px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* --- Category sidebar --- */
.category-list .list-group-item {
  border: none;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sr-slate-700);
  border-radius: var(--sr-radius-sm);
  margin-bottom: 2px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: all var(--sr-duration) var(--sr-ease);
}

.category-list .list-group-item:hover {
  background: var(--sr-50);
  color: var(--sr-700);
}

.category-list .list-group-item.active {
  background: linear-gradient(135deg, var(--sr-600), var(--sr-700));
  color: var(--sr-white);
  font-weight: 600;
}

/* --- Badges --- */
.badge {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  padding: 0.35em 0.65em;
  border-radius: var(--sr-radius-sm);
}

.badge.bg-primary { background: var(--sr-600) !important; }
.badge.bg-success { background: var(--sr-mint-500) !important; }
.badge.bg-danger { background: var(--sr-coral) !important; }
.badge.bg-warning { background: var(--sr-amber) !important; color: var(--sr-slate-900) !important; }
.badge.bg-info { background: var(--sr-400) !important; }

/* --- Tables --- */
.table { font-size: 0.9rem; }
.table thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sr-slate-500);
  font-weight: 700;
  border-bottom: 2px solid var(--sr-slate-100);
  padding: 0.75rem 1rem;
}

.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--sr-slate-100);
}

.table-hover tbody tr:hover {
  background-color: var(--sr-50);
}

/* --- Flash messages --- */
.flash-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1080;
  max-width: 420px;
  width: calc(100% - 40px);
}

.flash-container .alert {
  border-radius: var(--sr-radius);
  border: none;
  box-shadow: var(--sr-shadow-lg);
  backdrop-filter: blur(8px);
  font-weight: 500;
  font-size: 0.9rem;
  animation: flashIn 0.4s var(--sr-ease);
}

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Footer --- */
.sr-footer {
  background: var(--sr-900);
  color: rgba(255,255,255,.5);
  padding: 2rem 0;
  font-size: 0.85rem;
}

.sr-footer a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color var(--sr-duration) var(--sr-ease);
}

.sr-footer a:hover { color: var(--sr-mint-400); }

/* --- Pagination --- */
.pagination .page-link {
  border: none;
  color: var(--sr-slate-700);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--sr-radius-sm);
  margin: 0 2px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--sr-duration) var(--sr-ease);
}

.pagination .page-item.active .page-link {
  background: var(--sr-700);
  color: var(--sr-white);
}

.pagination .page-link:hover {
  background: var(--sr-50);
  color: var(--sr-700);
}

/* --- Login/Auth cards --- */
.auth-card {
  border-radius: var(--sr-radius-lg) !important;
  box-shadow: var(--sr-shadow-lg);
  border: none;
  overflow: hidden;
}

.auth-card .card-body { padding: 2.5rem; }

.auth-hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.auth-hero .brand-mark {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--sr-600), var(--sr-800));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sr-white);
  font-size: 1.75rem;
  box-shadow: 0 8px 24px rgba(10,46,61,.2);
  margin-bottom: 1rem;
}

/* --- Admin sidebar --- */
@media (min-width: 992px) {
  #adminSidebar {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
}

.admin-sidebar .nav-link {
  color: var(--sr-slate-700);
  border-radius: var(--sr-radius-sm);
  margin-bottom: 2px;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--sr-duration) var(--sr-ease);
}

.admin-sidebar .nav-link:hover {
  background: var(--sr-50);
  color: var(--sr-700);
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link.fw-bold {
  background: linear-gradient(135deg, var(--sr-50), var(--sr-100));
  color: var(--sr-700);
  font-weight: 600;
}

/* --- Stat cards (admin dashboard) --- */
.stat-card {
  border-radius: var(--sr-radius-lg) !important;
  transition: transform var(--sr-duration) var(--sr-ease), box-shadow var(--sr-duration) var(--sr-ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sr-shadow);
}

/* --- Urgent order highlighting --- */
.table-danger, tr.table-danger {
  background-color: rgba(232,97,77,.06) !important;
}

/* --- Search bar --- */
.sr-search {
  background: var(--sr-white);
  border-radius: var(--sr-radius-lg);
  box-shadow: var(--sr-shadow-sm);
  padding: 0.75rem;
  border: 1.5px solid var(--sr-slate-100);
  transition: border-color var(--sr-duration) var(--sr-ease), box-shadow var(--sr-duration) var(--sr-ease);
}

.sr-search:focus-within {
  border-color: var(--sr-300);
  box-shadow: var(--sr-shadow-glow);
}

.sr-search .form-control {
  border: none;
  box-shadow: none;
}

.sr-search .form-control:focus { box-shadow: none; }

.sr-search .input-group-text {
  background: transparent;
  border: none;
  color: var(--sr-500);
}

/* --- Empty state --- */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state i {
  font-size: 4rem;
  color: var(--sr-300);
  margin-bottom: 1rem;
}

/* --- Responsive tweaks --- */
@media (max-width: 575.98px) {
  .auth-card .card-body { padding: 1.75rem; }
  .flash-container { right: 10px; max-width: calc(100% - 20px); }
  .product-card .card-img-top { height: 150px; padding: 1rem; }
}

/* --- Page load animation --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.5s var(--sr-ease) both;
}

.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.1s; }
.fade-up-3 { animation-delay: 0.15s; }
.fade-up-4 { animation-delay: 0.2s; }
