:root {
  --google-blue: #4285F4;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;
  --primary: #1a73e8;
  --primary-hover: #1557b0;
  --primary-light: #e8f0fe;
  --bg-color: #f8fafd;
  --surface-color: #ffffff;
  --text-main: #202124;
  --text-muted: #5f6368;
  --border-color: #dadce0;
  --border-light: #e8eaed;
  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.1), 0 1px 3px 1px rgba(60,64,67,0.06);
  --shadow-md: 0 4px 6px -1px rgba(60,64,67,0.12), 0 2px 4px -1px rgba(60,64,67,0.08);
  --shadow-lg: 0 10px 25px -5px rgba(60,64,67,0.15), 0 8px 10px -6px rgba(60,64,67,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Google Sans", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* App Header */
.app-header {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  border: 2px solid #e8eaed;
  position: relative;
  overflow: hidden;
}

.brand-logo-badge::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--google-blue) 25%, var(--google-red) 25% 50%, var(--google-yellow) 50% 75%, var(--google-green) 75%);
}

.brand-info h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.google-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f3f4;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: #3c4043;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(26,115,232,0.3);
}

.btn-outline {
  background: white;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f8f9fa;
  border-color: #bdc1c6;
}

.btn-success {
  background: var(--google-green);
  color: white;
}
.btn-success:hover {
  background: #2d9247;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Main Container */
.main-content {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

/* Banner */
.welcome-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f1f6fd 100%);
  border: 1px solid #d2e3fc;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.welcome-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--google-blue) 25%, var(--google-red) 25% 50%, var(--google-yellow) 50% 75%, var(--google-green) 75%);
}

.hero-text h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.35rem;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1px solid #d2e3fc;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary);
}

/* Two Column Layout */
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.documents-column {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.documents-list-container {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Upload Dropzone */
.upload-card {
  background: white;
  border: 2px dashed #bdc1c6;
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.upload-card:hover, .upload-card.drag-over {
  border-color: var(--primary);
  background: #f8fafd;
  transform: translateY(-2px);
}

.upload-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 12px rgba(26,115,232,0.15);
}

.upload-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.upload-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.upload-limits {
  display: inline-flex;
  gap: 0.5rem;
  background: #f1f3f4;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: #3c4043;
}

/* Batch Controls Bar */
.batch-toolbar {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.apply-all-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a73e8;
  cursor: pointer;
  user-select: none;
}

.apply-all-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Document Item Card */
.document-item-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.document-item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c2d7fa;
}

.doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.15rem;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.doc-file-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
  min-width: 0;
  width: 0;
  flex: 1 1 0%;
}

.doc-thumb {
  width: 48px;
  height: 48px;
  background: #f1f3f4;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  border: 1px solid #dadce0;
  overflow: hidden;
  flex-shrink: 0;
}

.doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-title-box {
  overflow: hidden;
  min-width: 0;
  width: 0;
  flex: 1 1 0%;
}

.doc-name {
  font-size: 1rem;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.doc-header-action {
  flex-shrink: 0;
}

.doc-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.doc-badge-pages {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Configuration Grid */
.doc-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  min-width: 0;
  width: 100%;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
}

.option-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.segment-control {
  display: flex;
  background: #f1f3f4;
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.segment-btn {
  flex: 1 1 0%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  color: #5f6368;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* Copies Stepper */
.stepper-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
  overflow: hidden;
  height: 38px;
}

.stepper-btn {
  width: 38px;
  height: 100%;
  border: none;
  background: #f8f9fa;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  color: #3c4043;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.stepper-btn:hover {
  background: #e8eaed;
}

.stepper-input {
  flex: 1;
  width: 45px;
  border: none;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #202124;
  outline: none;
}

/* Page Range Box */
.range-picker-row {
  grid-column: 1 / -1;
  background: #f8fafd;
  border: 1px solid #d2e3fc;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.range-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.range-radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.range-custom-input {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 130px;
  outline: none;
}
.range-custom-input:focus {
  border-color: var(--primary);
}

.visual-picker-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.visual-picker-trigger-btn:hover {
  background: var(--primary-light);
}

.doc-footer-summary {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-price-tag {
  font-size: 1.1rem;
  font-weight: 700;
  color: #188038;
}

/* Sticky Summary Card */
.order-summary-sidebar {
  position: sticky;
  top: 80px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 2px solid #f1f3f4;
  margin-bottom: 1rem;
}

.summary-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.summary-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f8f9fa;
}

.summary-item-name {
  font-weight: 500;
  color: #3c4043;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-totals {
  border-top: 2px solid #e8eaed;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.total-row.grand-total {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a1a;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

.grand-price {
  color: #188038;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalSlide 0.25s ease-out;
}

@keyframes modalSlide {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Visual Page Picker Grid */
.page-picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.page-picker-actions {
  display: flex;
  gap: 0.5rem;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  padding: 0.5rem;
}

.page-card {
  border: 2px solid #dadce0;
  border-radius: var(--radius-md);
  padding: 0.5rem;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-card:hover {
  border-color: #aecbfa;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.page-card.selected {
  border-color: var(--primary);
  background: #e8f0fe;
}

.page-canvas-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 4px;
}

.page-canvas-wrapper canvas, .page-canvas-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-card-footer {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5f6368;
}

.page-check-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #bdc1c6;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-card.selected .page-check-indicator {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Payment & Checkout Views */
.checkout-step-container {
  max-width: 650px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.payment-method-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.payment-method-card:hover {
  border-color: #aecbfa;
  background: #f8fafd;
}

.payment-method-card.selected {
  border-color: var(--primary);
  background: #e8f0fe;
}

.payment-icon-box {
  width: 48px;
  height: 48px;
  background: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.upi-qr-display-box {
  background: #f8f9fa;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}

.upi-qr-frame {
  display: inline-block;
  padding: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

/* Tracking Page Stepper */
.tracking-hero {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  text-align: center;
}

.stepper-timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2.5rem 0 1.5rem;
}

.stepper-timeline::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: #e8eaed;
  z-index: 1;
}

.stepper-timeline-progress {
  position: absolute;
  top: 20px;
  left: 30px;
  height: 4px;
  background: var(--google-green);
  z-index: 2;
  transition: width 0.4s ease;
}

.timeline-step {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 120px;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  border: 3px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #70757a;
  transition: all 0.3s ease;
}

.timeline-step.completed .step-circle {
  background: var(--google-green);
  border-color: var(--google-green);
  color: white;
}

.timeline-step.active .step-circle {
  background: var(--google-blue);
  border-color: var(--google-blue);
  color: white;
  box-shadow: 0 0 0 5px rgba(66, 133, 244, 0.2);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(66, 133, 244, 0); }
  100% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0); }
}

.step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #5f6368;
  text-align: center;
}

.timeline-step.active .step-label, .timeline-step.completed .step-label {
  color: #202124;
}

/* Rate Card Table */
.rate-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.rate-table th, .rate-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.rate-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #3c4043;
}

/* Admin Dashboard Specific */
.admin-navbar {
  background: #202124;
  color: white;
  padding: 0.75rem 1.5rem;
}

.admin-nav-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav-tabs {
  display: flex;
  gap: 0.5rem;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  color: #9aa0a6;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.admin-tab-btn.active {
  color: white;
  background: var(--primary);
}

.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #202124;
}

.stat-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.printer-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.pending_approval { background: #fef7e0; color: #b06000; }
.status-badge.printing { background: #e8f0fe; color: #1a73e8; }
.status-badge.ready_for_pickup { background: #e6f4ea; color: #137333; }
.status-badge.completed { background: #f1f3f4; color: #5f6368; }

/* ==========================================================================
   POP-UP NOTIFICATIONS & SOUND CHIME CONTROLS (Admin & Customer)
   ========================================================================== */

/* Chime Button Indicator & States */
.audio-btn-on {
  background: rgba(52, 168, 83, 0.22) !important;
  color: #ffffff !important;
  border-color: #34A853 !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  box-shadow: 0 0 10px rgba(52, 168, 83, 0.35);
  transition: all 0.2s ease;
}

.audio-btn-off {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #dadce0 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.chime-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34A853;
  box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.7);
  animation: chimePulse 1.8s infinite;
}

@keyframes chimePulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(52, 168, 83, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 168, 83, 0); }
}

/* Admin Floating Toast Container */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.admin-order-toast {
  pointer-events: auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 3px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #dadce0;
  overflow: hidden;
  position: relative;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.admin-order-toast.toast-hiding {
  opacity: 0;
  transform: translateX(110%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-accent-bar {
  height: 4px;
  background: linear-gradient(90deg, #4285F4 25%, #EA4335 25% 50%, #FBBC05 50% 75%, #34A853 75%);
}

.toast-content-wrap {
  padding: 1rem 1.15rem;
}

.toast-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.toast-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.toast-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #5f6368;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.toast-close-btn:hover {
  background: #f1f3f4;
  color: #202124;
}

.toast-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #202124;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast-info-text {
  font-size: 0.85rem;
  color: #3c4043;
  margin-bottom: 0.35rem;
}

.toast-meta-row {
  font-size: 0.8rem;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

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

/* Card highlight pulse on jump from notification */
.highlight-order-pulse {
  animation: orderPulse 2.5s ease-out;
}

@keyframes orderPulse {
  0% {
    box-shadow: 0 0 0 6px #1a73e8, 0 8px 24px rgba(26,115,232,0.4);
    transform: scale(1.02);
  }
  50% {
    box-shadow: 0 0 0 3px #1a73e8, 0 4px 12px rgba(26,115,232,0.2);
    transform: scale(1.01);
  }
  100% {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transform: scale(1);
  }
}

/* Customer Ready Modal Styling */
.customer-ready-dialog {
  max-width: 500px;
  text-align: center;
  border-radius: 20px;
  padding: 2.25rem 1.75rem;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: customerReadyPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes customerReadyPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ready-celebration-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #e6f4ea;
  color: #137333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 0 10px rgba(52, 168, 83, 0.12);
  animation: pulseGreenGlow 2s infinite;
}

@keyframes pulseGreenGlow {
  0% { box-shadow: 0 0 0 0 rgba(52, 168, 83, 0.4); }
  70% { box-shadow: 0 0 0 16px rgba(52, 168, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 168, 83, 0); }
}

.customer-ready-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #137333;
  margin-bottom: 0.5rem;
}

.customer-ready-desc {
  font-size: 0.95rem;
  color: #3c4043;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.counter-pickup-box {
  background: #f8fafd;
  border: 2px dashed #4285F4;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.counter-pickup-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #1a73e8;
  letter-spacing: 0.5px;
}

.counter-pickup-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: #202124;
  margin-top: 0.25rem;
}

/* Flashing Alert Indicator on Stepper */
.step-node-ready-flash {
  animation: readyFlash 1.5s infinite;
}

@keyframes readyFlash {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(52,168,83,0)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(52,168,83,0.8)); }
}

/* ==========================================================================
   COMPLETE RESPONSIVE DESIGN SYSTEM (Mobile, Tablet & Desktop)
   ========================================================================== */

/* 1. Global Touch & Viewport Normalization */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Text toggle helpers */
.btn-text-mobile, .mobile-only-text {
  display: none;
}
.btn-text-desktop, .desktop-only-text {
  display: inline;
}

/* 2. Mobile Bottom Floating Checkout Bar */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #dadce0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.14);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-bottom-info {
  display: flex;
  flex-direction: column;
}

.mobile-bottom-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: #188038;
  line-height: 1.1;
}

.mobile-bottom-sheets {
  font-size: 0.76rem;
  color: #5f6368;
  font-weight: 500;
}

.mobile-bottom-proceed-btn {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(26,115,232,0.35);
  white-space: nowrap;
}

/* 3. Form Input Styling (iOS Zoom-Proof at 16px) */
.customer-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mobile-form-input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 16px; /* Essential to prevent iOS Safari auto-zooming! */
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.mobile-form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}

.checkout-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 4. Large Tablets & Small Desktops (max-width: 992px) */
@media (max-width: 992px) {
  .app-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .main-content {
    padding-bottom: 80px; /* Leave room for mobile bottom floating bar */
  }

  .order-summary-sidebar {
    position: static;
    margin-top: 1rem;
  }

  .mobile-bottom-bar {
    display: flex;
  }
}

/* 5. Mobile Landscape & Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .header-container {
    padding: 0.65rem 1rem;
  }

  .welcome-hero {
    padding: 1.25rem 1.15rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .hero-text h2 {
    font-size: 1.35rem;
  }

  .hero-text p {
    font-size: 0.88rem;
  }

  .hero-quick-scan {
    width: 100%;
  }

  .hero-quick-scan a {
    width: 100%;
    justify-content: center;
  }

  .doc-options-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  /* Admin Stats */
  .admin-stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  #adminNavTabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .admin-tab-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* 6. Standard Mobile Phones (max-width: 640px) */
@media (max-width: 640px) {
  .main-content {
    margin: 0.75rem auto;
    padding: 0 0.65rem;
    padding-bottom: 90px;
  }

  /* Compact Header */
  .header-container {
    padding: 0.55rem 0.65rem;
  }

  .brand-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .brand-logo-badge svg {
    width: 22px;
    height: 22px;
  }

  .brand-info h1 {
    font-size: 1.05rem;
  }

  .google-badge-inline {
    font-size: 0.66rem;
    padding: 1px 5px;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .header-action-btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.76rem;
    border-radius: 8px;
  }

  .header-action-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Dropzone on phones */
  .upload-card {
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
  }

  .upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 0.85rem;
  }

  .upload-card h3 {
    font-size: 1.1rem;
  }

  .upload-card p {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .upload-limits {
    font-size: 0.7rem;
    padding: 0.3rem 0.65rem;
  }

  /* Batch toolbar */
  .batch-toolbar {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .apply-all-checkbox-label {
    font-size: 0.85rem;
  }

  /* Document Cards */
  .document-item-card {
    padding: 0.95rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .doc-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    gap: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .doc-thumb {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .doc-file-info {
    min-width: 0;
    width: 0;
    max-width: calc(100% - 90px);
    flex: 1 1 0%;
    gap: 0.65rem;
    overflow: hidden;
  }

  .doc-title-box {
    min-width: 0;
    width: 0;
    flex: 1 1 0%;
    overflow: hidden;
  }

  .doc-name {
    font-size: 0.92rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .doc-meta {
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  .doc-header-action {
    flex-shrink: 0;
  }

  .doc-header-action .btn,
  .doc-remove-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .doc-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
  }

  .option-group {
    min-width: 0;
    width: 100%;
    grid-column: 1 / -1;
  }

  .option-group-paper,
  .option-group-color,
  .option-group-sides,
  .option-group-copies {
    grid-column: 1 / -1;
  }

  .option-group-sides .segment-btn {
    white-space: nowrap;
    padding: 0.5rem 0.35rem;
    font-size: 0.82rem;
  }

  .option-group-copies .stepper-control {
    width: 100%;
    max-width: 100%;
    height: 38px;
  }

  .option-label {
    font-size: 0.7rem;
  }

  .segment-btn {
    font-size: 0.76rem;
    padding: 0.4rem 0.25rem;
    white-space: normal;
    line-height: 1.15;
    min-width: 0;
  }

  .stepper-control {
    height: 36px;
    width: 100%;
    min-width: 0;
  }

  .stepper-btn {
    width: 44px;
    font-size: 1.1rem;
    flex-shrink: 0;
  }

  .stepper-input {
    min-width: 0;
    flex: 1;
  }

  /* Page range row */
  .range-picker-row {
    grid-column: 1 / -1;
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .range-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
  }

  .range-radio-label {
    font-size: 0.82rem;
  }

  .range-custom-input {
    width: 100%;
    font-size: 16px;
    min-width: 0;
    box-sizing: border-box;
  }

  .range-picker-action {
    width: 100%;
  }

  .visual-picker-trigger-btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.82rem;
    box-sizing: border-box;
  }

  .doc-footer-summary {
    font-size: 0.8rem;
  }

  .doc-price-tag {
    font-size: 1.15rem;
  }

  /* Customer Details Form */
  .customer-form-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .checkout-step-container {
    padding: 1.15rem 0.85rem;
    border-radius: var(--radius-md);
  }

  .payment-method-card {
    padding: 0.85rem;
    gap: 0.75rem;
  }

  .payment-icon-box {
    width: 38px;
    height: 38px;
  }

  .checkout-submit-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    text-align: center;
  }

  .checkout-submit-btn {
    width: 100%;
    justify-content: center;
  }

  /* Tracking Stepper on Mobile */
  .stepper-timeline {
    margin: 1.25rem 0 1rem;
  }

  .stepper-timeline::before, .stepper-timeline-progress {
    top: 15px;
    left: 12px;
    right: 12px;
    height: 3px;
  }

  .timeline-step {
    width: auto;
    flex: 1;
    min-width: 0;
    gap: 0.35rem;
    padding: 0 2px;
  }

  .step-circle {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    border-width: 2px;
  }

  .step-label {
    font-size: 0.62rem;
    line-height: 1.15;
    word-break: break-word;
  }

  /* Modal scaling on phone */
  .modal-dialog {
    max-height: 94vh;
    border-radius: 14px;
  }

  .modal-header {
    padding: 0.85rem 1rem;
  }

  .modal-body {
    padding: 1rem 0.85rem;
  }

  .modal-footer {
    padding: 0.85rem 1rem;
  }

  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 0.5rem;
    padding: 0.25rem;
  }

  .page-picker-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .page-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  .page-picker-actions .btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
  }
}

/* 7. Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .brand-info p {
    display: none; /* Hide tagline on narrow screens */
  }

  .btn-text-desktop, .desktop-only-text {
    display: none;
  }

  .btn-text-mobile, .mobile-only-text {
    display: inline;
  }

  .hero-badges .hero-pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
  }

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

  /* Document Card on Small Phones */
  .document-item-card {
    padding: 0.85rem 0.75rem;
    margin-bottom: 0.85rem;
  }

  .doc-header {
    gap: 0.5rem;
    padding-bottom: 0.65rem;
  }

  .doc-thumb {
    width: 38px;
    height: 38px;
    font-size: 0.75rem;
  }

  .doc-file-info {
    min-width: 0;
    width: 0;
    max-width: calc(100% - 80px);
    flex: 1 1 0%;
    gap: 0.5rem;
    overflow: hidden;
  }

  .doc-title-box {
    min-width: 0;
    width: 0;
    flex: 1 1 0%;
    overflow: hidden;
  }

  .doc-name {
    font-size: 0.88rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .doc-meta {
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .doc-header-action .btn,
  .doc-remove-btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
  }

  .doc-options-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .option-group {
    grid-column: 1 / -1;
  }

  .option-label {
    font-size: 0.68rem;
  }

  .segment-btn {
    font-size: 0.74rem;
    padding: 0.45rem 0.2rem;
  }

  .option-group-sides .segment-btn {
    font-size: 0.76rem;
    padding: 0.45rem 0.25rem;
  }

  .stepper-control {
    height: 36px;
  }

  .stepper-btn {
    width: 40px;
  }

  .range-picker-row {
    padding: 0.65rem;
    gap: 0.5rem;
  }

  .visual-picker-trigger-btn {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}

/* 8. Super Narrow Screens (max-width: 360px) */
@media (max-width: 360px) {
  .header-container {
    padding: 0.45rem 0.5rem;
  }

  .document-item-card {
    padding: 0.75rem 0.55rem;
  }

  .doc-header {
    gap: 0.35rem;
  }

  .doc-thumb {
    width: 34px;
    height: 34px;
    font-size: 0.7rem;
  }

  .doc-name {
    font-size: 0.84rem;
  }

  .doc-options-grid {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    width: 100%;
  }

  .option-group {
    grid-column: 1 / -1;
  }

  .segment-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.15rem;
  }

  .option-group-sides .segment-btn {
    font-size: 0.72rem;
    padding: 0.4rem 0.2rem;
  }

  .option-label {
    font-size: 0.65rem;
  }
}
