/*
  DiziTrack — Global Stylesheet
  File: style.css
  Purpose: Theme variables, layout, components, modals, tables, timeline, and responsive rules
  Note: Only formatting & comments added. No selectors, properties, or values changed.
==================================================================== */

/* ========================= Global Reset & Theme ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #9b8cff;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --bg-primary: #f7fafc;
  --bg-secondary: #edf2f7;
  --bg-card: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --shadow-light: rgba(255, 255, 255, 0.8);
  --shadow-dark: rgba(163, 177, 198, 0.35);
  --border: #e5e7eb;
  --border-radius: 20px;
  --transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
  --row-a: #f9fbff;
  --row-b: #f3f6ff;
  --row-hover: #eef2ff;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ============================= Landing ============================= */
.landing-container {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  padding: 20px;
}

.bg-animation {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.floating-element {
  position: absolute;
  width: 200px;
  height: 200px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  opacity: 0.08;
  animation: float 6s ease-in-out infinite;
  filter: blur(1px);
}

.floating-element:nth-child(1) {
  top: 10%;
  left: 10%;
}

.floating-element:nth-child(2) {
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.floating-element:nth-child(3) {
  bottom: 20%;
  left: 50%;
  animation-delay: 4s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) scale(1)
  }

  50% {
    transform: translateY(-20px) scale(1.06)
  }
}

.login-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--border-radius);
  box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
  max-width: 480px;
  width: 100%;
  text-align: center;
  animation: slideUp 0.8s ease-out;
  margin-inline: auto;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.logo-section {
  margin-bottom: 30px;
}

.logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 4px 4px 12px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
}

.logo i {
  font-size: 2rem;
  color: #fff;
}

.logo-section h1 {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.logo-section p {
  color: var(--text-secondary);
}

.login-form {
  margin-bottom: 30px;
}

.input-group {
  position: relative;
  margin-bottom: 18px;
}

.input-group input {
  width: 100%;
  padding: 15px 50px;
  border: none;
  border-radius: 15px;
  background: var(--bg-primary);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  font-size: 1rem;
  color: var(--text-primary);
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light), 0 0 0 3px rgba(102, 126, 234, .12);
}

.input-group i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--primary-color);
}

/* icon-only override */
.input-group .toggle-password {
  right: 50px;
  box-shadow: none;
  outline: none;
  appearance: none;
  color: var(--text-secondary);
  padding: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-group .toggle-password:focus {
  outline: none;
  box-shadow: none;
}

.input-group .toggle-password:hover,
.input-group .toggle-password:focus-visible {
  color: var(--primary-color);
}

.input-group .toggle-password:focus-visible {
  outline: 3px solid rgba(102, 126, 234, .25);
  outline-offset: 2px;
}

.login-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 4px 4px 12px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 16px var(--shadow-dark), -6px -6px 16px var(--shadow-light);
}

/* Contact card */
.contact-card {
  background: var(--bg-primary);
  padding: 18px;
  border-radius: 15px;
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
  min-height: 110px;
  margin-top: 14px;
}

.contact-card h4 {
  margin-bottom: 6px;
}

.contact-card p {
  color: var(--text-secondary);
  font-size: .95rem;
}

.contact-card a {
  color: var(--primary-color);
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

/* ============================== Layout ============================== */
.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;

  /* glass background */
  background: rgba(255, 255, 255, 0.55);
  /* fallback tint */
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  /* Safari */

  /* existing layout */
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  /* subtle glass border & shadow */
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 12px var(--shadow-dark), 0 -2px 8px var(--shadow-light);

  /* perf hint */
  will-change: backdrop-filter;
}


.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logout-btn {
  background: var(--danger-color);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 2px 2px 6px var(--shadow-dark), -2px 2px 6px var(--shadow-light);
}

.logout-btn:hover {
  transform: translateY(-2px);
}

.dashboard-container {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 280px;
  background: var(--bg-card);
  padding: 26px 0;
  box-shadow: 4px 0 12px var(--shadow-dark), -2px 0 8px var(--shadow-light);
}

.sidebar-menu {
  padding: 0 18px;
}

.menu-item {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  text-align: left;
}

.menu-item:hover {
  background: var(--bg-primary);
  color: var(--primary-color);
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  box-shadow: 4px 4px 12px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
}

.main-content {
  flex: 1;
  padding: 26px;
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

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

.section-header h2 {
  font-size: 1.9rem;
  font-weight: 600;
}

/* =============================== Stats =============================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.3rem;
}

.stat-info h3 {
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-info p {
  color: var(--text-secondary);
  font-size: .92rem;
}

.stat-link {
  border: none;
  cursor: pointer;
  text-align: left;
}

.stat-link:focus-visible {
  outline: 3px solid rgba(102, 126, 234, .4);
  outline-offset: 2px;
}

/* ========================= Forms & Buttons ========================= */
.order-form,
.modal-form {
  background: var(--bg-card);
  padding: 24px;
  border-radius: 18px;
  box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: var(--bg-primary);
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  box-shadow: inset 1px 1px 4px var(--shadow-dark), inset -1px -1px 4px var(--shadow-light), 0 0 0 3px rgba(102, 126, 234, .12);
}

.submit-btn,
.add-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 4px 4px 12px var(--shadow-dark), -4px -4px 12px var(--shadow-light);
}

.submit-btn:hover,
.add-btn:hover {
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: #6366f1;
  color: #fff;
}

.btn-success {
  background: var(--success-color);
  color: #fff;
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* ============================== Search box ============================== */
.search-box {
  position: relative;
  max-width: 420px;
}

.search-box input {
  width: 100%;
  padding: 14px 46px;
  border: none;
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
  font-size: 1rem;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

/* ============================ Tables & Cards ============================ */
.orders-table,
.users-table {
  background: var(--bg-card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light);
}

.table-header {
  background: var(--bg-primary);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  font-weight: 600;
}

.table-row {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  border-bottom: 1px solid var(--bg-primary);
  align-items: center;
  transition: var(--transition);
}

.table-row:hover {
  background: var(--bg-primary);
}

.table-row:last-child {
  border-bottom: none;
}

.table-cell {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.detail-label {
  color: var(--text-secondary);
  font-size: .9rem;
}

.detail-value {
  font-weight: 600;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  background: #eef2ff;
  color: #4338ca;
}

.status-artwork {
  background: #e7f5ff;
  color: #0b7285;
}

.status-printing {
  background: #e3fafc;
  color: #0b7285;
}

.status-production {
  background: #fff3bf;
  color: #7c6f0e;
}

.status-qc {
  background: #ffe3e3;
  color: #b91c1c;
}

.status-dispatch {
  background: #e7f5e7;
  color: #2b8a3e;
}

.status-completed {
  background: #d1fae5;
  color: #065f46;
}

.status-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ================================ Modals ================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 18px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 20px 20px 40px var(--shadow-dark), -20px -20px 40px var(--shadow-light);
  animation: modalSlideIn .25s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(.95) translateY(-10px)
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0)
  }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-form {
  padding: 22px;
}

/* =========================== Orders list cards =========================== */
.orders-list {
  display: flex;
  flex-direction: column;
}

.order-card {
  background: var(--bg-card);
  padding: 16px;
  margin: 10px;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .05);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-id {
  font-weight: 700;
  color: #4f46e5;
}

.order-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

/* =============================== Subsections =============================== */
.subsection {
  margin-top: 6px;
  margin-bottom: 18px;
}

.subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px;
}

.subsection-header h3 {
  font-size: 1.1rem;
}

/* =========== Tracking: Modern Horizontal Stepper (User/Admin) ============ */
.tracking-result-wrap {
  margin-top: 14px;
}

.tracking-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
}

.tracking-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.tracking-summary .kv {
  display: flex;
  gap: 8px;
  font-size: .95rem;
}

.tracking-summary .k {
  color: var(--text-secondary);
}

.tracking-summary .v {
  font-weight: 600;
}

.stepper {
  position: relative;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 6px;
  margin-top: 6px;
  overflow-x: auto;
}

.stepper::-webkit-scrollbar {
  height: 8px;
}

.stepper::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 8px;
}

.step {
  position: relative;
  min-width: 140px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step .dot {
  width: 35px;
  height: 35px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 3px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: var(--transition);
}

.step .dot i {
  font-size: .7rem;
  color: white;
  opacity: 0;
  transform: scale(.8);
  transition: var(--transition);
}

.step .title {
  margin-top: 10px;
  font-weight: 600;
  font-size: .95rem;
}

.step .time {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: .82rem;
}

.step::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  z-index: 1;
  transform: translateX(9px);
}

.step:last-child::after {
  display: none;
}

.step.completed .dot {
  background: linear-gradient(135deg, #22c55e, #10b981);
  border-color: #bbf7d0;
}

.step.completed .dot i {
  opacity: 1;
  transform: scale(1);
}

.step.completed .title {
  color: #065f46;
}

.step.active .dot {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: #c7d2fe;
  box-shadow: 0 0 0 6px rgba(99, 102, 241, .12);
}

.step.active .title {
  color: #4f46e5;
}

.step.upcoming .dot {
  background: #e5e7eb;
  border-color: #e5e7eb;
}

.step.rejected .dot {
  background: linear-gradient(135deg, #f87171, #ef4444);
  border-color: #fecaca;
}

.step.rejected .title {
  color: #b91c1c;
}

/* Notifications */
.notification {
  position: fixed;
  top: 16px;
  right: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  z-index: 1100;
  transform: translateX(100%);
  transition: transform .3s;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  background: var(--success-color);
}

.notification.error {
  background: var(--danger-color);
}

.notification.warning {
  background: var(--warning-color);
  color: #000;
}

/* Accessibility focus */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ============================== Responsive ============================== */
@media (max-width:1180px) {
  .tracking-summary {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width:1024px) {
  .sidebar {
    width: 240px;
  }

  .section-header h2 {
    font-size: 1.7rem;
  }
}

@media (max-width:820px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 14px 0;
    box-shadow: 0 4px 12px var(--shadow-dark);
  }

  .sidebar-menu {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 14px;
  }

  .menu-item {
    min-width: 160px;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .main-content {
    padding: 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width:600px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .table-header {
    display: none;
  }

  .table-row {
    display: block;
    border: 1px solid var(--bg-primary);
    border-radius: 12px;
    margin: 10px;
  }

  .table-cell {
    justify-content: space-between;
    padding: 6px 0;
  }

  .orders-table,
  .users-table {
    box-shadow: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .order-card {
    box-shadow: none;
    border: 1px solid var(--border);
  }
}

@media (max-width:420px) {
  .login-card {
    padding: 22px 16px;
  }

  .logo {
    width: 60px;
    height: 60px;
  }

  .logo i {
    font-size: 1.4rem;
  }

  .logo-section h1 {
    font-size: 1.8rem;
  }

  .search-box {
    width: 100%;
  }
}

/* ================================ Utility ================================ */
.no-data {
  padding: 22px;
  text-align: center;
  color: var(--text-secondary);
}

/* Active step dot animation */
.step.active .dot {
  position: relative;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: #c7d2fe;
  box-shadow: 0 0 0 6px rgba(99, 102, 241, .15);
  animation: pulseGlow 1.8s infinite ease-in-out;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, .5), 0 0 0 6px rgba(99, 102, 241, .15)
  }

  50% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, .35), 0 0 0 14px rgba(99, 102, 241, .1)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0), 0 0 0 6px rgba(99, 102, 241, .15)
  }
}

/* ===================== Specifications block (Place Order) ===================== */
.specs-block {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--bg-card);
}

.specs-block legend {
  padding: 0 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-row {
  border: 1px solid var(--bg-primary);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  background: #fbfbfd;
}

.spec-pick {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-pick input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.spec-pick .dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #c7d2fe;
  display: inline-block;
  position: relative;
  background: #fff;
  transition: var(--transition);
  cursor: pointer;
}

.spec-pick .dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transform: scale(.6);
  transition: var(--transition);
}

.spec-pick input:checked+.dot::after {
  opacity: 1;
  transform: scale(1);
}

.spec-input {
  margin-top: 10px;
  animation: specSlide .2s ease-out;
}

.spec-input input,
.spec-input textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: var(--bg-primary);
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
  font-size: .95rem;
}

@keyframes specSlide {
  from {
    opacity: 0;
    transform: translateY(-2px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* ================= Order Details (View Details modal) ================= */
#orderDetailsModal .modal-content {
  max-width: 760px;
}

.order-details-card {
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
  overflow: hidden;
  overflow-x: auto;
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.details-table th,
.details-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--bg-primary);
  font-size: .95rem;
}

.details-table th {
  width: 32%;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f9fafb;
}

.details-table tr:nth-child(even) td {
  background: #fcfcff;
}

@media (max-width:560px) {
  #orderDetailsModal .modal-content {
    max-width: 92vw;
  }

  .details-table th,
  .details-table td {
    padding: 10px 12px;
    font-size: .9rem;
  }
}

/* Modal header buttons layout */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================================ Reports ================================ */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}

.report-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
}

.report-card h3 {
  margin-bottom: 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
  background: var(--bg-card);
}

.report-table thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-primary);
}

.report-table td,
.report-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-primary);
  vertical-align: middle;
}

.report-table tfoot th {
  font-weight: 700;
}

.report-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table .muted {
  color: var(--text-secondary);
  text-align: center;
}

.bar {
  height: 8px;
  width: 100%;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.bar>span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 999px;
  transition: width .5s ease;
}

@media (max-width:560px) {

  .report-table td,
  .report-table th {
    padding: 8px 10px;
  }
}

.report-table tbody tr.clickable {
  cursor: pointer;
  transition: background-color .15s ease;
}

.report-table tbody tr.clickable:hover,
.report-table tbody tr.clickable:focus-visible {
  background: #f5f7ff;
}

.report-table tbody tr:nth-child(odd) {
  background: var(--row-a);
}

.report-table tbody tr:nth-child(even) {
  background: var(--row-b);
}

@media (hover:hover) {
  .report-table tbody tr:hover {
    background: var(--row-hover);
  }
}

/* ================================ Lists polish ================================ */
.table-body {
  display: block;
}

.table-body .table-row {
  background: var(--row-a);
  transition: transform .06s ease, background-color .2s ease, box-shadow .2s ease;
  border-bottom: 1px solid var(--bg-primary);
}

.table-body .table-row:nth-child(even) {
  background: var(--row-b);
}

@media (hover:hover) {
  .table-body .table-row:hover {
    background: var(--row-hover);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .03) inset;
  }
}

/* ============== Wide screens: grid + hide inline labels ============== */
@media (min-width:700px) {
  .table-header {
    display: grid;
  }

  .table-row {
    display: grid;
    align-items: center;
  }

  .table-cell {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .table-cell .detail-label {
    display: none;
  }

  .table-cell .detail-value {
    font-weight: 600;
    color: var(--text-primary);
  }

  .table-row .action-buttons {
    justify-content: flex-end;
  }

  .orders-table .table-header,
  .orders-table .table-row {
    grid-template-columns: 1.1fr 1.4fr .8fr 1.2fr 1fr 1fr 1.2fr;
    column-gap: 16px;
    padding: 0 12px;
  }

  .orders-table .table-header {
    padding: 14px 12px;
  }

  .users-table .table-header,
  .users-table .table-row {
    grid-template-columns: 1fr 1.2fr 1.6fr 1.1fr .8fr .8fr 1.2fr;
    column-gap: 16px;
    padding: 0 12px;
  }

  .users-table .table-header {
    padding: 14px 12px;
  }
}

@media (min-width:1024px) {

  .orders-table .table-header,
  .orders-table .table-row {
    grid-template-columns: 1fr 1.6fr .8fr 1.2fr 1fr 1fr 1.1fr;
  }

  .users-table .table-header,
  .users-table .table-row {
    grid-template-columns: .9fr 1.3fr 1.8fr 1.1fr .8fr .7fr 1.1fr;
  }
}

/* ============================= Mobile cards look ============================= */
@media (max-width:600px) {
  .table-body .table-row {
    background: var(--bg-card);
    border: 1px solid var(--bg-primary);
    margin: 10px;
    border-radius: 12px;
  }
}

/* ========================= Modal header polish ========================= */
.modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
}

.modal .modal-header .header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal .modal-header .close-btn {
  --size: 36px;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9999px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}

.modal .modal-header .close-btn i {
  font-size: 16px;
  line-height: 0;
}

.modal .modal-header .close-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
  transform: rotate(90deg) scale(1.06);
  box-shadow: 0 6px 16px rgba(185, 28, 28, .18);
}

.modal .modal-header .close-btn:active {
  transform: rotate(90deg) scale(.96);
}

.modal .modal-header .close-btn:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .45);
  outline-offset: 2px;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (prefers-color-scheme:dark) {
  .modal .modal-header {
    border-bottom-color: #253042;
  }

  .modal .modal-header .close-btn {
    background: #0f172a;
    color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
  }

  .modal .modal-header .close-btn:hover {
    background: #3f1e24;
    color: #fecaca;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
  }
}

/* ============================== Global footer ============================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--bg-secondary);
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.4;
  text-align: center;
  padding: 12px 16px;
  box-shadow: 0 -2px 8px var(--shadow-light);
  z-index: 200;
}

.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width:600px) {
  .site-footer {
    font-size: .9rem;
    padding: 10px 14px;
  }
}

/* ============================ Manage Users header ============================ */
#admin-manageUsers .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#admin-manageUsers .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-wrap: nowrap;
  min-width: 0;
}

#admin-manageUsers .header-actions .add-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding-inline: 16px;
}

#admin-manageUsers .header-actions .search-box {
  display: flex;
  align-items: center;
  flex: 1 1 420px;
  min-width: 220px;
}

#admin-manageUsers .header-actions .search-box input {
  width: 100%;
}

@media (max-width:640px) {
  #admin-manageUsers .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #admin-manageUsers .header-actions {
    width: 100%;
    margin-left: 0;
    gap: 10px;
  }

  #admin-manageUsers .header-actions .search-box {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  #admin-manageUsers .header-actions .add-btn {
    padding-inline: 12px;
  }
}

/* ============================== Admin Track modal ============================== */
#adminTrackModal .modal-content {
  max-width: 860px;
  width: 100%;
}

/* =========================== Right side actions helper =========================== */
.table-row .action-buttons.right {
  margin-left: auto;
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

/* =============================== User tables variants =============================== */
.table-row.user-compact {
  position: relative;
}

.table-row.user-compact .row-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}

@media (max-width:768px) {
  .table-row.user-compact .row-actions {
    position: static;
    transform: none;
    margin-top: 8px;
    justify-content: flex-start;
  }
}

.table-row.user-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
  margin: 8px 0;
}

.table-row.user-card .row-top {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
}

.table-row.user-card .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width:768px) {
  .table-row.user-card .row-top {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .table-row.user-card .row-actions {
    justify-content: flex-start;
  }
}

/* ============================ Submit button centered ============================ */
.order-form .submit-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ============================ Spec file input spacing ============================ */
.spec-input input[type="file"] {
  margin-top: 8px;
}

/* ======================= Shared left-aligned row actions ======================= */
.row-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

/* ========================= Attachments: picker preview ========================= */
.attachments-preview {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-left: 0;
}

.attachments-preview li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9999px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-primary);
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
}

.attachments-preview li .file-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #fff;
  font-size: .78rem;
  line-height: 1;
}

.attachments-preview li .name {
  font-weight: 600;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachments-preview li .size {
  color: var(--text-secondary);
  font-weight: 500;
}

/* =============== Order Details: attachments download list =============== */
.details-table .attachments-cell {
  padding-top: 8px;
  padding-bottom: 8px;
}

.attachments-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  transition: var(--transition);
}

.attachment-link:hover,
.attachment-link:focus-visible {
  background: var(--row-hover);
  outline: none;
}

.attachment-link .ext {
  min-width: 34px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.attachment-link .filename {
  font-weight: 600;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-link .meta {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: .85rem;
}

.attachment-link .dl {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.attachment-link .dl i {
  font-size: .95rem;
  color: #374151;
}

.step .expected-note {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* ================= Vertical Timeline (Track Order) — RESPONSIVE =================
   Keeps 3-column layout even on phones; shrinks fonts/dots. */
:root {
  --vtl-line: #d9dee8;
  --vtl-dot: #e9edf5;
  --vtl-dot-active: #5b61ff;
  --vtl-dot-done: #22c55e;
  --vtl-text: #0f172a;
  --vtl-sub: #64748b;
  --vtl-expected: #2563eb;
}

.vtl-card {
  max-width: 860px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
}

.vtl-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.vtl-head .title {
  font-weight: 800;
  color: var(--vtl-text);
  font-size: clamp(16px, 2.2vw, 22px);
}

.vtl-head .badge {
  justify-self: center;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: clamp(11px, 1.6vw, 13px);
}

.vtl-head .meta {
  justify-self: end;
  font-size: clamp(12px, 1.7vw, 14px);
  color: #475569;
}

/* Timeline container */
.vtl {
  --rows: 7;
  --mid: 24px;
  --dotSize: 24px;
  position: relative;
  height: clamp(440px, 62vh, 560px);
  display: grid;
  grid-template-rows: repeat(var(--rows), 1fr);
  padding: 6px 2px;
}

/* Center spine */
.vtl::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(#e7eaf2, #e7eaf2) left / 2px 100% no-repeat;
  border-radius: 1px;
}

/* Row: left | dot | right */
.vtl-row {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 48px 1fr;
  position: relative;
}

/* Side blocks */
.vtl-side {
  padding: 4px 10px;
}

.vtl-side.left {
  text-align: right;
}

.vtl-side.right {
  text-align: left;
}

.vtl-title {
  font-weight: 800;
  color: var(--vtl-text);
  letter-spacing: .2px;
  font-size: clamp(13px, 2vw, 18px);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.vtl-sub {
  margin-top: 3px;
  font-size: clamp(11px, 1.6vw, 13px);
  color: var(--vtl-sub);
  line-height: 1.15;
}

.vtl-expected {
  margin-top: 2px;
  font-weight: 700;
  color: var(--vtl-expected);
  font-size: clamp(11px, 1.6vw, 13px);
}

/* Dotted leaders */
.vtl-side.left::after,
.vtl-side.right::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 46px;
  border-top: 1px dashed #c3c9d6;
  opacity: .7;
  transform: translateY(-50%);
}

.vtl-side.left::after {
  right: calc(50% + var(--mid));
}

.vtl-side.right::before {
  left: calc(50% + var(--mid));
}

/* Center dot */
.vtl-dot {
  justify-self: center;
  width: var(--dotSize);
  height: var(--dotSize);
  border-radius: 50%;
  background: var(--vtl-dot);
  box-shadow: inset 0 0 0 4px #f4f6fb;
}

.vtl-row.completed .vtl-dot {
  background: var(--vtl-dot-done);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, .18);
  position: relative;
}

.vtl-row.completed .vtl-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 10"><path fill="white" d="M4.4 9.6 0 5.2l1.4-1.4L4.4 7l6.2-6.2L12 2.2z"/></svg>') center/12px 10px no-repeat;
}

.vtl-row.active .vtl-dot {
  background: var(--vtl-dot-active);
  box-shadow: 0 0 0 8px rgba(91, 97, 255, .18);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(91, 97, 255, .45), 0 0 0 8px rgba(91, 97, 255, .18)
  }

  50% {
    box-shadow: 0 0 0 8px rgba(91, 97, 255, .28), 0 0 0 14px rgba(91, 97, 255, .08)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(91, 97, 255, 0), 0 0 0 8px rgba(91, 97, 255, .18)
  }
}

/* Optional rejected */
.vtl-row.rejected .vtl-dot {
  background: #ef4444;
  box-shadow: 0 0 0 6px rgba(239, 68, 68, .22)
}

.vtl-row.rejected .vtl-title {
  color: #b91c1c
}

/* ===== Phone layout (keep 3 columns, shrink sizes) ===== */
@media (max-width:560px) {
  .vtl {
    height: clamp(420px, 64vh, 540px);
    --mid: 18px;
    --dotSize: 20px;
  }

  .vtl-row {
    grid-template-columns: minmax(110px, 1fr) 36px minmax(110px, 1fr);
  }

  .vtl-side {
    padding: 2px 8px;
  }

  .vtl-title {
    font-size: clamp(12px, 3.6vw, 16px);
  }

  .vtl-sub,
  .vtl-expected {
    font-size: clamp(10px, 3.2vw, 13px);
  }

  .vtl-side.left::after,
  .vtl-side.right::before {
    width: 34px;
  }

  .vtl-dot {
    box-shadow: inset 0 0 0 3px #f4f6fb;
  }

  .vtl-row.completed .vtl-dot {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, .18);
  }

  .vtl-row.active .vtl-dot {
    box-shadow: 0 0 0 7px rgba(91, 97, 255, .18);
  }

  .vtl-head {
    gap: 8px;
  }

  .vtl-head .title {
    font-size: clamp(15px, 4.2vw, 18px);
  }

  .vtl-head .badge {
    font-size: clamp(10px, 3.1vw, 12px);
    padding: 4px 8px;
  }

  .vtl-head .meta {
    font-size: clamp(11px, 3.2vw, 13px);
  }
}

/* ================================ Footer ================================ */
.site-footer .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* Admin Track modal width (already above) */
/* Right side actions helper (already above) */

/* ========== Make button-based stat cards identical to div-based ones ========== */
button.stat-card {
  border: none;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  cursor: pointer;
}

button.stat-card:focus {
  outline: none;
}

button.stat-card:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.35);
  outline-offset: 2px;
}

/* Optional: spinning cogs for in-progress (comment to disable) */
.stat-icon .fa-cogs {
  animation: spin 1.2s linear infinite;
}

/* @keyframes spin { to { transform: rotate(360deg); } } */

/* Per-user overview profile band */
#userOverviewModal .order-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

#userOverviewModal .detail-label {
  color: var(--text-secondary);
}

#userOverviewModal .detail-value {
  font-weight: 600;
}

#userOverviewModal .stat-card.clickable {
  cursor: pointer;
}

.file-preview-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.file-preview-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fbfbfd;
  margin-bottom: 6px;
  font-size: 14px;
}

.file-preview-list .file-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.file-preview-list .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-list .size {
  color: #6b7280;
  font-size: 12px;
}
/* ==============================
   PAYMENTS UI — POLISH v2 (Design only)
   Paste at the very end of style.css
   ============================== */

/* Brand tune (Dhwani navy + amber) */
:root{
  --brand-700: #061644;         /* Dhwani deep navy */
  --brand-600: #0b1f59;
  --brand-500: #1e3a8a;
  --brand-amber:#EF9611;        /* Dhwani amber */
  /* --ok-500:    #16a34a; */
  --warn-500:  #f59e0b;
  --danger-500:#ef4444;

  --card-bg:   rgba(255,255,255,.92);
  --muted-900: #0f172a;
  --muted-800: #1f2937;
  --muted-700: #334155;
  --muted-600: #64748b;
  --muted-300: #d1d5db;
  --muted-200: #e5e7eb;
  --muted-100: #f1f5f9;

  --shadow-1:  0 6px 18px rgba(6,22,68,.06);
  --shadow-2:  0 12px 28px rgba(6,22,68,.10);
  --radius-xl: 16px;
  --radius-2xl:20px;
}

/* Section title spacing / weight */
/* #admin-payments .section-title,
#user-payments  .section-title{
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--brand-700);
} */

/* KPI row — tighter, brandy, subtle gradient */
.kpi-grid{
  display:grid; gap:16px;
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin: 4px 0 18px 0;
}
@media (max-width: 1200px){ .kpi-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px){  .kpi-grid{ grid-template-columns: 1fr; } }

.stat-card{
  display:flex; align-items:center; gap:14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,255,255,.90))
    ,var(--card-bg);
  border:1px solid var(--muted-200);
  border-radius: var(--radius-2xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.stat-card:hover{
  transform: translateY(-2px);
  border-color: var(--muted-300);
  box-shadow: var(--shadow-2);
}

.stat-card .icon{
  width:48px;height:48px;border-radius:14px;
  display:grid;place-items:center;
  color:#fff; font-size:18px;
  background: radial-gradient(110% 110% at 20% 20%, var(--brand-600), var(--brand-700));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.08);
}

/* KPI text */
.stat-card h3{
  margin:0; font-size:24px; line-height:1.1;
  color:var(--muted-900); font-weight:800;
  letter-spacing:.2px;
}
.stat-card p{
  margin:.25rem 0 0 0; font-size:12px; font-weight:700;
  color:var(--muted-600); letter-spacing:.25px;
}

/* Color cues per KPI (using the label line to hint) */
.stat-card.kpi-total  p{ color:var(--brand-700); }
.stat-card.kpi-billed p{ color:var(--brand-amber); }
.stat-card.kpi-due    p{ color:var(--warn-500); }
.stat-card.kpi-recv   p{ color:var(--brand-amber); }

/* Toolbar — airy, sticky feel inside section */
#admin-payments .toolbar,
#user-payments  .toolbar{
  background: var(--card-bg);
  border:1px solid var(--muted-200);
  border-radius: var(--radius-2xl);
  padding: 12px 14px;
  box-shadow: var(--shadow-1);
  display:flex; flex-wrap:wrap; gap:10px 12px; align-items:center;
}

/* Inputs & selects */
#admin-payments .toolbar input[type="date"],
#user-payments  .toolbar input[type="date"],
#admin-payments .toolbar select,
#user-payments  .toolbar select{
  height:38px; min-width: 190px;
  padding:0 12px; border-radius:10px;
  border:1px solid var(--muted-200);
  background:#fff; color:var(--muted-900);
  box-shadow: inset 0 0 0 1px rgba(6,22,68,.02);
}
#admin-payments .toolbar input[type="date"]:focus,
#user-payments  .toolbar input[type="date"]:focus,
#admin-payments .toolbar select:focus,
#user-payments  .toolbar select:focus{
  outline:none; border-color: var(--brand-amber);
  box-shadow: 0 0 0 3px rgba(239,150,17,.18);
}

/* Quick buttons + primary actions */
.btn-sm{
  font-weight:700; letter-spacing:.2px;
  border-radius:10px;
}
.btn-sm.btn-primary{
  background: var(--brand-700); border-color: var(--brand-700);
}
.btn-sm.btn-primary:hover{ filter:brightness(1.08); }
.btn-sm.btn-success{
  background: var(--brand-amber); border-color: var(--brand-amber);
}
.btn-sm.btn-warning{ background: var(--warn-500); border-color: var(--warn-500); }
.btn-sm.btn-danger{  background: var(--danger-500); border-color: var(--danger-500); }

/* Right action cluster spacing (Export/Receipts) */
#admin-payments .toolbar > div[style*="margin-left:auto"] .btn-sm,
#user-payments  .toolbar > div[style*="margin-left:auto"] .btn-sm{
  height:38px; box-shadow: var(--shadow-1);
}

/* Payment History card */
#admin-payments .card, #user-payments .card{
  border-radius: var(--radius-2xl);
  border:1px solid var(--muted-200);
  background: var(--card-bg);
  box-shadow: var(--shadow-1);
  overflow:hidden;
}
#admin-payments .card h3, #user-payments .card h3{
  padding: 16px 18px 8px 18px;
  font-weight:800; color:var(--brand-700);
}

/* Table visuals */
#payAdminHistory table, #payUserHistory table{
  width:100%; border-collapse:separate; border-spacing:0;
  font-size:14px;
}

#payAdminHistory thead th, #payUserHistory thead th{
  position:sticky; top:0; z-index:1;
  background:#fff;
  padding:12px 16px; text-align:left;
  border-bottom:1px solid var(--muted-200);
  color:var(--muted-700); font-weight:800;
}

#payAdminHistory tbody td, #payUserHistory tbody td{
  padding:12px 16px; color:var(--muted-900);
  border-bottom:1px solid var(--muted-100);
}
#payAdminHistory tbody tr:nth-child(even),
#payUserHistory  tbody tr:nth-child(even){
  background: rgba(6,22,68,.02);
}
#payAdminHistory tbody tr:hover,
#payUserHistory  tbody tr:hover{
  background: rgba(6,22,68,.05);
}

/* Numeric alignment */
#payAdminHistory td.num, #payUserHistory td.num{
  text-align:left; font-variant-numeric: tabular-nums;
}

/* “Type” badge with per-type color */
#payAdminHistory tbody td:first-child,
#payUserHistory  tbody td:first-child{
  width:92px;
}
/* #payAdminHistory tbody td:first-child::before,
#payUserHistory  tbody td:first-child::before{
  display:inline-block; padding:5px 12px;
  border-radius:9999px; font-size:12px; font-weight:800;
  letter-spacing:.2px; border:1px solid var(--muted-200);
  background: var(--muted-100); color: var(--brand-700);
} */
/* Bill vs Receipt tint (reads raw cell text safely) */

#payAdminHistory tbody tr td:first-child[data-badge="Bill"]::before,
#payUserHistory  tbody tr td:first-child[data-badge="Bill"]::before{
  background: rgba(239,150,17,.12);
  border-color: rgba(239,150,17,.28);
  color: var(--brand-amber);
}
#payAdminHistory tbody tr td:first-child[data-badge="Receipt"]::before,
#payUserHistory  tbody tr td:first-child[data-badge="Receipt"]::before{
  background: rgba(22,163,74,.12);
  border-color: rgba(22,163,74,.28);
  color: var(--ok-500);
}

/* Attachment buttons inside table */
#payAdminHistory a.btn-sm.btn-success,
#payUserHistory  a.btn-sm.btn-success{
  padding:6px 10px;border-radius:8px;
}

/* Modals (Bill/Receipt) — match shell */
#payAddBillModal .modal-content,
#payAddReceiptModal .modal-content{
  border-radius: var(--radius-2xl);
  border:1px solid var(--muted-200);
  box-shadow: var(--shadow-2);
  background:#fff;
}
#payAddBillModal .modal-header h3,
#payAddReceiptModal .modal-header h3{
  font-weight:800; color:var(--brand-700);
}
#payAddBillModal .form-group label,
#payAddReceiptModal .form-group label{ font-weight:700; color:var(--muted-700); }
#payAddBillModal .form-group input,
#payAddBillModal .form-group textarea,
#payAddBillModal .form-group select,
#payAddReceiptModal .form-group input,
#payAddReceiptModal .form-group textarea,
#payAddReceiptModal .form-group select{
  border-radius:10px; border:1px solid var(--muted-200);
  padding:10px 12px; background:#fff;
}
#payAddBillModal .form-group input:focus,
#payAddBillModal .form-group textarea:focus,
#payAddBillModal .form-group select:focus,
#payAddReceiptModal .form-group input:focus,
#payAddReceiptModal .form-group textarea:focus,
#payAddReceiptModal .form-group select:focus{
  outline:none; border-color: var(--brand-amber);
  box-shadow: 0 0 0 3px rgba(239,150,17,.18);
}

/* File preview chips */
.file-preview-list{
  margin:6px 0 0 0; padding:0; list-style:none;
  display:grid; gap:6px;
}
.file-preview-list li{
  display:grid; grid-template-columns: 20px 1fr auto;
  gap:8px; align-items:center;
  background: var(--muted-100);
  border:1px solid var(--muted-200);
  border-radius:10px; padding:6px 10px; color:var(--muted-700);
}

/* Responsive: toolbar stacks cleanly */
@media (max-width: 860px){
  #admin-payments .toolbar,
  #user-payments  .toolbar{
    display:grid; grid-template-columns: 1fr 1fr;
    align-items:center;
  }
  #admin-payments .toolbar > *:nth-last-child(-n+3),
  #user-payments  .toolbar > *:nth-last-child(-n+3){
    grid-column: 1 / -1; justify-self: end;
  }
}
@media (max-width: 560px){
  #admin-payments .toolbar,
  #user-payments  .toolbar{
    grid-template-columns: 1fr;
  }
  #admin-payments .toolbar > *:nth-last-child(-n+3),
  #user-payments  .toolbar > *:nth-last-child(-n+3){
    justify-self: stretch;
  }
  .stat-card{ padding:16px; }
  .stat-card h3{ font-size:22px; }
}

/* Sidebar Payment item — ensure icon aligns tightly */
.menu-item[data-section="payments"] i{ width:18px; text-align:center; }
/* ==============================
   Payment History — Mobile Cards (design only)
   Keeps desktop/tablet table intact; no HTML/JS changes.
   ============================== */

@media (max-width: 640px){

  /* Remove horizontal scrolling & convert the table to stacked cards */
  #payAdminHistory table,
  #payUserHistory  table{
    display:block;
    width:100%;
  }
  #payAdminHistory thead,
  #payUserHistory  thead{
    display:none; /* we'll print labels via ::before */
  }
  #payAdminHistory tbody,
  #payUserHistory  tbody{
    display:block;
  }

  /* Each row becomes a card */
  #payAdminHistory tbody tr,
  #payUserHistory  tbody tr{
    display:block;
    background:#fff;
    border:1px solid var(--muted-200);
    border-radius:14px;
    box-shadow: var(--shadow-1);
    margin:10px 0;
    overflow:hidden;
  }

  /* Cells stack vertically with label on left, value on right */
  #payAdminHistory tbody td,
  #payUserHistory  tbody td{
    display:grid;
    grid-template-columns: 130px 1fr; /* label | value */
    gap:8px;
    padding:10px 12px;
    border-bottom:1px solid var(--muted-100);
    text-align:left !important;       /* override .num */
    /* word-break: break-word;           long notes/attachments wrap */
  }
  #payAdminHistory tbody td:last-child,
  #payUserHistory  tbody td:last-child{
    border-bottom:0;
  }

  /* Column labels via nth-child (no HTML change needed) */
  #payAdminHistory tbody td:nth-child(1)::before,
  #payUserHistory  tbody td:nth-child(1)::before{ content:"Type"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(2)::before,
  #payUserHistory  tbody td:nth-child(2)::before{ content:"User"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(3)::before,
  #payUserHistory  tbody td:nth-child(3)::before{ content:"Amount"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(4)::before,
  #payUserHistory  tbody td:nth-child(4)::before{ content:"Date"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(5)::before,
  #payUserHistory  tbody td:nth-child(5)::before{ content:"Payment Days"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(6)::before,
  #payUserHistory  tbody td:nth-child(6)::before{ content:"Notes"; font-weight:700; color:var(--muted-700); }
  #payAdminHistory tbody td:nth-child(7)::before,
  #payUserHistory  tbody td:nth-child(7)::before{ content:"Attachments"; font-weight:700; color:var(--muted-700); }

  /* Make the first cell (Type) show badge cleanly on mobile */
  #payAdminHistory tbody td:first-child,
  #payUserHistory  tbody td:first-child{
    color:inherit; /* undo desktop "transparent" text */
  }
  /* Show the badge as the value, keep our label via ::before above */
  /* #payAdminHistory tbody td:first-child::before,
  #payUserHistory  tbody td:first-child::before{
    grid-column: 1 / 2;
    align-self:center;
  } */
  #payAdminHistory tbody td:first-child::after,
  #payUserHistory  tbody td:first-child::after{
    /* content: attr(data-badge); */
    justify-self: start;
    padding:5px 12px;
    border-radius:9999px;
    font-size:12px; font-weight:800; letter-spacing:.2px;
    border:1px solid var(--muted-200);
    background: var(--muted-100);
    color: var(--brand-700);
  }
  /* Hide the raw "Type" text so we only see the badge */
  #payAdminHistory tbody td:first-child > *:not(.btn-sm),
  #payUserHistory  tbody td:first-child > *:not(.btn-sm){
    display:none;
  }

  /* Tint bill/receipt badges same as desktop */
  #payAdminHistory tbody td:first-child[data-badge="Bill"]::after,
  #payUserHistory  tbody td:first-child[data-badge="Bill"]::after{
    background: rgba(239,150,17,.12);
    border-color: rgba(239,150,17,.28);
    color: var(--brand-amber);
  }
  #payAdminHistory tbody td:first-child[data-badge="Receipt"]::after,
  #payUserHistory  tbody td:first-child[data-badge="Receipt"]::after{
    background: rgba(22,163,74,.12);
    border-color: rgba(22,163,74,.28);
    color: var(--ok-500);
  }

  /* Buttons/links inside cells stretch nicely on small screens */
  #payAdminHistory a.btn-sm,
  #payUserHistory  a.btn-sm{
    width:100%;
    justify-self:start;
  }
}

/* Slight tablet tightening so columns don’t wrap awkwardly */
@media (min-width: 641px) and (max-width: 900px){
  #payAdminHistory thead th,
  #payUserHistory  thead th{ padding:10px 12px; }
  #payAdminHistory tbody td,
  #payUserHistory  tbody td{ padding:10px 12px; }
  #payAdminHistory td.num,
  #payUserHistory  td.num{ text-align:left; }
}

/* Payments: Apply button positioning/spacing */
.pay-apply-btn{
  margin-left: 8px;              /* small gap after the To-date field */
  height: 36px;
  border-radius: 10px;
  padding: 0 14px;
}

/* If your toolbar uses flex, ensure inputs + button wrap nicely */
#admin-payments .toolbar,
#user-payments  .toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;                 /* row-gap, column-gap */
  align-items: center;
}

/* Keep date inputs aligned */
#admin-payments .toolbar input[type="date"],
#user-payments  .toolbar input[type="date"]{
  min-width: 180px;
}

/* Mobile: put Apply on its own line, full width */
@media (max-width: 640px){
  .pay-apply-btn{
    flex: 1 0 100%;
    margin-left: 0;
    padding: 10px 14px;
    height: auto;
  }
}
/* =========================================
   Payments – layout fixes (no markup edits)
   ========================================= */

/* 1) Keep date range + Apply on one line (desktop/tablet) */
#admin-payments .toolbar,
#user-payments  .toolbar{
  display:flex;           /* remains flex */
  flex-wrap:wrap;
  align-items:center;
  gap:10px 12px;
}

/* Date inputs stay compact so Apply fits on the same line */
#admin-payments .toolbar input[type="date"],
#user-payments  .toolbar input[type="date"]{
  min-width: 180px;
}

/* The Apply button sits immediately after the "To" date */
#admin-payments .toolbar .pay-apply-btn,
#user-payments  .toolbar .pay-apply-btn{
  order: 5;               /* after both date inputs */
  margin-left: 8px;       /* small gap after “to” date */
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

/* 2) Action buttons wrapper (desktop = single row) */
#admin-payments .toolbar .pay-actions,
#user-payments  .toolbar .pay-actions{
  order: 99;              /* float to the right end */
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Ensure the four actions are treated uniformly */
#admin-payments .toolbar .pay-actions .btn-sm,
#user-payments  .toolbar .pay-actions .btn-sm{
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-1);
}

/* ========== Mobile behavior ========== */
@media (max-width: 640px){
  /* Apply goes full width beneath the dates */
  #admin-payments .toolbar .pay-apply-btn,
  #user-payments  .toolbar .pay-apply-btn{
    order: 30;
    flex: 1 0 100%;
    margin-left: 0;
    height: auto;
    padding: 10px 14px;
  }

  /* Four actions become a 2×2 grid */
  #admin-payments .toolbar .pay-actions,
  #user-payments  .toolbar .pay-actions{
    order: 40;
    width: 100%;
    margin-left: 0;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  #admin-payments .toolbar .pay-actions .btn-sm,
  #user-payments  .toolbar .pay-actions .btn-sm{
    width: 100%;
    justify-content: center;
    height: 42px;
  }
}

/* KPI row – auto-fit so 4 or 5 cards still look perfect */
.kpi-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 4px 0 18px 0;
}

/* Optional: color hint for the new "Total Pending" */
.stat-card.kpi-pending p{ color: var(--brand-amber); } /* or var(--warn-500) */

/* ===== COA analysis grid ===== */
.analysis-box { background: var(--bg-card); border-radius: 14px; padding: 12px; }
.analysis-header { display:flex; align-items:center; gap:12px; justify-content: space-between; margin-bottom:8px; }
.analysis-table .analysis-row { border:1px solid var(--border); border-radius:12px; padding:10px; margin-bottom:10px; background: var(--bg-card); }
.analysis-row .row-grid { display:grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap:10px; align-items:end; }
.analysis-row .cell label { display:block; font-size:.9rem; margin-bottom:4px; color: var(--text-secondary); }
.analysis-row input { width: 100%; padding: 10px 12px; border: none; border-radius: 10px; background: var(--bg-primary); box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light); }

.suggestions { position: absolute; z-index: 50; background:#fff; border:1px solid var(--border); border-radius: 8px; margin-top: 4px; box-shadow: 8px 8px 20px var(--shadow-dark), -8px -8px 20px var(--shadow-light); max-height: 160px; overflow:auto; }
.suggest-item { padding:8px 12px; cursor:pointer; }
.suggest-item:hover { background: var(--row-hover); }

/* responsive */
@media (max-width: 900px){
  .analysis-row .row-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== COA lists (Admin & User) ===== */
.orders-list{
  display: grid;
  gap: 16px;
}
@media (min-width: 1100px){
  /* slightly wider breathing room on large screens */
  .orders-list{ gap: 0px; }
}

.order-card.list-card{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 8px 8px 24px var(--shadow-dark), -8px -8px 24px var(--shadow-light);
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
}

.order-card.list-card:hover{
  transform: translateY(-1px);
  box-shadow: 10px 10px 28px var(--shadow-dark), -10px -10px 28px var(--shadow-light);
  border-color: rgba(0,0,0,.06);
}

.order-card .order-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.order-card .order-head strong{
  font-size: 1.06rem;
  letter-spacing: .2px;
}
.order-card .muted{
  color: var(--text-secondary);
  font-weight: 500;
}

.order-card .order-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-card .btn-sm{
  border-radius: 10px;
  height: 38px;
  box-shadow: var(--shadow-1);
}

@media (max-width: 640px){
  .order-card .order-head{ flex-direction: column; align-items: flex-start; gap: 6px; }
  .order-card .order-actions{ width: 100%; }
  .order-card .btn-sm{ flex: 1 0 auto; }
}

/* Section header hint alignment (user panel) */
#user-productReports .section-header .hint{
  color: var(--text-secondary);
  font-size: .95rem;
}

/* Inventory accents */
.inv-rm { --inv-accent: #0f766e; --inv-bg: #e6fffb; }
.inv-pm { --inv-accent: #9d174d; --inv-bg: #fdf2f8; }

.inv-tag {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:12px; font-weight:700; font-size:.8rem;
  background: var(--inv-bg); color: var(--inv-accent);
}

/* Inventory compact table responsive helpers */
.orders-table.responsive .table-header,
.orders-table.responsive .table-row {
  gap: 12px;
}

@media (max-width: 1024px) {
  .orders-table.responsive .table-header,
  .orders-table.responsive .table-row {
    grid-template-columns: repeat(2, minmax(120px,1fr)) !important;
  }
  .orders-table.responsive .table-header > div:nth-child(n+7),
  .orders-table.responsive .table-row   > div:nth-child(n+7) {
    display: none; /* hide Rate + Actions on narrow screens; user can open Details */
  }
}

@media (max-width: 640px) {
  .orders-table.responsive .table-header,
  .orders-table.responsive .table-row {
    grid-template-columns: 1fr !important;
  }
}

.table-row.user-card.clickable:hover {
  background: #f9fafb;
  transform: translateY(-2px);
  transition: all 0.2s ease-in-out;
}

/* ==========================================================
   INVENTORY LIST – SAME LOOK AS MANAGE ORDERS / USERS
   MOBILE-FIRST + MIN-WIDTH BREAKPOINTS
   ========================================================== */

/* ---------- Base (extra small phones < 576px) ---------- */
.table-row.user-card.inv-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-primary);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px;
  box-shadow: none;
  transition: transform .08s ease,
              box-shadow .08s ease,
              border-color .08s ease;
}

.table-row.user-card.inv-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  border-color: rgba(0,0,0,.06);
}

/* single-column stack on very small screens */
.inv-grid {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 8px;
}

/* field block */
.inv-col {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-size: 0.9rem;
}

/* product can wrap */
.inv-col.product {
  font-weight: 500;
}

/* labels & values */
.inv-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.inv-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* pill */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 700;
}
.pill-danger { background:#fee2e2; color:#b91c1c; }
.pill-success{ background:#ecfdf5; color:#065f46; }

/* actions take full row on tiny screens */
.inv-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.inv-actions .btn-sm {
  white-space: nowrap;
}

/* ==========================================================
   Small devices (landscape phones) ≥ 576px
   ========================================================== */
@media (min-width: 576px) {
  .table-row.user-card.inv-card {
    margin: 10px 12px;
    padding: 14px 16px;
  }

  .inv-grid {
    grid-template-columns: 1fr 1fr;   /* 2 columns */
    column-gap: 16px;
    row-gap: 8px;
  }

  .inv-col {
    width: auto;
  }

  .inv-actions {
    grid-column: 1 / -1;             /* own row */
  }
}

/* ==========================================================
   Tablets ≥ 768px
   ========================================================== */
@media (min-width: 768px) {
  .table-row.user-card.inv-card {
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    box-shadow: 8px 8px 24px var(--shadow-dark),
                -8px -8px 24px var(--shadow-light);
  }

  .inv-grid {
    grid-template-columns:
      minmax(220px, 2fr)  /* Product */
      minmax(200px, 1.6fr)/* User    */
      minmax(150px, 1.2fr)/* On-hand */
      1fr;                /* Last move / Rate mix or rate only */
    column-gap: 20px;
  }

  .inv-actions {
    grid-column: auto;
    justify-content: flex-end;
    width: auto;
  }
}

/* ==========================================================
   Laptops ≥ 992px
   ========================================================== */
@media (min-width: 992px) {
  .table-row.user-card.inv-card {
    margin: 10px 0;
  }

  .inv-grid {
    /* Product | User | On-hand | Last Move | Rate | Actions */
    grid-template-columns:
      minmax(220px, 2fr)
      minmax(180px, 1.4fr)
      minmax(130px, 1fr)
      minmax(180px, 1.4fr)
      minmax(110px, 1fr)
      auto;
    column-gap: 22px;
    row-gap: 6px;
  }

  .inv-col.onhand,
  .inv-col.last-move,
  .inv-col.rate {
    white-space: nowrap;
  }

  .inv-actions {
    justify-self: end;
  }
}

/* ==========================================================
   Desktops ≥ 1200px  (primary “ideal” layout)
   ========================================================== */
@media (min-width: 1200px) {
  .table-row.user-card.inv-card {
    padding: 16px 20px;
  }

  .inv-grid {
    grid-template-columns:
      minmax(240px, 2.1fr)   /* Product */
      minmax(190px, 1.4fr)   /* User    */
      minmax(130px, 1fr)     /* On-hand */
      minmax(200px, 1.6fr)   /* Last Move */
      minmax(120px, 1fr)     /* Rate    */
      auto;                  /* Actions */
    column-gap: 24px;
  }
}

/* ==========================================================
   Large desktops ≥ 1400px
   ========================================================== */
@media (min-width: 1400px) {
  .table-row.user-card.inv-card {
    padding: 18px 24px;
  }

  .inv-grid {
    column-gap: 32px;
  }
}

/* Inventory sub-page breadcrumb / back button */
.inv-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.inv-crumb-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--primary-color);
  font-size: 0.85rem;
  cursor: pointer;
}

.inv-back-btn i {
  font-size: 0.75rem;
}

.inv-back-btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

/* ==========================================================
   ADMIN INVENTORY REPORT – PROFESSIONAL UI
   ========================================================== */

.inv-report-page {
  padding-bottom: 40px;
}

.inv-report-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1250px;
}

.inv-report-tabs-wrapper {
  /* JS injects toolbar here */
}

#invReportsAdminToolbar {
  display: inline-flex;
  gap: 10px;
  padding: 10px 16px;
  background: #fff;
  border-radius: 50px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 25px rgba(15,23,42,0.08);
}

#invReportsAdminToolbar .inv-rpt-tab {
  padding: 8px 22px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #f8fafc;
  color: #374151;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

#invReportsAdminToolbar .inv-rpt-tab:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #1e293b;
}

#invReportsAdminToolbar .inv-rpt-tab.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* MAIN CARD */
.inv-report-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15,23,42,0.08);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

/* SUMMARY HEADER */
.inv-report-summary {
  display: flex;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(90deg, #f8fafc, #eef2ff);
  border-bottom: 1px solid #e5e7eb;
}

.inv-summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.inv-summary-sub {
  font-size: 0.8rem;
  color: #6b7280;
}

.inv-summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #000;
  letter-spacing: 0.02em;
}

/* REPORT BODY */
.inv-report-body {
  padding: 16px 20px;
}

/* Tables inside the report */
.inv-report-body .table-header,
.inv-report-body .table-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.inv-report-body .table-header {
  background: #f9fafb;
  font-weight: 700;
  color: #6b7280;
}

.inv-report-body .table-row:nth-child(odd) {
  background: #fcfcff;
}

.inv-report-body .table-row:hover {
  background: #eef2ff;
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  #invReportsAdminToolbar {
    flex-wrap: wrap;
    border-radius: 18px;
  }
  .inv-report-summary {
    flex-direction: column;
    gap: 6px;
  }
  .inv-summary-value {
    font-size: 1.1rem;
  }
}

/* ===== Inventory Reports – summary bar (desktop + mobile) ===== */
.inv-rpt-summary-bar {
  margin: 12px 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.inv-rpt-summary-title {
  font-weight: 600;
}

.inv-rpt-summary-value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Total tab cards spacing */
.inv-rpt-total-cards {
  margin-top: 8px;
}

/* ===== MOBILE LAYOUT ONLY – make each row a labelled card ===== */
@media (max-width: 768px) {
  /* Hide table header in reports on small screens */
  #invReportsAdmin .table-header {
    display: none;
  }

  /* Turn each row into its own card with internal labelled lines */
  #invReportsAdmin .table-row {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f4;
  }

  #invReportsAdmin .table-row > div {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.85rem;
    padding: 2px 0;
  }

  /* Left side label (Product, Type, On-hand, etc.) */
  #invReportsAdmin .table-row > div::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 12px;
  }

  /* Make value wrap nicely */
  #invReportsAdmin .table-row > div {
    word-break: break-word;
    text-align: right;
  }

  /* Summary bar: stack on small screens */
  .inv-rpt-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
/* ==========================================================
   Inventory Reports – TOTAL fancy summary cards
   ========================================================== */

.inv-rpt-total-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

/* Base card */
.inv-total-card {
  position: relative;
  padding: 16px 18px 18px;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at top left, #eef2ff 0, #f9fafb 40%, #ffffff 100%);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* subtle colour band on top */
.inv-total-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.25), rgba(236, 72, 153, 0.15));
  opacity: 0.3;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* layout inside card */
.inv-total-card-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-total-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0f172a;
}

.inv-total-sub {
  font-size: 0.8rem;
  color: #64748b;
}

.inv-total-card-main {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.inv-total-figure {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.02em;
}

/* circular icon chip on the right */
.inv-total-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.9), rgba(79, 70, 229, 0.8));
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.45);
}

.inv-total-icon i {
  font-size: 1.15rem;
}

/* colour accents per card */
.inv-total-card--rm .inv-total-icon {
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.9), rgba(79, 70, 229, 0.9));
  box-shadow: 0 12px 26px rgba(79, 70, 229, 0.55);
}

.inv-total-card--pm .inv-total-icon {
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.95), rgba(192, 38, 211, 0.9));
  box-shadow: 0 12px 26px rgba(192, 38, 211, 0.55);
}

.inv-total-card--products .inv-total-icon {
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.95), rgba(56, 189, 248, 0.95));
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.55);
}

.inv-total-card--value .inv-total-icon {
  background: radial-gradient(circle at 30% 0, rgba(255, 255, 255, 0.95), rgba(16, 185, 129, 0.95));
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.55);
}

/* Hover micro-interaction (desktop) */
@media (hover: hover) and (pointer: fine) {
  .inv-total-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  .inv-total-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 22px 50px rgba(15, 23, 42, 0.16),
      0 0 0 1px rgba(148, 163, 184, 0.18);
  }
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .inv-rpt-total-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .inv-total-card {
    padding: 14px 14px 16px;
    border-radius: 16px;
  }
  .inv-total-figure {
    font-size: 1.2rem;
  }
}

/* ===== Inventory Reports – User drill-down ===== */

.inv-user-summary-head {
  margin-top: 12px;
}

.inv-user-summary {
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.inv-user-summary:hover {
  background: #f1f5f9;
}

.inv-user-summary.active {
  background: #e0edff;
  box-shadow: inset 2px 0 0 var(--brand-navy-600);
}

.inv-user-breakdown {
  margin-top: 18px;
}

.inv-user-breakdown-card {
  margin-top: 4px;
  background: var(--bg-card, #ffffff);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
  padding: 16px 18px 14px;
}

.inv-user-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.inv-user-breakdown-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.inv-user-breakdown-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.inv-user-breakdown-total {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.inv-user-breakdown-total strong {
  display: block;
  font-size: 1.02rem;
  color: var(--text-primary);
}

/* Small screens – stack header nicely */
@media (max-width: 600px) {
  .inv-user-breakdown-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .inv-user-breakdown-total {
    text-align: left;
  }
}

.inv-rpt-header-row {
  margin: 12px 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-primary);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}

.inv-rpt-header-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-rpt-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.inv-rpt-title {
  font-weight: 600;
  color: var(--text-primary);
}

.inv-rpt-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.inv-rpt-value {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Search box reused from Repeat Order */
.inv-rpt-search {
  min-width: 220px;
  max-width: 260px;
}

@media (max-width: 768px) {
  .inv-rpt-header-row {
    align-items: flex-start;
  }

  .inv-rpt-header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .inv-rpt-search {
    width: 100%;
    max-width: none;
  }
}
/* ===== Inventory – Stock Ledger modal ===== */

.inv-ledger-table {
  margin-top: 4px;
}

/* Column layout inside ledger modal */
.inv-ledger-table .table-header,
.inv-ledger-table .table-row {
  grid-template-columns:
    90px          /* Type   */
    80px          /* Qty    */
    110px         /* Rate   */
    minmax(160px, 1.5fr) /* Notes  */
    170px;        /* Date   */
}

/* Slight zebra striping for better readability */
.inv-ledger-table .table-row:nth-child(odd) {
  background: rgba(15, 23, 42, 0.02);
}

/* Compact text in the small modal */
.inv-ledger-table .table-header > div,
.inv-ledger-table .table-row > div {
  font-size: 13px;
}

/* Empty state inside ledger modal */
.inv-ledger-empty {
  padding: 18px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Mobile: let the ledger stay readable inside the modal */
@media (max-width: 768px) {
  .inv-ledger-table .table-header {
    display: none;
  }

  .inv-ledger-table .table-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .inv-ledger-table .table-row > div {
    font-size: 12px;
  }

  .inv-ledger-table .table-row > div:nth-child(1),
  .inv-ledger-table .table-row > div:nth-child(3) {
    font-weight: 600;
  }
}
