/* === SOP Progress Bar === */
.progress-bar {
  height: 14px;
  border-radius: 999px;
  transition: width 0.35s ease;
  background: linear-gradient(90deg, #ffcf43, #ff416c);
  box-shadow: 0 8px 18px rgba(255, 65, 108, 0.25);
}

.progress-low {
  background: linear-gradient(90deg, #ff4b2b, #ff416c);
}

.progress-mid {
  background: linear-gradient(90deg, #ffc857, #ff8c42);
}

.progress-high {
  background: linear-gradient(90deg, #30c67c, #0fb67a);
}
:root {
  --sop-primary: #fe3232;
  --sop-secondary: #f94343;
  --sop-accent: #ffb347;
  --sop-surface: rgba(255, 255, 255, 0.95);
  --sop-surface-alt: rgba(255, 255, 255, 0.85);
  --sop-border: rgba(255, 65, 108, 0.18);
  --sop-muted: #6b7280;
  --sop-input-bg: rgba(255, 255, 255, 0.92);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
a {
  color: var(--sop-primary);
}
@font-face {
  font-family: "Good Time Grotesk";
  src: url("/static/fonts/grotesk.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

body.flex {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

span {
  text-align: center;
}

body {
  background: linear-gradient(180deg, #fdf5f4, #f1f4ff);
}

body.sop-generator-page {
  min-height: 100vh;
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.35),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 0%,
      rgba(255, 255, 255, 0.35),
      transparent 40%
    ),
    linear-gradient(135deg, #fff5f1, #f6f4ff);
  background-attachment: fixed;
}

.sop-generator-page .main-container {
  width: min(1200px, 96%);
  margin: 40px auto;
  padding: 40px 45px;
  border-radius: 36px;
  background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.95),
      rgba(255, 255, 255, 0.75)
    )
    border-box;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(18px);
  box-shadow: 0 35px 80px rgba(15, 15, 35, 0.18);
}

.sop-generator-page .sop-highlight {
  width: min(1100px, 94%);
  margin: 40px auto 24px;
  text-align: center;
  color: #1c1f2b;
}
.sop-generator-page .sop-highlight .headline {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sop-primary);
  margin-bottom: 10px;
}
.sop-generator-page .sop-highlight h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 16px;
  font-family: Arial, Helvetica, sans-serif;
}
.sop-desc
{
  background: #ffe7ee;
    padding: 20px;
    margin-top: 20px;
    border-radius: 10px;
}
.sop-generator-page .form-container {
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
  padding: 0 36px 0px;
  position: relative;
}
.sop-generator-page .form-container::before {
  content: none;
}

.sop-generator-page .form-section {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 247, 248, 0.92)
  );
  border-radius: 28px;
  padding: 52px 36px 40px;
  box-shadow: 0 24px 45px rgba(12, 18, 53, 0.08);
  margin-bottom: 36px;
  border: 1px solid var(--sop-border);
  position: relative;
  overflow: hidden;
}
.sop-generator-page .form-section::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 6px;
  background: linear-gradient(90deg, var(--sop-secondary), var(--sop-primary));
  border-radius: 30px 30px 0 0;
  opacity: 0.85;
}
.sop-generator-page .form-section > * {
  position: relative;
}
.sop-generator-page .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sop-generator-page .section-header h1.form-title {
  margin-bottom: 0;
}
.sop-generator-page h1.form-title {
  font-size: 18px;
  color: #fff;
  margin-bottom: 22px;
  margin-left: -36px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  padding: 8px 30px 10px 64px;
  background: #050505;
  border-radius: 0 24px 24px 0;
  position: relative;
  isolation: isolate;
  min-height: 36px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}
.sop-generator-page h1.form-title::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 0;
  width: 58px;
  height: 100%;
  background: var(--sop-primary);
  z-index: -1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
th,
td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}
th {
  background-color: #f2f2f2;
}
h1,
h2,
h3,
h4,
h5 {
  font-family: "Good Time Grotesk", sans-serif;
}

.logo-container {
  display: inline-block;
}
a._link {
  color: #ff3232;
}
.logo {
  max-width: 130px; /* Adjust based on logo size */
  height: auto;
}
.sp-replacer {
  width: 100%;
  height: 42px;
}
.sp-preview {
  height: 31px;
  width: 38px;
}
.sp-dd {
  line-height: 31px;
}
.fa-solid {
  font-size: 24px;
  color: #ff3232;
}
.active .fa-solid {
  color: #ffffff;
}
.add-row-btn .fa-solid {
  font-size: 24px;
  color: #ff3232;
  vertical-align: middle;
}
.add-row-btn:hover .fa-solid {
  color: #ffffff;
}
.break {
  display: block;
  margin-top: 10px;
  margin-bottom: 10px;
}
.hide {
  display: none !important;
}

body.dependant-mode .hide_in_dependant {
  display: none !important;
}
.show {
  display: block;
}
.show_flex {
  display: flex;
}
.show_inline {
  display: inline;
}
.show_inline_block {
  display: inline-block;
}
.display-block {
  display: block;
}
.inline-block {
  display: inline-block;
}
.inline {
  display: inline;
}

/* .sidebar, .sidebar-item {
  display: none !important;
} */

/* Sidebar */
.admin-sidebar {
  width: 280px;
  flex: 0 0 280px;
  min-width: 280px;
  background: linear-gradient(180deg, #0f111a, #181d2c);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
}
.admin-sidebar-header {
  text-align: center;
  padding: 16px 20px 30px;
}
.admin-sidebar-header img {
  width: 130px;
  filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.35));
}
.admin-sidebar-nav ul {
  list-style: none;
  padding: 0 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  transition: all 0.25s ease;
}
.admin-sidebar-nav li a .admin-sidebar-icon {
  font-size: 16px;
}
.admin-sidebar-nav li a:hover,
.admin-sidebar-nav li a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.admin-topbar {
  position: fixed;
  right: 22px;
  top: 18px;
  z-index: 1000;
}
.admin-topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.topbar-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 75, 43, 0.18);
}
.topbar-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe7e0;
  color: #ff4b2b;
  font-weight: 800;
  font-size: 14px;
}
.topbar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}
.topbar-logout {
  font-size: 13px;
  color: #ef4444;
  font-weight: 700;
  text-decoration: none;
}
.topbar-logout:hover {
  text-decoration: underline;
}

.main-container {
  overflow: visible;
}

.form-container {
  overflow-y: auto;
  padding-bottom: 40px;
}

.form-section {
  display: none;
  position: relative;
}

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

.form-title {
  font-size: 34px;
  color: #111a2c;
  margin-bottom: 26px;
  font-weight: 700;
  text-align: left;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
h4.form-title {
  font-size: 16px;
  text-align: left;
  border: none;
  margin-top: 28px;
  margin-bottom: 16px;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #1f2a37;
  letter-spacing: 0.2px;
}
.ai-sensitivity-group {
  background: linear-gradient(135deg, rgba(255, 75, 43, 0.08), rgba(255, 255, 255, 0.85));
  padding: 18px 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 65, 108, 0.2);
  box-shadow: 0 18px 40px rgba(15, 15, 35, 0.08);
}
.ai-sensitivity-toggle {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.ai-sensitivity-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.ai-sensitivity-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 65, 108, 0.3);
  font-weight: 600;
  color: #b91c1c;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.ai-sensitivity-toggle input:checked + .ai-sensitivity-pill {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  color: #fff;
  box-shadow: 0 18px 40px rgba(255, 65, 108, 0.35);
}
.ai-sensitivity-pill i {
  font-size: 16px;
}
.ai-sensitivity-note {
  color: #b45309 !important;
  font-style: normal;
  margin-bottom: 0;
}
.dependant-card {
  margin-top: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 65, 108, 0.2);
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 75, 43, 0.08), rgba(255, 255, 255, 0.92));
  box-shadow: 0 18px 40px rgba(15, 15, 35, 0.08);
}
.dependant-card.hide {
  display: none;
}
.dependant-mode #dependant-toggle-card {
  display: none !important;
}
.dependant-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
}
.dependant-card-header h4 {
  margin: 0;
  font-size: 16px;
}
.dependant-section {
  margin-top: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 65, 108, 0.18);
  padding: 22px 20px;
  background: #fff8f8;
  box-shadow: 0 18px 36px rgba(15, 15, 35, 0.08);
}
.dependant-section.hide {
  display: none;
}
.dependant-section-title {
  margin: 0 0 16px;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b91c1c;
}
p.field-help {
    font-size: 14px;
    font-style: italic;
    color: #cccccc;
    margin-top: 10px;
}
.form-control,
.select2-container--default .select2-selection--multiple {
  width: 100% !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(124, 77, 255, 0.22) !important;
  font-size: 15px !important;
  background-color: var(--sop-input-bg) !important;
  border-radius: 18px !important;
  margin: 0;
  color: #101828 !important;
  box-shadow: 0 16px 36px rgba(19, 22, 41, 0.08);
  transition: border 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.form-control:focus,
.select2-container--default .select2-selection--multiple:focus {
  border-color: var(--sop-primary) !important;
  box-shadow: 0 24px 45px rgba(255, 65, 108, 0.25);
  transform: translateY(-1px);
}
.form-control::placeholder {
  color: var(--sop-muted);
  opacity: 0.8;
}
.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice__remove {
  position: relative;
  color: white;
  border: none;
}
span.select2-dropdown.select2-dropdown--above,
span.select2-results {
  max-width: 600px;
}
.form-row {
  display: flex;
  gap: 22px;
  margin-bottom: 24px;
}

.form-row .form-group {
  flex: 1;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.preview-container {
  width: 60%;
  background-color: #2f3542;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.sop-preview {
  flex: 1;
  background-color: white;
  padding: 40px;
  overflow-y: auto;
  margin-bottom: 20px;
  border-radius: 4px;
}

.sop-title {
  font-size: 28px;
  color: #333;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

.sop-contact {
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}

.sop-section {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: bold;
  color: #000000;
}

.sop-subsection {
  margin-top: 15px;
  margin-bottom: 5px;
  font-size: 16px;
  font-weight: bold;
  color: #555;
}

.sop-date {
  font-style: italic;
  color: #777;
  margin-bottom: 5px;
  font-size: 14px;
}

.sop-text {
  margin-bottom: 15px;
  font-size: 14px;
  color: #000000;
  line-height: 1.5;
}
.sop-greeting {
  margin-bottom: 20px;
}
.greeting-line {
  margin: 0;
  line-height: 1.4;
}
.greeting-line + .greeting-line {
  margin-top: 4px;
}

.sop-signoff {
  margin-top: 24px;
}

.signoff-line {
  line-height: 1.4;
}
.signoff-line + .signoff-line {
  margin-top: 0;
}
.contact-line {
  margin-top: 2px;
}
.signoff-line.signoff-thanks {
  margin-bottom: 18px;
}
.download-options {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.format-option {
  margin: 0 10px;
  color: white;
  display: flex;
  align-items: center;
}

.format-option label {
  margin-left: 5px;
  font-size: 14px;
}

.admin-inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.admin-stack-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.admin-inline-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.admin-pill-btn {
  background-color: #ff3232;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.admin-pill-btn.small {
  padding: 4px 12px;
  font-size: 12px;
}

.admin-pill-btn.secondary {
  background-color: #fff;
  color: #ff3232;
  border: 1px solid #ff3232;
}

.admin-pill-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.order-actions-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-actions-cell form {
  margin: 0;
}

.orders-table th.select-col,
.orders-table td.select-col {
  width: 40px;
  text-align: center;
}

.orders-table .order-select {
  transform: scale(1.1);
}


.country-cell {
  position: relative;
}

.country-display {
  position: relative;
  padding-right: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.country-edit-link {
  position: absolute;
  top: 2px;
  right: 0;
  font-size: 13px;
  color: #9aa1b3;
  text-decoration: none;
  transition: color 0.2s ease;
}

.country-edit-link:hover {
  color: #ff3232;
}

.country-edit-link i {
  font-size: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.drive-link-btn {
  display: inline-block;
    padding: 5px 12px;
    border-radius: 18px;
    border: none;
    margin-right: 6px;
    text-decoration: none;
    font-size: 13px;
    background-color: #ff3232;
    color: #fff;
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

.drive-link-btn.add-documents-toggle {
  background-color: transparent;
  color: #374151;
  border: 1px dashed #d4dbe6;
}

.drive-link-btn.add-documents-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.drive-link-btn.secondary {
  background-color: #fff;
  color: #ff3232;
  border: 1px solid #ff3232;
}

.drive-link-btn.tertiary {
  background-color: #fef9c3;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.drive-links-wrap {
  margin-bottom: 6px;
}

.inline-upload {
  margin: 10px 0 16px;
  padding: 10px 12px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fafbff;
  width: 100%;
}
.inline-upload.hide {
  display: none;
}
.inline-upload .upload-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 6px 0;
}
.inline-upload .small-input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
}
.inline-upload .upload-title {
  display: block;
  margin-bottom: 8px;
}
.inline-upload .upload-hint {
  margin-top: 8px;
}
.file-pill-wrapper {
  position: relative;
}
.file-pill-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  color: #f43f5e;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
  min-height: 38px;
}
.file-pill:hover {
  border-color: #fca5a5;
  background: #fff5f7;
}

.doc-action-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.doc-action-buttons.inline {
  flex-direction: row;
  align-items: center;
}
.tools-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.doc-action-buttons.inline .admin-pill-btn {
  min-width: 0;
  padding: 8px 14px;
  font-size: 13px;
}

.admin-pill-btn.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  min-width: 148px;
  justify-content: center;
  font-size: 12px;
}
.admin-pill-btn.danger-pill {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: #fff;
  min-width: 148px;
  justify-content: center;
  font-size: 14px;
}

.admin-pill-btn.danger.outlined {
  background: #fff;
  color: #dc2626;
  border: 1px solid #dc2626;
}

.add-documents-form {
  display: none;
  margin-top: 8px;
  padding: 20px 24px;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
}

.add-documents-form.open {
  display: block;
}

.add-document-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.add-document-row input {
  border: 1px solid #d4dbe6;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}

@media (min-width: 768px) {
  .add-document-row {
    flex-direction: row;
  }
  .add-document-row input {
    flex: 1;
  }
}

.add-documents-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 10px 0 10px;
}

.table-actions {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.action-toggle {
  background: #f5f5f7;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #555;
  transition: background 0.2s ease;
}
.action-toggle:hover {
  background: #ececf2;
}
.action-menu {
  position: absolute;
  top: 42px;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(13, 15, 28, 0.16);
  padding: 8px 0;
  min-width: 160px;
  display: none;
  z-index: 10;
}
.table-actions.open .action-menu {
  display: block;
}
.action-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-size: 14px;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: #222;
}
.action-menu a.action-item {
  text-decoration: none;
}
.action-item:hover {
  background: rgba(255, 50, 50, 0.08);
}
.action-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hidden-form {
  display: none;
}

.deliver-form {
  display: flex;
}

.admin-pill-btn.deliver {
  width: 100%;
  justify-content: center;
}

.payment-summary span {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.order-layout {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.order-layout-primary {
  grid-template-columns: minmax(0, 1fr);
}

.order-layout-secondary {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
  .order-layout-primary {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.5fr);
  }
  .order-layout-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.order-panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  padding: 22px 24px;
  box-shadow: 0 40px 80px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
}

.order-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.order-documents-delete-form {
  margin-left: auto;
}
.order-documents-delete-form button {
  border: none;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
}
.order-documents-delete-form button:hover {
  background: rgba(239, 68, 68, 0.15);
}

.documents-warning {
  margin-bottom: 16px;
}

.panel-link {
  font-size: 13px;
  color: #2563eb;
  text-decoration: none;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 12px;
  text-transform: capitalize;
  font-weight: bold;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.panel-field {
  background: #f8fafc;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-field span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.panel-field strong {
  font-size: 15px;
  color: #111827;
}

.panel-field.full {
  grid-column: 1 / -1;
}

.narrow-panel .panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-profile-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}

.link-profile-form label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.link-profile-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.link-profile-grid input {
  border: 1px solid #d4dbe6;
  border-radius: 10px;
  padding: 8px 10px;
}

.link-profile-grid .admin-pill-btn {
  width: auto;
  justify-self: start;
}

.order-status-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.order-status-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.ai-flag-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-flag-label {
  font-size: 14px;
  color: #0f172a;
  font-weight: 600;
}

.status-select, .datetime-picker,  .select2-container--default .select2-selection--single{
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  padding: 8px 10px;
  font-size: 14px;
  height: 40px !important;
}
.select2-results__option--selectable {
  font-size: 14px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  text-align: left !important;
  line-height: 22px !important;
}

.order-status-form .admin-pill-btn {
  width: auto;
  align-self: flex-start;
  padding-left: 26px;
  padding-right: 26px;
}

.order-action-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.order-action-shortcuts .order-shortcut {
  flex: 1 1 calc(50% - 10px);
  min-width: 180px;
  justify-content: center;
  text-align: center;
}

.order-action-shortcuts .order-generator-link {
  flex: 1 1 calc(50% - 10px);
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.order-generator-link > .admin-pill-btn {
  width: 100%;
  display: inline-flex;
  justify-content: center;
}
.order-generator-link p {
  margin: 4px 0 0;
  text-align: center;
}
.order-action-shortcuts .deliver-form {
  flex: 1 1 calc(50% - 10px);
  min-width: 180px;
}
.order-action-shortcuts .deliver-form .admin-pill-btn {
  width: 100%;
  justify-content: center;
  background: transparent;
  color: #ff3232;
  border: 1px solid #ff3232;
}

.order-panel.notes-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-note-card {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.order-note-card.internal {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.3);
}
.order-note-card.external {
  background: #e0f2fe;
  border-color: rgba(59, 130, 246, 0.4);
}
.order-note-card.external .order-note-body {
  color: #0f172a;
}
.order-note-body {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #111827;
}
.order-note-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}
.order-note-delete-form button {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}
.order-note-delete-form button:hover {
  color: #ef4444;
}
.order-note-form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  padding: 10px 12px;
  font-family: inherit;
  resize: vertical;
  font-size: 14px;
}
.order-note-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}
.order-note-form button {
  margin-top: 8px;
}
.order-note-form .checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin: 6px 0 10px;
}
.preserve-lines {
    white-space: pre-wrap;
}

.customer-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px 0 4px;
}

.customer-chip {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

.customer-chip span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}

.customer-chip strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: #0f172a;
}

@media (max-width: 640px) {
  .link-profile-grid {
    grid-template-columns: 1fr;
  }
  .link-profile-grid .admin-pill-btn {
    justify-self: stretch;
    width: 100%;
  }
}

.deliver-form-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.muted-text.tiny {
  font-size: 12px;
  color: #9ca3af;
}

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

.payment-history-section {
  margin-top: 18px;
}
.payment-history-heading h3 {
  margin: 0;
  font-size: 16px;
}
.payment-history-table {
  margin-top: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.payment-history-section .payment-history-add-row {
  margin-top: 10px;
}
.payment-history-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 40px;
  gap: 10px;
  padding: 10px 14px;
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}
.payment-history-row + .payment-history-row {
  padding-top: 12px;
}
.payment-history-row:last-child {
  border-bottom: none;
}
.payment-history-row.header {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}
.payment-history-row input[type="number"],
.payment-history-row input[type="text"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #fdfdfd;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
}
.history-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
}
.history-remove:hover {
  color: #ef4444;
}

.drive-panel .metadata-header {
  margin-bottom: 18px;
}

.drive-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.add-documents-form {
  margin-top: 18px;
}

.drive-panel .add-documents-form {
  margin-top: 18px;
}

.drive-manage-trigger {
  margin-bottom: 18px;
}

.drive-panel .add-documents-toggle {
  width: 100%;
  height: 150px;
  border-radius: 24px;
  border: 1px dashed #d4dbe6;
  background: #fdfefe;
  color: #475569;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.drive-panel .add-documents-toggle:hover {
  border-color: #94a3b8;
  color: #1f2937;
}

.payment-panel .metadata-header {
  margin-bottom: 16px;
}

.metadata-card {
  margin-top: 4px;
  position: relative;
}
.metadata-card.full-width {
  width: 100%;
  margin-top: 32px;
}
.metadata-card .metadata-toggle {
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.metadata-card .metadata-toggle i {
  transition: transform 0.2s ease;
}
.metadata-card.collapsed .metadata-toggle i {
  transform: rotate(-90deg);
}
.metadata-card .metadata-toggle:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #0f172a;
}
.metadata-card .metadata-content {
  margin-top: 16px;
}
.metadata-card.collapsed .metadata-content {
  display: none;
}
.meta-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meta-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.meta-form select,
.meta-form input,
.meta-form textarea {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.meta-form label {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  display: block;
  margin-bottom: 6px;
}
.meta-form textarea {
  min-height: 100px;
  resize: vertical;
}
.meta-form .meta-actions {
  display: flex;
  gap: 10px;
}
.meta-form .meta-actions .admin-pill-btn {
  align-self: flex-start;
}

.payment-stat {
  background: #f8fafc;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  align-items: center;
}

.payment-stat span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.payment-stat strong {
  font-size: 15px;
  color: #0f172a;
}

.payment-history-display {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.7);
}
.payment-history-display-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.payment-history-display-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.payment-history-display-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.payment-history-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  align-items: center;
}
.payment-history-card span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.payment-history-card strong {
  font-size: 12px;
  color: #0f172a;
}

.metadata-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.meta-card {
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px 14px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}


.drive-link-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drive-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px;
  padding: 10px 16px;
  background: rgba(253, 230, 138, 0.25);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

.drive-link-row.missing {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
}

.drive-link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
}

.drive-link-pill.muted {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  color: #94a3b8;
}
.deliver-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #334155;
}
.deliver-toggle input {
  accent-color: #10b981;
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.order-detail-page {
  background: radial-gradient(circle at top, #f8fbff, #f1f5ff);
}

.meta-key {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.meta-value {
  font-size: 14px;
  color: #1f2937;
  word-break: break-word;

  max-height: 180px;
  overflow: auto;
}

.meta-value-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meta-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.15s ease;
}

.meta-copy-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.meta-copy-btn.copied {
  border-color: #34d399;
  color: #059669;
  background: #ecfdf3;
}

.meta-pre {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  font-family: \"Fira Code\", \"Courier New\", monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;

  max-height: 160px;
  overflow: auto;
}

.payment-paid {
  color: #0f9d58;
  font-weight: 600;
}
.payment-panel .payment-form-toggle {
  margin-top: 18px;
}

.pagination {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.pagination .page-link,
.pagination .page-ellipsis {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  background: #fff;
  transition: all 0.2s ease;
}
.pagination .page-link:hover {
  background: rgba(255, 65, 108, 0.08);
}
.pagination .page-link.active {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  color: #fff;
  border: none;
  box-shadow: 0 15px 25px rgba(255, 65, 108, 0.2);
}

.muted-text {
  color: #999;
  font-size: 13px;
}
#copy-api-token, #copy-push-token{
  margin-top: 25px;
}
.download-btn,
.submit-btn,
.add-btn,
.filter-btn {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(255, 65, 108, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.filter-btn { 
  padding: 10px 28px;
}
button.draft-btn {
  background: linear-gradient(135deg, #ff6f61, #ff343a);
}
.filter-btn {
  margin: 0;
}
.download-btn:hover,
.submit-btn:hover,
.add-btn:hover,
.filter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 65, 108, 0.35);
}
/* .submit-btn {
  position: absolute;
  width: 35%;
  bottom: 50px;
  margin-bottom: 0;
} */

.download-icon {
  margin-left: 8px;
}

.nav-btn {
  background: #fff;
  color: #ff4b2b;
  border: 1px solid rgba(255, 65, 108, 0.4);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 65, 108, 0.05);
  transform: translateY(-1px);
}

.nav-btn.prev {
  color: #6c7b8a;
  border-color: rgba(108, 123, 138, 0.4);
}

.nav-btn.next {
  color: #fff;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  border: none;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 0;
  gap: 12px;
}

.nav-controls {
  display: flex;
  gap: 12px;
}

.nav-controls .nav-btn {
  min-width: 120px;
}

#draft-btn {
  min-width: 140px;
  text-align: center;
  background: linear-gradient(135deg, #ffe5e9, #ffc0cb);
  color: #b10033;
}

.final-actions {
  margin: 34px 0 0;
  display: none;
  width: 100%;
}

.final-actions.ready {
  display: flex;
  justify-content: center;
}

.final-actions.ready .submit-btn {
  width: 55%;
  max-width: 520px;
  padding: 22px 32px;
  font-size: 20px;
  border-radius: 999px;
  box-shadow: 0 18px 28px rgba(255, 65, 108, 0.25);
}

.drive-links {
  border: 1px solid #f5d0d0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  background: #fff5f5;
}

.drive-links h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.drive-links-status {
  margin: 0 0 8px;
  font-size: 14px;
  color: #555;
}

.drive-links ul {
  list-style: disc inside;
  margin: 0;
  padding: 0;
}

.drive-links ul li {
  margin-bottom: 6px;
  list-style: none;
  font-style: italic;
  font-size: 14px;
}

.drive-links ul li a {
  color: #c92121;
  text-decoration: underline;
}

.subject {
  text-align: center;
  font-weight: bold;
  margin: 20px 0;
}

/* Style the plus button */
.add-row-btn {
  padding: 10px 26px 10px 44px;
  border: none;
  cursor: pointer;
  margin-top: 0;
  position: relative;
  background: linear-gradient(135deg, #fff4f6, #ffe1e9);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(15, 15, 35, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: #141b2c;
  border: 1px solid rgba(255, 65, 108, 0.2);
}
.add-row-btn::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sop-primary), var(--sop-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(255, 65, 108, 0.25);
}
.add-row-btn::after {
  content: "+";
  position: absolute;
  left: 20px;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
}
.add-row-btn span {
  display: inline-flex;
  align-items: center;
}
.add-row-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(255, 65, 108, 0.3);
}

.sponsor-blocks-container {
  margin-bottom: 30px;
}

.item-block {
  border-bottom: 1px solid #e4d6d6;
  margin-bottom: 46px;
  position: relative;
}

/* Style the remove button */
.remove-sponsor-btn {
  position: absolute;
  top: -66px;
  right: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff7c7c, #ff3c56);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 65, 108, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.remove-sponsor-btn span {
  pointer-events: none;
}
.remove-sponsor-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(255, 65, 108, 0.4);
}
.remove-sponsor-btn::after {
  content: "×";
  font-size: 20px;
  line-height: 1;
}

.sponsor-blocks-container {
  margin-bottom: 30px;
}

.text-align-left {
  text-align: left !important;
}

.loader {
  border: 5px solid #f3f3f3;
  border-radius: 50%;
  border-top: 5px solid #3498db;
  width: 30px;
  height: 30px;
  -webkit-animation: spin 2s linear infinite; /* Safari */
  animation: spin 2s linear infinite;
  margin-bottom: 10px;
}

/* Safari */
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.login-container {
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-container h2 {
  margin-bottom: 20px;
  color: #333;
}
.input-field {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 16px;
}
.input-field:focus {
  outline: none;
  border-color: #6c63ff;
}
.login-btn {
  width: 100%;
  padding: 12px;
  background-color: #f49d9d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
}
.login-btn:hover {
  background-color: #deadad;
}
.alert {
  display: block;
  background: red;
  padding: 13px;
  color: white;
  margin: 10px 0;
  border-radius: 2px;
  text-align: center;
}
.alert.warning {
  background: #ffc107;
}
.alert.danger {
  background: #dc3545;
}
.alert.success {
  background: #28a745;
}
.logout {
  width: 91px;
  position: absolute;
  top: 33px;
  right: 1px;
  z-index: 99999;
  background: #ff3232;
  color: white;
  padding: 10px;
  border-radius: 5px 0 0 5px;
}
.logout .fa-solid {
  color: white;
  vertical-align: middle;
}
.logout a {
  color: white;
  text-decoration: none;
  vertical-align: middle;
  font-size: 14px;
}

@media (max-width: 1200px) {
  .sop-generator-page .main-container {
    width: min(100%, 95%);
    padding: 32px 24px;
  }
}

@media (max-width: 900px) {
  .sop-generator-page .top-nav {
    padding: 16px;
    gap: 18px;
  }
  .sop-generator-page .nav-button {
    min-width: 110px;
  }
}

@media (max-width: 768px) {
  .sop-generator-page .actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .sop-generator-page .nav-controls {
    flex-direction: column;
  }
  .sop-generator-page .nav-controls .nav-btn,
  .sop-generator-page #draft-btn,
  .sop-generator-page .final-actions.ready .submit-btn {
    width: 100%;
  }
  .sop-generator-page .top-nav {
    flex-direction: column;
    border-radius: 32px;
  }
  .sop-generator-page .top-nav::before {
    display: none;
  }
  .sop-generator-page .nav-button.step-hidden {
    display: flex;
  }
}
/* Footer Styling */
.footer {
  width: 100%;
  text-align: center;
  padding: 32px 12px 24px;
  background: var(--sop-primary);
  color: #fff;
  border-radius: 0;
  box-shadow: none;
  margin-top: 0;
}

.footer p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
div.error,
label.error {
  background: #ff3332;
  color: #ffffff;
  font-size: 14px;
  margin-top: 7px;
  padding: 5px;
  border-radius: 5px;
  text-align: center;
  display: block;
}
.mb-0 {
  margin-bottom: 0px !important;
}

.checkbox-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.checkbox-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.checkbox-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dfe3ec;
  transition: 0.4s;
  border-radius: 24px;
}
.checkbox-switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
.checkbox-switch input:checked + .slider {
  background-color: #ef4444;
}
.checkbox-switch input:checked + .slider:before {
  transform: translateX(26px);
}

.form-group.checkbox-group {
  padding: 18px 22px;
  border: 1px solid #e0e5f2;
  border-radius: 18px;
  background: #f8f9fb;
  margin-bottom: 28px;
}
.form-group.checkbox-group .form-label {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: #1f2933;
}
.form-group.checkbox-group .toggle-group {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 10px;
}
.form-group.checkbox-group .checkbox-switch {
  transform: scale(1.1);
}

input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(20, 20, 35, 0.25);
  border-radius: 50%;
  margin-right: 6px;
  position: relative;
  cursor: pointer;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  vertical-align: middle;
}
input[type="radio"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sop-primary);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.2s ease;
}
input[type="radio"]:checked {
  border-color: var(--sop-primary);
  box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.15);
}
input[type="radio"]:checked::after {
  transform: translate(-50%, -50%) scale(1);
}

.select2-container .select2-selection--multiple {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #ccc;
}
.select2-selection__choice {
  background-color: #ef4444 !important;
  color: white !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 2px 8px !important;
}
.form-group span {
  max-width: 100%;
  width: 100%;
}
.btn {
  padding: 5px 10px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 16px;
}
.btn-edit {
  background: #3b82f6;
  color: white;
}
.btn-edit:hover {
  background: #2563eb;
}
.btn-delete {
  background: #ef4444;
  color: white;
}
.btn-delete:hover {
  background: #dc2626;
}

/* Admin page Layout */
.admin-page-wrapper {
  flex: 1;
  min-width: 0;
  padding: 90px 40px 40px;
  background: linear-gradient(180deg, #f7f8fc, #f1f3fb);
  min-height: 100vh;
}
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
.admin-page-title-group {
  display: flex;
  flex-direction: column;
}
.admin-page-title {
  font-size: 32px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.admin-page-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-top: 4px;
}
.admin-page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.admin-page-actions form {
  margin: 0;
}
.admin-page-actions button {
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.orders-total-chip {
  display: flex;
  flex-direction: column;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  line-height: 1.2;
}

.orders-total-chip span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.orders-total-chip strong {
  font-size: 18px;
  color: #0f172a;
}

/* Select2 adjustments */
.select2-container--default .select2-selection--multiple {
  background: transparent;
  border: none;
  border-bottom: 1px solid #d1d5db;
  min-height: 42px;
}
.select2-selection__choice {
  background-color: #ef4444 !important;
  color: white !important;
  border: none !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  margin-top: 5px !important;
}

/* Table Area */
table {
  width: 100%;
  border-collapse: collapse;
}

.admin-card {
  background: #fff;
  border-radius: 26px;
  padding: 18px 24px 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 30px 70px rgba(15, 15, 35, 0.08);
  overflow-x: auto;
  overflow-y: visible;
}

.admin-table-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.admin-card.action-overflow {
  overflow: visible;
  position: relative;
}
.admin-card.action-overflow .admin-table-wrapper {
  overflow: visible;
  padding-bottom: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.admin-table th {
  background: #f7f8fc;
  padding: 18px;
  text-align: left;
  font-weight: 700;
  color: #1f2937;
  border-bottom: 1px solid #ebeef5;
}

.admin-table td {
  padding: 18px;
  border-bottom: 1px solid #eff1f6;
  color: #1f2937;
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(255, 76, 76, 0.04);
}

.admin-table tbody tr.row-completed {
  background: #ecfdf5;
}

.admin-table tbody tr.row-completed:hover {
  background: #d1fae5;
}

.admin-table tbody tr.row-refunded {
  background: #fee2e2;
}

.admin-table tbody tr.row-refunded:hover {
  background: #fecaca;
}

.payment-refunded {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.payment-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  color: #1f2937;
  font-weight: 600;
}

.payment-edit-form {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 14px 16px;
}
.payment-edit-form.open {
  display: flex;
}

.payment-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.payment-edit-field label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 4px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.payment-edit-actions {
  display: flex;
  gap: 8px;
}

.payment-edit-form label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.payment-edit-form .input-with-prefix {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
  padding: 0 6px;
}

.payment-edit-form .input-with-prefix .prefix {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  border-right: 1px solid #e5e7eb;
}

.payment-edit-form input[type="number"] {
  border: none;
  padding: 10px 12px;
  width: 100%;
  background: transparent;
  font-weight: 600;
  color: #111827;
  text-align: center;
}

.payment-edit-form input[type="number"]:focus {
  outline: none;
}

.remaining-display {
  font-size: 13px;
  color: #1f2937;
}

.table-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  overflow: hidden;
}

.table-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: #e5e7eb;
  color: #374151;
}

.status-badge.status-active,
.status-badge.status-paid,
.status-badge.status-completed,
.status-pill.status-active,
.status-pill.status-paid,
.status-pill.status-completed {
  background: #dcfce7;
  color: #166534;
}

.status-badge.status-inactive,
.status-badge.status-deleted,
.status-badge.status-removed,
.status-pill.status-inactive,
.status-pill.status-deleted,
.status-pill.status-removed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.status-pending,
.status-badge.status-pending_client_submission,
.status-pill.status-pending,
.status-pill.status-pending_client_submission {
  background: #fef3c7;
  color: #854d0e;
}

.status-badge.status-partial,
.status-badge.status-pending_correction,
.status-badge.status-pending_correction_sop_submission,
.status-pill.status-partial,
.status-pill.status-pending_correction,
.status-pill.status-pending_correction_sop_submission {
  background: #e0f2fe;
  color: #0f172a;
}

.status-badge.status-delivered,
.status-badge.status-pending_delivery,
.status-pill.status-delivered {
  background: #ede9fe;
  color: #5b21b6;
}
.doc-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(99, 102, 241, 0.12);
  color: #3730a3;
}
.doc-type-badge.doc-type-dependant {
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}
.doc-type-badge.doc-type-gs {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}
.customer-info span {
  display: block;
}
.ai-sensitive-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.15);
  color: #c2410c;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
}
.ai-sensitive-badge i {
  font-size: 12px;
}

/* Content Area */
.content-wrapper {
  flex: 1;
  padding: 90px 40px 40px;
  overflow-y: auto;
}
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.content-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  color: #111827;
}
.content-header p {
  font-size: 16px;
  color: #6b7280;
  margin-top: 6px;
}

/* Dashboard Area */
.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 32px 40px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fff5f5, #f3f7ff);
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 45px 90px rgba(15, 15, 35, 0.08);
  margin-bottom: 32px;
}
.dashboard-hero h1 {
  font-size: 34px;
  margin-bottom: 8px;
  color: #0f172a;
}
.dashboard-hero p {
  color: #475569;
  max-width: 460px;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #ff4b2b;
  margin-bottom: 6px;
  font-weight: 700;
}
.hero-stats {
  display: flex;
  gap: 24px;
}
.hero-stats > div {
  background: white;
  padding: 18px 26px;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(15, 15, 35, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.hero-stats .label {
  color: #6b7280;
  font-size: 14px;
}
.hero-stats strong {
  display: block;
  font-size: 30px;
  color: #0f172a;
  margin-top: 4px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.dashboard-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 75, 43, 0.15), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(255, 65, 108, 0.3);
  border-radius: 24px;
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: 0 25px 60px rgba(255, 65, 108, 0.18);
  gap: 16px;
}
.dashboard-alert strong {
  font-size: 26px;
  margin-right: 8px;
}
.dashboard-alert span {
  color: #a855f7;
  margin-left: 6px;
}
.pill-btn-small {
  font-size: 13px;
  padding: 10px 16px;
  box-shadow: none;
}
.dashboard-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 75, 43, 0.15), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(255, 65, 108, 0.3);
  border-radius: 24px;
  padding: 18px 24px;
  margin-bottom: 28px;
  box-shadow: 0 25px 60px rgba(255, 65, 108, 0.18);
  gap: 16px;
}
.dashboard-alert strong {
  font-size: 26px;
  margin-right: 8px;
}
.dashboard-alert span {
  color: #a855f7;
  margin-left: 6px;
}
.pill-btn-small {
  font-size: 13px;
  padding: 10px 16px;
  box-shadow: none;
}
.metric-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 26px 28px;
  border-radius: 24px;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 25px 60px rgba(15, 15, 35, 0.08);
}
.metric-card .metric-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
}
.metric-card .metric-body p {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}
.metric-card .metric-body h2 {
  margin: 2px 0;
  font-size: 34px;
  color: #0f172a;
}
.metric-card .trend {
  font-size: 13px;
  color: #0ea5e9;
  font-weight: 600;
}
.metric-primary {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
}
.metric-primary .metric-icon {
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
}
.metric-secondary {
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
}
.metric-secondary .metric-icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.metric-success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
.metric-success .metric-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.dashboard-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}
.progress-card,
.quick-actions-card {
  background: white;
  border-radius: 24px;
  padding: 30px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 25px 60px rgba(15, 15, 35, 0.08);
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.progress-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  border-radius: 999px;
}
.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
}
.progress-stats p {
  margin: 0;
  color: #64748b;
}
.progress-stats strong {
  font-size: 26px;
  color: #0f172a;
}
.quick-actions-card h3 {
  margin-bottom: 6px;
}
.quick-actions-card p {
  margin-bottom: 16px;
  color: #6b7280;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #0f172a;
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
}
.pill-btn:hover {
  transform: translateY(-2px);
}
.activity-card {
  background: white;
  border-radius: 26px;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 25px 60px rgba(15, 15, 35, 0.08);
}
.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.inline-link {
  text-decoration: none;
  font-weight: 600;
  color: #2563eb;
}
.activity-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.activity-table th,
.activity-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}
.activity-table td span {
  display: block;
  font-size: 13px;
  color: #94a3b8;
  text-align: left;
}
.activity-table.modern {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(15, 15, 35, 0.08);
}
.activity-table.modern thead {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.9));
}
.activity-table.modern tbody tr:hover {
  background: rgba(255, 75, 43, 0.06);
}
.activity-table.modern .status-badge {
  border-radius: 999px;
    padding: 6px 18px;
    font-size: 13px;
    display: inline;
    margin: 0 auto;
}

@media (max-width: 768px) {
  .dashboard-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats {
    width: 100%;
    flex-wrap: wrap;
  }
  .metric-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .progress-stats {
    flex-direction: column;
    gap: 12px;
  }
}

/* Login Page */
.login-page {
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.25), transparent 40%),
    linear-gradient(135deg, #05060d, #10142b 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 30px 16px;
}

.login-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  filter: blur(120px);
  opacity: 0.7;
  z-index: 1;
}
.login-glow-left {
  background: rgba(255, 75, 43, 0.7);
  top: 10%;
  left: 8%;
}
.login-glow-right {
  background: rgba(67, 56, 202, 0.7);
  bottom: 6%;
  right: 10%;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(440px, 95vw);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 32px;
  padding: 48px 42px 44px;
  box-shadow: 0 45px 80px rgba(5, 6, 20, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}
.login-brand h1 {
  margin: 10px 0 6px;
  font-size: 30px;
  color: #0f1228;
}
.login-brand p {
  color: #64748b;
  margin: 0;
  font-size: 15px;
}
.login-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: #ff4b2b;
  background: rgba(255, 75, 43, 0.12);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-label {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 12px 25px rgba(15, 15, 35, 0.08);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.input-wrapper i {
  color: #c026d3;
}
.input-wrapper:focus-within {
  border-color: #ff4b2b;
  box-shadow: 0 20px 35px rgba(255, 75, 43, 0.18);
}

.login-input {
  border: none;
  flex: 1;
  font-size: 15px;
  background: transparent;
  outline: none;
  color: #0f172a;
}

.login-submit {
  border: none;
  border-radius: 16px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  box-shadow: 0 28px 40px rgba(255, 65, 108, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 8px;
}
.login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 32px 50px rgba(255, 65, 108, 0.45);
}

.login-alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 20px;
  font-size: 14px;
}
.login-alert p {
  margin: 0;
}
.login-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.login-footer a {
  font-size: 14px;
  font-weight: 600;
  color: #ff4b2b;
  text-decoration: none;
}
.login-footer a:hover {
  text-decoration: underline;
}

.dependant-letter {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 24px 28px;
  box-shadow: 0 30px 60px rgba(15, 15, 35, 0.1);
  line-height: 1.7;
  color: #0f172a;
}
.dependant-letter h2 {
  margin-top: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dependant-letter h3 {
  margin-top: 22px;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b45309;
}

/** Country modal css **/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.1), rgba(10, 13, 27, 0.9));
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
  padding: 40px 16px;
}
.modal-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 248, 255, 0.9));
  padding: 40px 50px;
  border-radius: 32px;
  text-align: center;
  max-width: 680px;
  width: min(680px, 96vw);
  box-shadow: 0 45px 100px rgba(5, 9, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.modal-content h2 {
  font-size: 32px;
  margin-bottom: 12px;
  color: #0f172a;
}
.modal-subtitle {
  color: #475569;
  margin-bottom: 26px;
  font-size: 16px;
}
.country-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.country-doc-dialog {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 13, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200000;
}
.country-doc-dialog.hide {
  display: none;
}
.country-doc-card {
  background: #fff;
  border-radius: 28px;
  padding: 32px 36px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 45px 80px rgba(5, 6, 20, 0.5);
  position: relative;
  text-align: center;
}
.doc-dialog-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #111;
}
.doc-type-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.doc-type-option {
  border: 1px solid rgba(255, 65, 108, 0.2);
  border-radius: 18px;
  padding: 14px 18px;
  background: #fff5f5;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.doc-type-option small {
  font-weight: 400;
  color: #6b7280;
}
.doc-type-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(255, 65, 108, 0.2);
}
[hidden] {
  display: none !important;
}
.country-btn {
  padding: 14px 18px;
  background: linear-gradient(135deg, #ff4b2b, #ff6a88);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  box-shadow: 0 18px 30px rgba(255, 65, 108, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.country-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 40px rgba(255, 65, 108, 0.35);
}
.flag-icon {
  width: 26px;
  height: 18px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
/* Dashboard page */
.welcome-container {
  max-width: 800px;
  margin: 60px auto;
  padding: 40px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.welcome-container p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 30px;
}

.coming-soon-box {
  padding: 30px;
  background: #f3f4f6;
  border: 2px dashed var(--brand-color);
  border-radius: 10px;
  color: #374151;
  font-size: 1.2rem;
  font-style: italic;
}

 .page-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fbff, #f2f4fa);
  display: flex;
}

.coming-soon-box {
  margin-top: 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #92400e;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}

/* === Filter Section === */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  min-width: 0;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.orders-filter {
  border: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.orders-filter .filter-row.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.orders-filter .filter-field label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  display: block;
}

.orders-filter .filter-field select {
  width: 100%;
  font-size: 13px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.orders-filter .filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.orders-filter .filter-btn.secondary {
  background: #eef2ff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.assigned-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  background: #f3f4f6;
  color: #111827;
}

.assigned-pill.unassigned {
  background: #fff8e1;
  color: #92400e;
  border-color: #fcd34d;
}

.filter-form select,
.filter-form input[type="date"],
.filter-form input[type="text"],
.filter-form input[type="search"] {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background-color: #f9fafb;
  min-width: 180px;
}

.ai-progress-banner {
  position: relative;
  margin: 16px 0;
  padding: 16px 20px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid rgba(255, 65, 108, 0.25);
  background: linear-gradient(135deg, #fff, #fff5f8);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.08);
  font-size: 14px;
}
.ai-progress-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 65, 108, 0.4), rgba(115, 103, 240, 0.4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.ai-progress-banner.hide {
  display: none;
}
.ai-progress-banner.success {
  border-color: rgba(52, 211, 153, 0.4);
  background: linear-gradient(135deg, #fff, #f3fffa);
}
.ai-progress-banner.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: linear-gradient(135deg, #fff, #fff4f4);
}
.ai-progress-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: #1f2937;
  flex: 1 1 auto;
  min-width: 0;
}
#order-ai-progress-text {
  display: block;
  line-height: 1.4;
  word-break: break-word;
}
.ai-progress-banner.success .ai-progress-left {
  color: #15803d;
}
.ai-progress-banner.error .ai-progress-left {
  color: #b91c1c;
}
.ai-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: relative;
}
.ai-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(191, 219, 254, 0.6);
  border-top-color: #ff416c;
  animation: ai-spin 0.9s linear infinite;
}
.ai-progress-banner.success .ai-spinner::before {
  border-color: rgba(74, 222, 128, 0.5);
  border-top-color: #22c55e;
  animation: ai-spin 1s linear infinite;
}
.ai-progress-banner.error .ai-spinner::before {
  border-color: rgba(248, 200, 200, 0.6);
  border-top-color: #f87171;
  animation: ai-spin 1s linear infinite;
}
.ai-progress-close {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.2s, color 0.2s;
}
.ai-progress-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #111827;
}

.json-preview {
  text-align: left;
  background: #0f172a;
  color: #f1f5f9;
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  padding: 16px;
  border-radius: 12px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}

/* === SOP Stats Summary === */
.sop-summary {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  background: linear-gradient(135deg, rgba(255, 99, 132, 0.1), rgba(255, 255, 255, 0.85));
  padding: 14px 24px;
  border-radius: 999px;
  margin: 0 0 28px;
  display: inline-flex;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(255, 65, 108, 0.2);
  box-shadow: 0 20px 45px rgba(15, 15, 35, 0.08);
}

.sop-summary strong {
  color: #ff3232;
}

.flash-wrapper {
  position: relative;
  width: 100%;
  z-index: 9999;
}

.flash-message.trial-limit {
  background-color: #fef3c7;
  color: #92400e;
  padding: 15px;
  text-align: center;
  font-weight: 500;
  font-size: 16px;
  border-bottom: 1px solid #facc15;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
/* Logger */

.log-filter-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 255, 0.9));
  border-radius: 26px;
  padding: 24px 28px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 20px 50px rgba(15, 15, 35, 0.08);
  margin-bottom: 24px;
  overflow-x: auto;
}

.log-filter-form {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.log-filter-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-filter-fields label {
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.log-filter-fields input[type="date"] {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 15px;
  min-width: 220px;
}

.log-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #ff4b2b, #ff416c);
  box-shadow: 0 18px 35px rgba(255, 65, 108, 0.3);
  cursor: pointer;
}

.log-card {
  background: #0f172a;
  border-radius: 28px;
  padding: 26px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 40px 80px rgba(15, 15, 35, 0.5);
}

.log-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  color: #f8fafc;
}

.log-card-header h3 {
  margin: 4px 0 0;
}

.log-count {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  font-size: 13px;
}

.log-container {
  background: rgba(15, 23, 42, 0.65);
  color: #d4d4d8;
  border-radius: 18px;
  padding: 18px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  max-height: 550px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.log-entry-info {
  color: #9cdcfe;
}

.log-entry-error {
  color: #f44747;
}

.log-entry-warning {
  color: #dcdcaa;
}

.log-entry-debug {
  color: #6a9955;
}

.log-entry {
  display: grid;
  grid-template-columns: 160px 90px 1fr;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-timestamp {
  color: #94a3b8;
}

.log-level {
  font-weight: 700;
}

.log-message {
  color: #e2e8f0;
}

.no-logs-msg {
  font-style: italic;
  color: #666;
  margin-top: 20px;
}
/* Modal Overlay (full-screen) */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(6, 9, 24, 0.95);
  backdrop-filter: blur(6px);
  padding: 40px 16px;
  z-index: 100000;
  pointer-events: auto;
}

/* Hidden state */
.modal-overlay.hide {
  display: none !important;
}

/* Inner Container: scrollable if content too tall */
.modal-overlay .preview-container {
  position: relative;
  background: linear-gradient(180deg, #ffffff, #fff7f7);
  border-radius: 26px;
  padding: 32px 40px 48px;
  width: min(960px, 92vw);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px rgba(6, 9, 24, 0.35);
}

/* Close Button Styling */
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #ff6a6a, #ff2f4c);
  box-shadow: 0 12px 28px rgba(255, 65, 108, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-title {
  font-size: 22px;
  margin: 0 0 16px;
}

.modal-form {
  margin-top: 10px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 16px;
}

.modal-form-field label {
  display: block;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
}

.input-lg {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-size: 15px;
  width: 100%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.input-lg:focus {
  border-color: #ff4d67;
  outline: none;
  box-shadow: 0 8px 18px rgba(255, 77, 103, 0.12);
}

.tight-grid {
  gap: 12px;
}

.admin-pill-btn.large {
  padding: 12px 18px;
  font-size: 15px;
}

.admin-pill-btn.primary.outlined {
  background: #fff;
  color: #ff4d67;
  border: 1px solid #ff4d67;
}
.modal-close-btn span {
  display: inline-block;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 44px;
}
.modal-close-btn span::after {
  content: "×";
}
.modal-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(255, 65, 108, 0.35);
}

#sop-preview-modal .sop-preview {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 10px;
}
#sop-preview-modal .download-btn {
  width: 100%;
  border-radius: 24px;
  margin-bottom: 18px;
}
.stepper-container {
  margin: 0 auto 28px;
  padding: 0 10px;
  position: relative;
}
.top-nav {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 32px;
  padding: 18px 24px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 20px 45px rgba(15, 15, 35, 0.12);
  position: relative;
  overflow: hidden;
}
.top-nav::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: linear-gradient(90deg, rgba(124, 77, 255, 0.15), rgba(255, 65, 108, 0.15));
  z-index: 0;
}
.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  min-width: 140px;
  padding: 0;
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}
.nav-button.step-hidden {
  display: none;
}
.nav-button .step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffe7ee;
  color: #1f2a37;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(20, 20, 50, 0.12);
}
.nav-button .step-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #3a3f58;
  text-transform: none;
}
.nav-button .step-info .fa-solid {
  color: var(--sop-primary);
  font-size: 15px;
}
.nav-button.completed .step-circle {
  background: #a58181;
  color: #ffffff;
}
.nav-button.active .step-circle {
  background: linear-gradient(135deg, var(--sop-primary), var(--sop-secondary));
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 14px 26px rgba(255, 65, 108, 0.35);
}
.nav-button.active .step-info,
.nav-button.active .step-info .fa-solid {
  color: var(--sop-primary);
}

div#sop-progress {
  text-align: center;
  font-weight: 600;
  color: #1e2a35;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 248, 0.85));
  border: 1px solid rgba(255, 65, 108, 0.12);
  position: relative;
  padding: 14px 20px;
  margin: 40px 0 12px;
  border-radius: 16px;
  font-size: 15px;
  box-shadow: 0 18px 30px rgba(15, 15, 35, 0.12);
}
#sop-progress-percent {
  color:#ef5a59; 
  margin-top: 6px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}
.progress-container {
  background: rgba(255, 255, 255, 0.88);
  border-radius: 18px;
  padding: 18px 22px;
  margin: 24px 0 10px;
  box-shadow: 0 20px 40px rgba(15, 15, 35, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.progress-container.hide,
#sop-progress-percent.hide {
  display: none;
}

.doc-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 30, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.doc-modal.hide {
  display: none;
}

.doc-modal-card {
  width: min(1200px, 95vw);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(7, 11, 30, 0.4);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.doc-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(15, 18, 35, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  color: #6c6f7d;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 15;
}

.doc-modal-close:hover {
  background: rgba(15, 18, 35, 0.18);
  color: #ff3232;
}

.doc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 60px;
  position: relative;
}

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

.doc-modal-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2330;
}

.doc-modal-filename {
  font-size: 0.9rem;
}

.doc-modal-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ff3232;
}

.doc-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: #ffe8e6;
  color: #c53030;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.doc-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.doc-delete-btn:not(:disabled):hover {
  background: #ffd2ce;
  color: #9b2c2c;
}

/* Ensure SweetAlert overlays appear above modals */
.swal2-container {
  z-index: 4000 !important;
}

/* Analytics page */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
@media (min-width: 1100px) {
  .analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.metric-card {
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
}
.metric-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #475569;
}
.metric-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}
.metric-delta {
  font-size: 0.9rem;
  font-weight: 600;
}
.delta-up { color: #16a34a; }
.delta-down { color: #dc2626; }

/* Analytics-specific metric layout */
.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.analytics-metrics .metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.chart-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.06);
  min-height: 320px;
}
.chart-card.full-span {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 16px;
}

.drive-warning {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.drive-warning-container {
  max-width: 1200px;
  margin: 0 auto 12px;
  padding: 0 16px;
}
.drive-warning .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.drive-warning button {
  background: #ea580c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.drive-warning button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.drive-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hide {
  display: none !important;
}
.chart-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.chart-wrapper {
  position: relative;
  height: 320px;
  width: 100%;
}

.doc-modal-body {
  width: 100%;
  height: min(80vh, 720px);
  background: #f4f6fb;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 12px;
}

.doc-modal-view {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #e7ebf5;
  border-radius: 18px;
}

.doc-modal-view iframe,
.doc-modal-view img {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  border: none;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.doc-modal-link {
  display: block;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  background: #fff;
}

.doc-modal-link:hover {
  background: #f8fafc;
}

.doc-modal-empty {
  margin: 0;
  color: #55596c;
  font-weight: 500;
}

.doc-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17, 20, 40, 0.7);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 2;
}

.doc-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.doc-nav:hover:not(:disabled) {
  background: rgba(17, 20, 40, 0.85);
}

.doc-nav-prev {
  left: 24px;
}

.doc-nav-next {
  right: 24px;
}

.doc-modal-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.order-hero {
  margin-bottom: 32px;
  padding: 24px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(247, 250, 255, 0.95));
  box-shadow: 0 35px 80px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.order-hero h2 {
  margin: 0;
  font-size: 2rem;
  color: #0f172a;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  flex: 1;
  min-width: 280px;
}

.hero-meta > div {
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  align-items: center;
}

.hero-meta span {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.hero-meta strong {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.ai-flag-banner {
  margin-bottom: 26px;
  padding: 18px 22px;
  border-radius: 24px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.ai-flag-banner::before {
  content: "\f071";
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5f5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #1e293b;
}

.ai-flag-banner.active::before {
  background: linear-gradient(135deg, #fed7aa, #fca5a5);
  color: #7f1d1d;
}

.ai-flag-banner .flag-text span {
  display: block;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: bold;
}

.ai-flag-banner .flag-text strong {
  font-size: 15px;
  color: #0f172a;
}

.ai-flag-banner.active {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.9), rgba(254, 226, 226, 0.95));
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: 0 25px 60px rgba(248, 113, 113, 0.2);
}

.ai-flag-banner.active .flag-text span {
  color: #b45309;
}

.ai-flag-banner.active .flag-text strong {
  color: #7f1d1d;
  font-weight: 100;
}

.prevent-scroll {
  overflow: hidden;
}
.flatpickr-calendar.animate.open {
  z-index: 999999999999;
}
