/* ===== Bootstrap 4 → 5 compatibility shims ===== */
/* Stat card left borders (used in dashboards) */
.border-left-primary  { border-left: 4px solid #0d6efd !important; }
.border-left-success  { border-left: 4px solid #198754 !important; }
.border-left-info     { border-left: 4px solid #0dcaf0 !important; }
.border-left-warning  { border-left: 4px solid #ffc107 !important; }
.border-left-danger   { border-left: 4px solid #dc3545 !important; }

/* Small label text in stat cards */
.text-xs { font-size: 0.72rem; letter-spacing: 0.05em; }

/* Muted icon colors (BS4 gray scale) */
.text-gray-300 { color: #dee2e6 !important; }
.text-gray-500 { color: #6c757d !important; }
.text-gray-600 { color: #6c757d !important; }
.text-gray-800 { color: #343a40 !important; }

/* Stat card icon sizing shim (fa-2x equivalent) */
.icon-2x { font-size: 2rem; }

/* Dashboard action toolbar — wraps on small screens */
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.dashboard-actions .btn { white-space: nowrap; }

@media (max-width: 576px) {
    .dashboard-actions { width: 100%; }
    .dashboard-actions .btn { flex: 1 1 calc(50% - 0.5rem); text-align: center; font-size: 0.78rem; }
}

/* ═══════════════════════════════════════════════
   NAVBAR — SharpDocs Modern Nav
   ═══════════════════════════════════════════════ */

.sd-nav {
  background: linear-gradient(135deg, #0f2044 0%, #1a3a6e 100%);
  box-shadow: 0 2px 20px rgba(0,0,0,0.28);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.sd-nav .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  flex-wrap: nowrap;
}

/* ── Brand ── */
.sd-brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.sd-brand .sd-bolt {
  color: #fbbf24;
  font-size: 1.15rem;
}
.sd-brand:hover { opacity: 0.9; }

/* ── Search ── */
.sd-search {
  flex: 1 1 0;
  min-width: 0;
  max-width: 400px;
}
.sd-search .input-group {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.sd-search input {
  background: #fff;
  border: none;
  font-size: 0.875rem;
  color: #1e293b;
  padding: 0.52rem 0.9rem;
  min-width: 0;
  border-radius: 10px 0 0 10px !important;
}
.sd-search input::placeholder { color: #94a3b8; }
.sd-search input:focus {
  background: #fff;
  box-shadow: none;
  border: none;
  outline: none;
  color: #1e293b;
}
.sd-search-btn {
  background: #fbbf24;
  border: none;
  color: #0f2044;
  padding: 0.52rem 1rem;
  font-size: 0.9rem;
  border-radius: 0 10px 10px 0 !important;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}
.sd-search-btn:hover { background: #f59e0b; }

/* ── Hamburger ── */
.sd-toggler {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 40px;
  transition: background 0.2s, border-color 0.2s;
}
.sd-toggler:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
}
.sd-toggler .bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.26s ease, opacity 0.2s ease;
}
.sd-toggler.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sd-toggler.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sd-toggler.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav links ── */
.sd-menu {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sd-menu .sd-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.44rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, color 0.15s;
  border: none;
  background: transparent;
  cursor: pointer;
}
.sd-menu .sd-link:hover,
.sd-menu .sd-link.active {
  background: rgba(255,255,255,0.13);
  color: #fff;
}
.sd-menu .sd-link i { font-size: 1rem; flex-shrink: 0; }

/* ── Dropdown ── */
.sd-menu .dropdown-toggle::after { margin-left: 0.25rem; vertical-align: 0.12em; }
.sd-menu .dropdown-menu {
  background: #fff;
  border: none;
  border-radius: 14px;
  box-shadow: 0 8px 36px rgba(0,0,0,0.14);
  padding: 0.5rem;
  min-width: 210px;
  margin-top: 0.4rem !important;
}
.sd-menu .dropdown-item {
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-size: 0.875rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}
.sd-menu .dropdown-item:hover,
.sd-menu .dropdown-item:focus { background: #f1f5f9; color: #0f2044; }
.sd-menu .dropdown-divider { margin: 0.35rem 0.5rem; border-color: #e2e8f0; }

/* User dropdown header */
.sd-user-header {
  padding: 0.65rem 0.9rem 0.55rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.3rem;
}
.sd-user-header .name { font-weight: 700; font-size: 0.875rem; color: #0f172a; }
.sd-user-header .handle { font-size: 0.75rem; color: #94a3b8; margin-top: 0.1rem; }

/* Avatar circle */
.sd-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #1a3a6e;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

/* ── Guest pills ── */
.sd-pill-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  padding: 0.44rem 1.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s;
}
.sd-pill-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}
.sd-pill-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #fbbf24;
  border-radius: 50px;
  padding: 0.44rem 1.3rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f2044;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(251,191,36,0.35);
}
.sd-pill-solid:hover {
  background: #f59e0b;
  color: #0f2044;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251,191,36,0.45);
}

/* Mobile divider */
.sd-mobile-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0.4rem 1rem;
}

/* ═══════════════════════════════════
   MOBILE NAV (≤ 991px)
   ═══════════════════════════════════ */
@media (max-width: 991px) {
  .sd-toggler { display: flex; }

  .sd-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    background: #0d1d3a;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.6rem 0 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1029;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    animation: navSlideDown 0.2s ease;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .sd-menu.open { display: flex; }

  .sd-menu .sd-link {
    padding: 0.75rem 1.4rem;
    border-radius: 0;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    width: 100%;
    justify-content: flex-start;
  }
  .sd-menu .sd-link:hover,
  .sd-menu .sd-link.active {
    background: rgba(255,255,255,0.07);
    border-left-color: #fbbf24;
    color: #fff;
  }

  /* Mobile dropdowns expand inline */
  .sd-menu .dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none;
    border-radius: 0;
    background: rgba(255,255,255,0.03);
    border: none;
    padding: 0;
    margin: 0 !important;
    min-width: unset;
  }
  .sd-menu .dropdown-toggle::after { display: none; }
  .sd-menu .dropdown-item {
    color: rgba(255,255,255,0.72);
    padding: 0.65rem 1.4rem 0.65rem 2.8rem;
    border-radius: 0;
    font-size: 0.875rem;
  }
  .sd-menu .dropdown-item:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
  }
  .sd-menu .dropdown-divider { border-color: rgba(255,255,255,0.08); }

  .sd-user-header { border-color: rgba(255,255,255,0.1); }
  .sd-user-header .name { color: #fff; }
  .sd-user-header .handle { color: rgba(255,255,255,0.45); }

  /* Guest pills row on mobile */
  .sd-menu .sd-pills-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1.4rem 0.35rem;
  }
  .sd-pills-row .sd-pill-solid,
  .sd-pills-row .sd-pill-outline {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  /* Search full width, brand + search + toggler on one row */
  .sd-search { max-width: 100%; flex: 1 1 0; }
  .sd-nav .container { gap: 0.5rem; flex-wrap: wrap; padding-top: 0.55rem; padding-bottom: 0.55rem; }
  .sd-nav .container > .sd-brand   { order: 1; }
  .sd-nav .container > .sd-search  { order: 2; flex: 1 1 0; min-width: 0; }
  .sd-nav .container > .sd-toggler { order: 3; }
  .sd-nav .container > .sd-menu    { order: 4; flex-basis: 100%; }
}

/* Very small phones — tighten brand text */
@media (max-width: 360px) {
  .sd-brand { font-size: 1.1rem; }
  .sd-search input { font-size: 0.8rem; }
}

/* ===== Custom Overrides ===== */

/* General body styling */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #212529;
  line-height: 1.6;
}

/* Navbar */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.25rem;
}

.navbar .nav-link {
  transition: color 0.2s ease-in-out;
}

.navbar .nav-link:hover {
  color: #e2e6ea;
}

.navbar .nav-link.active {
  font-weight: 600;
  border-bottom: 2px solid #fff;
}


/* Cards */
.card {
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Buttons */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline-primary {
  border-width: 2px;
}

/* Alerts */
.alert {
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

/* Forms */
form label {
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.form-control {
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

.form-control:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.15rem rgba(13,110,253,0.25);
}

.text-danger {
  font-size: 0.85rem;
}

/* Tables (used in Seller Dashboard & Sales History) */
.table {
  font-size: 0.95rem;
}

.table thead th {
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background-color: #f1f3f5;
}

/* Progress bars (Sales Performance) */
.progress {
  background-color: #e9ecef;
  border-radius: 0.5rem;
  overflow: hidden;
}

.progress-bar {
  font-size: 0.75rem;
  font-weight: 600;
  transition: width 0.6s ease;
}

/* Tooltip */
.tooltip {
  font-size: 0.85rem;
}

/* Utility spacing for CTA rows */
.action-buttons {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Headings in forms and dashboards */
h2, h3, h4 {
  font-weight: 600;
}

/* ===== Responsive Design ===== */

/* Mobile Devices (≤576px) */
@media (max-width: 576px) {
  /* Container adjustments */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Typography */
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  /* Cards */
  .card {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Buttons */
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  .btn-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
  }
  
  /* Forms */
  .form-control {
    font-size: 14px;
  }
  
  .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  /* Tables */
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem;
    vertical-align: top;
  }
  
  /* Action buttons */
  .action-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-buttons .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Navbar search fix */
  .navbar .input-group {
    max-width: 100%;
  }
  
  .navbar .form-control {
    width: 100%;
  }
  
  /* Modal adjustments */
  .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .page-link {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
  }
  
  /* Alerts */
  .alert {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }
  
  /* Progress bars */
  .progress {
    height: 0.75rem;
  }
  
  /* Badges */
  .badge {
    font-size: 0.7rem;
  }
  
  /* Tooltips */
  .tooltip {
    font-size: 0.75rem;
  }
}

/* Tablet Devices (577px-768px) */
@media (min-width: 577px) and (max-width: 768px) {
  /* Container adjustments */
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  /* Typography */
  body {
    font-size: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  /* Cards */
  .card-body {
    padding: 1.25rem;
  }
  
  /* Tables */
  .table {
    font-size: 0.9rem;
  }
  
  /* Action buttons */
  .action-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .action-buttons .btn {
    flex: 1;
    min-width: 120px;
  }
  
  /* Navbar search */
  .navbar .form-control {
    width: 100%;
  }
  
  /* Modal adjustments */
  .modal-dialog {
    max-width: 90%;
  }
}

/* Small Desktop (769px-992px) */
@media (min-width: 769px) and (max-width: 992px) {
  /* Cards */
  .card {
    margin-bottom: 1.25rem;
  }
  
  /* Action buttons */
  .action-buttons {
    gap: 1rem;
  }
}

/* Large Desktop (≥993px) */
@media (min-width: 993px) {
  /* Ensure larger screens maintain good proportions */
  .container {
    max-width: 1200px;
  }
  
  /* Cards hover effects */
  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  }
}

/* Section headers with "View All" button on mobile */
@media (max-width: 576px) {
  .d-flex.justify-content-between.align-items-center.mb-4 {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.75rem;
  }
  
  .d-flex.justify-content-between.align-items-center.mb-4 .btn {
    align-self: flex-start;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* Print styles */
@media print {
  .navbar,
  .dark-mode-toggle,
  .pwa-install-prompt,
  .admin-notification-container {
    display: none !important;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
    break-inside: avoid;
  }
  
  .table {
    font-size: 10pt;
  }
  
  .btn {
    border: 1px solid #000;
    background: white !important;
    color: black !important;
  }
}
