/* IMPORTANT: Toggle styles must stay scoped to avoid global button overrides */


@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&display=swap');

:root {
  --brand-font: 'Cinzel', serif;
  --ui-font: 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
  font-family: var(--ui-font);
}


/* =========================
   Header / Navbar Styling
   ========================= */

.header {
  background-color: #0C3B4D;
  color: #fff;
  padding: 15px 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* equal sides = true center */
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  justify-self: start;
}

.header-logo {
  height: 48px;
  width: auto;
}


.header-title {
  margin: 0;
  font-size: 28px;              /* slightly smaller = more refined */
  font-weight: 500;             /* lighter reads more premium */
  text-align: center;
  white-space: nowrap;

  font-family: var(--brand-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  margin: 6px auto 0;
}



/* Left-side navigation links (Home / Dashboard) */
.header-left .nav-link {
  margin-left: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
  white-space: nowrap;
}

.header-left .nav-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.header-left .nav-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Notification badge pill */
.badge-pill {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  background-color: #dc3545;
  color: #ffffff;
  border-radius: 10px;
  line-height: 1;
  vertical-align: middle;
}


.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end; /* 🔑 pins right side */
}

.user-email {
  font-size: 14px;
  opacity: 0.9;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Left-side admin dashboard link */
.dashboard-link {
  margin-left: 16px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
  white-space: nowrap;
}

.dashboard-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.dashboard-link:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.user-email {
  font-size: 14px;
  opacity: 0.9;
  white-space: nowrap;
}
/* Base navbar button */
.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Admin dashboard button */
.admin-btn {
  background-color: #E3F4FA;
  color: #0C3B4D;
  border-color: #B6E2F0;
}

/* Compact admin shield icon */
.admin-shield {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #2ECC71;
  cursor: default;
}

/* Slightly tighter admin button */
.admin-btn {
  background-color: #E3F4FA;
  color: #0C3B4D;
  border-color: #B6E2F0;
  padding: 6px 10px; /* tighter than before */
}

.admin-btn:hover {
  background-color: #CFEAF4;
}

.admin-btn:focus {
  outline: 2px solid rgba(0, 0, 0, 0.2);
  outline-offset: 2px;
}
/* Logout button */
.logout-btn {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
}
/* Admin badge */
.admin-badge {
  background-color: #2ECC71;
  color: #0C3B4D;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}

.container { max-width:900px; margin:20px auto; padding:0 20px; }
.order-form label { display:block; margin-bottom:8px; font-weight:bold; }
.order-form input { width:100%; padding:8px; margin-top:4px; margin-bottom:12px; box-sizing:border-box; border:1px solid #ccc; border-radius:3px; }

/* Always keep section borders consistent */
.property-section,
.contact-section {
  border: 2px solid #0C3B4D;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 3px;
}

/* Grid layout only */
@media (min-width: 768px) {
  .property-section,
  .contact-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }

  .property-section legend,
  .contact-section legend {
    grid-column: 1 / -1;
  }
}

  /* Make legends span full width */
  .property-section legend,
  .contact-section legend {
    grid-column: 1 / -1;
  }


@media (min-width: 768px) {
  .full-width {
    grid-column: 1 / -1;
  }
}


@media (min-width: 768px) {
  .order-form label {
    margin-bottom: 16px;
  }
}

@media (min-width: 768px) {
  .order-form button {
    grid-column: 2 / 3;
    justify-self: end;
  }
}

@media (min-width: 1200px) {
  .details-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (min-width: 768px) {
  .order-form-grid {
    display: grid;
    row-gap: 24px;
  }
}

/* === Styled Select (State dropdown) === */
.order-form select.styled-select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;

  background-color: #f3f4f6;
  border: 1px solid #9ca3af;
  border-radius: 8px;

  appearance: none;        /* remove native arrow */
  -webkit-appearance: none;
  -moz-appearance: none;

  /* subtle depth similar to toggle */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Hover */
.order-form select.styled-select:hover {
  background-color: #e5f1f5;
}

/* Focus (brand-aligned) */
.order-form select.styled-select:focus {
  outline: none;
  border-color: #0C3B4D;
  box-shadow:
    0 0 0 2px rgba(12, 59, 77, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.6);
  background-color: #ffffff;
}

/* Custom dropdown arrow */
.order-form select.styled-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #0C3B4D 50%),
    linear-gradient(135deg, #0C3B4D 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}


/* Product toggle (segmented control) */
.product-toggle-container {
  margin-bottom: 20px;
}



.orders-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.orders-header h2 {
  margin: 0;
}


/* Property section fieldset styling */
.property-section { border:2px solid #0C3B4D; padding:15px; margin-bottom:15px; border-radius:3px; }
.property-section legend,
.contact-section legend {
  padding: 0 8px;
  font-weight: bold;
  color: #0C3B4D;
}

.additional-info-section {
  border: 2px solid #0C3B4D;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 3px;
}

.additional-info-section legend {
  padding: 0 8px;
  font-weight: bold;
  color: #0C3B4D;
}

/* Textarea styling */
.order-form textarea {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  margin-bottom: 12px;
  box-sizing: border-box;

  border: 1px solid #9ca3af;
  border-radius: 8px;
  background-color: #f3f4f6;

  font-family: var(--ui-font);
  font-size: 14px;
  resize: vertical;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.order-form textarea:focus {
  outline: none;
  border-color: #0C3B4D;
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(12, 59, 77, 0.25);
}

/* Character counter styling */
.char-counter {
  float: right;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-left: 8px;
}

.char-counter.over-limit {
  color: #dc2626;
  font-weight: 700;
}

.char-limit-warning {
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: -8px;
  margin-bottom: 12px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}


/* Checkbox label should show input left of text */
.checkbox-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  padding: 8px 12px;
  background-color: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}
.checkbox-label:hover {
  background-color: #f3f4f6;
}

.checkbox-label:focus-within {
  outline: 2px solid #0C3B4D;
  outline-offset: 2px;
}

.order-form input[type="checkbox"] { width:auto; padding:0; margin-top:0; margin-bottom:0; }

/* Readonly/display-only inputs (like Created By) should not stretch full width */
.order-form input[readonly], .order-form .readonly-input {
	width: auto;
	max-width: 420px;
	display: inline-block;
	box-sizing: border-box;
	margin-top: 4px;
	margin-bottom: 12px;
}

/* === Product Toggle (isolated + override-safe) === */
.order-form .product-toggle {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  background-color: #d1d5db;
  padding: 2px;
  border: 1px solid #9ca3af;
}

/* Base toggle button (beats global button styles) */
.order-form .product-toggle button.toggle-btn {
  flex: 1;
  padding: 12px 20px;
  background: #f3f4f6;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  /* explicitly neutralize global button styles */
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;

  transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

/* Hover only for inactive */
.order-form .product-toggle button.toggle-btn:not(.active):hover {
  background: #e5f1f5;
}

/* Active state */
.order-form .product-toggle button.toggle-btn.active {
  background: #0C3B4D;
  color: #ffffff;
  box-shadow: 0 0 0 1px #0C3B4D, 0 1px 2px rgba(0,0,0,0.15);
  transform: translateY(1px);
}

.order-form .product-toggle button.toggle-btn.active::after {
  content: " ✓";
  font-weight: 700;
}

/* Keyboard focus */
.order-form .product-toggle button.toggle-btn:focus-visible {
  outline: 2px solid #0C3B4D;
  outline-offset: -2px;
}
.order-form .checkbox-label {
  grid-column: 1 / -1;
}



/* Primary action button (Create Order) */
.order-form .form-actions button {
  background-color: #0C3B4D;
  color: #ffffff;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  /* Visual depth similar to toggle */
  box-shadow:
    0 0 0 1px #0C3B4D,
    0 2px 4px rgba(0,0,0,0.15);

  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.05s ease;
}

.order-form .form-actions button:hover {
  background-color: #094359;
}
.order-form .form-actions button:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 1px #0C3B4D,
    0 1px 2px rgba(0,0,0,0.2);
}
.order-form .form-actions button:focus-visible {
  outline: 2px solid #0C3B4D;
  outline-offset: 3px;
}


.orders { width:100%; border-collapse:collapse; margin-top:12px; }
.orders th, .orders td { border:1px solid #ddd; padding:8px; text-align:left; pointer-events: auto; }
.orders th { background-color:#f0f0f0; font-weight:bold; }
.orders tr:hover { background-color:#f9f9f9; }
.order-row { cursor:pointer; transition: background-color 0.15s; }
.order-row:hover { background-color: #e8f4f8 !important; }
.expand-cell { text-align:center; padding:4px !important; }
.expand-arrow { 
  display:inline-block; 
  transition:transform 0.2s; 
  font-size:12px; color:#0C3B4D; 
  cursor: pointer;
  user-select: none;
}
.order-row:hover .expand-arrow {
  transform: translateX(2px);
}
.expand-arrow.expanded { transform:rotate(0deg); }
.order-details td {
  background-color: #f8f9fa;
  padding: 20px !important;
  border-top: 2px solid #ddd !important; /* restore the table line */
}
/* Spinner button states */
#create-order-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Spinner (hidden by default) */
#create-order-btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Disabled state */
#create-order-btn.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

#create-order-btn.is-loading .btn-label {
  opacity: 0.85;
}

#create-order-btn.is-loading .btn-spinner {
  display: inline-block;
}

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



/* === Order Details (Improved, aligned layout) === */

.details-content {
  max-width: 100%;
}

.details-content h3 {
  margin-top: 0;
  color: #0C3B4D;
  border-bottom: 2px solid #0C3B4D;
  padding-bottom: 8px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 15px;
}

.details-section {
  padding: 12px;
  background-color: #ffffff;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.details-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: 0C3B4D
}

/* Additional info section - full width and scrollable */
.additional-info-section-details {
  grid-column: 1 / -1; /* Span all columns */
  width: 100%;
}

.additional-info-scrollable {
  max-height: 200px;
  overflow-y: auto;
  padding: 0 10px 10px 10px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.additional-info-scrollable p {
  margin: 0;
}

.additional-info-scrollable::-webkit-scrollbar {
  width: 8px;
}

.additional-info-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.additional-info-scrollable::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.additional-info-scrollable::-webkit-scrollbar-thumb:hover {
  background: #555;
}


.file-list { margin:5px 0 0 20px; padding:0; }
.file-list li { margin:4px 0; }
.file-list a { color:#0C3B4D; text-decoration:none; }
.file-list a:hover { text-decoration:underline; }
.ssn-masked { font-family:monospace; letter-spacing:2px; }
.ssn-toggle-btn { background-color:#0C3B4D; color:white; padding:2px 8px; border:none; border-radius:3px; cursor:pointer; font-size:11px; margin-left:8px; }
.ssn-toggle-btn:hover { background-color:#094359; }
.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-filter { background-color:#107c10; color:white; padding:6px 12px; border-radius:3px; text-decoration:none; font-size:13px; }
.btn-filter:hover { background-color:#0f6e0f; }
.filter-status { margin-left:10px; font-size:13px; color:#666; }
.alert-success {
  background-color: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Ensure expandable rows are clickable inside cards */
.orders .order-row {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

/* === Admin dashboard stats bar === */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stat-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #0C3B4D;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.stat-card.active {
  border-color: #0C3B4D;
  box-shadow:
    0 0 0 2px rgba(12, 59, 77, 0.25),
    0 4px 8px rgba(0,0,0,0.12);
}

.admin-status-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.admin-status-label {
  font-weight: 600;
}

.admin-status-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #fff;
}

.admin-status-save-msg {
  font-size: 0.9rem;
  opacity: 0.85;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Expandable order details rows */
.order-details {
  display: none;
}

.order-details.open {
  display: table-row;
}

.tos-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tos-modal {
  background: #ffffff;
  border-radius: 10px;
  max-width: 520px;
  width: 90%;
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.tos-modal h2 {
  margin-top: 0;
  color: #0C3B4D;
}

.tos-body {
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
  color: #333;
}

.tos-modal button {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}




.status-pending {
  background: #fff7d6;
  border-color: #f2d36b;
}

.status-accepted {
  background: #e7f1ff;
  border-color: #9ec5fe;
}

.status-under-review {
  background: #f3e8ff;
  border-color: #c29ffa;
}

.status-delivered {
  background: #dafbe1;
  border-color: #7ee2a8;
}

.status-cancelled {
  background: #ffe2e0;
  border-color: #ff9aa2;
}

.tos-download {
  margin: 16px 0;
  font-size: 14px;
}

.tos-download a {
  color: #0C3B4D;
  font-weight: 600;
  text-decoration: underline;
}

.tos-download a:hover {
  text-decoration: none;
}

.alert { padding:12px; border-radius:3px; margin-bottom:20px; }
.alert-warning { background-color:#fff4ce; border:1px solid #ffb81c; color:#333; }
/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  padding: 15px 0;
}

.page-btn {
  padding: 8px 12px;
  border: 1px solid #0C3B4D;
  background-color: #fff;
  color: #0C3B4D;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  min-width: 38px;
  text-align: center;
}

.page-btn:hover:not(.disabled):not(.active) {
  background-color: #0C3B4D;
  color: white;
}

.page-btn.active {
  background-color: #0C3B4D;
  color: white;
  font-weight: 600;
  cursor: default;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: #ccc;
  color: #999;
}
