/*
  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 {
  background: var(--bg-card);
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px var(--shadow-dark), 0 -2px 8px var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.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; }

