:root {
  --primary-bg: #0b0f19;
  --card-bg: #ffffff;
  --paper-bg: #ffffff;
  --paper-border: #0f172a;
  
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-navy: #0f172a;
  
  --emerald-green: #10b981;
  --emerald-hover: #059669;
  
  --amber-orange: #f59e0b;
  --rose-red: #ef4444;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-800: #1e293b;

  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.15);
  --shadow-paper: 0 20px 40px -15px rgba(15, 23, 42, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }

body {
  background-color: #0f172a;
  color: #0f172a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#authOverlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-card {
  background: rgba(255, 255, 255, 0.98);
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: authPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  padding: 32px 24px;
  text-align: center;
  position: relative;
}

.auth-logo-icon, .brand-avatar, .sheet-logo-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px auto;
}

.gear-background {
  font-size: 60px;
  color: #052a66;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.85;
}

.brand-letter-i {
  position: relative;
  z-index: 2;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 30px;
  font-weight: 900;
 color: #cbd5e1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  line-height: 1;
}

.auth-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.auth-header p { font-size: 12px; color: #94a3b8; margin-top: 4px; font-weight: 500; }
.auth-header .auth-version { margin-top: 2px; font-size: 10px; letter-spacing: 0.08em; }

.auth-body { padding: 32px 28px 24px 28px; }

.form-group { margin-bottom: 20px; text-align: left; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--slate-700); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.auth-helper { display: block; margin: 6px 0 0 2px; color: var(--slate-500); font-size: 11px; font-weight: 600; }

.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--slate-400); font-size: 16px; }

.form-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--brand-blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}


.auth-error-msg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-auth {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 45px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45); }
.btn-auth:active { transform: translateY(0); }

.auth-footer {
  background: #f8fafc;
  padding: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--slate-500);
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
}

.developer-signature {
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 10px;
  letter-spacing: 0.35px;
}

.developer-signature strong {
  color: #334155;
  font-weight: 800;
}

.developer-caption {
  color: #94a3b8;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
}

.flipped-f {
  display: inline-block;
  transform: scaleX(-1);
}

.app-header {
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 28px;
  color: white;
}

.header-container { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.header-brand { display: flex; align-items: center; gap: 14px; }
.brand-info h1 { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.brand-info p { font-size: 11px; color: #94a3b8; }

.header-user-panel { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.06); padding: 6px 14px; border-radius: 30px; border: 1px solid rgba(255, 255, 255, 0.1); }
.avatar-icon { font-size: 18px; color: #60a5fa; }
.chip-text { text-align: left; }
.user-label { display: block; font-size: 9px; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.user-name { font-size: 12px; font-weight: 700; color: white; }

.btn-logout-icon { background: none; border: none; color: #f87171; font-size: 16px; cursor: pointer; padding: 6px; transition: transform 0.2s ease; }
.btn-logout-icon:hover { transform: scale(1.15); color: #ef4444; }

.sheet-viewport {
  flex: 1;
  background: #cbd5e1;
  padding: 30px 15px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.paper-sheet {
  background: var(--paper-bg);
  width: 100%;
  max-width: 840px;
  padding: 40px 48px;
  border-radius: 4px;
  box-shadow: var(--shadow-paper);
  border: 1px solid #94a3b8;
  position: relative;
}

/* ACİLİYET DAMGASI - ADRESIN ÇAKIŞMASINI ÖNLEYEN DÜZENLEME */
.urgency-badge-stamp {
  position: absolute;
  top: 18px;
  right: 20px;
  border: 2.5px solid #0f172a;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #0f172a;
  transform: rotate(2deg);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 5px rgba(0,0,0,0.08);
  z-index: 10;
  transition: all 0.3s ease;
}
.urgency-badge-stamp.normal { border-color: #94a3b8; color: #64748b; opacity: 0.6; }
.urgency-badge-stamp.acil { border-color: #d40000; color: hwb(0 16% 17%); background: #b58b8b; opacity: 1; }

@keyframes stampPulse {
  from { transform: rotate(2deg) scale(1); }
  to { transform: rotate(2deg) scale(1.05); }
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid var(--paper-border);
  padding-bottom: 14px;
  margin-bottom: 16px;
  padding-top: 6px;
}

.sheet-brand { display: flex; align-items: center; gap: 14px; }
.sheet-brand-titles h1 { font-size: 24px; font-weight: 900; letter-spacing: 0.5px; color: var(--paper-border); line-height: 1.1; }
.sheet-brand-titles h2 { font-size: 13px; font-weight: 800; letter-spacing: 1.2px; color: #334155; margin-top: 2px; }
.sheet-tagline { margin-top: 6px; padding-left: 8px; border-left: 2px solid #c6a15b; color: #243b5a; font-family: Georgia, "Times New Roman", serif; font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.25; letter-spacing: 0.1px; }

.sheet-contact-details {
  align-self: flex-end;
  text-align: right;
  font-size: 12px;
  line-height: 1.4;
  color: #0f172a;
  font-weight: 600;
}

.sheet-title-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sheet-doc-title { font-size: 20px; font-weight: 900; letter-spacing: 2px; text-decoration: underline; color: var(--paper-border); }
.sheet-date-box { font-size: 14px; font-weight: 800; color: var(--paper-border); display: flex; align-items: center; gap: 8px; }
.paper-inline-input { border: none; outline: none; background: transparent; font-size: 15px; font-weight: 700; color: #0038d0; padding: 2px 4px; }
.date-input { border-bottom: 2px solid #0f172a; }

.sheet-customer-meta { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.paper-field-line { display: flex; align-items: baseline; font-size: 22px; font-weight: 800; color: var(--paper-border); }
.paper-label { min-width: 135px; }
.dotted-line { flex: 1; border-bottom: 2px solid #64748b; }
.dotted-line:focus { border-bottom: 2px solid var(--brand-blue); }

.control-toolbar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: #f1f5f9;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1px solid #e2e8f0;
}

.control-item label { display: block; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 4px; }
.tool-select { width: 100%; padding: 8px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-size: 12px; font-weight: 700; color: #0f172a; background: white; outline: none; }

.sheet-table-wrapper { margin-bottom: 18px; }
.paper-grid-table { width: 100%; border-collapse: collapse; border: 2px solid var(--paper-border); }

.paper-grid-table th {
  border: 1.5px solid var(--paper-border);
  background: #f1f5f9;
  padding: 9px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  color: var(--paper-border);
  letter-spacing: 0.5px;
}

.paper-grid-table td {
  border: 1.5px solid var(--paper-border);
  padding: 3px 8px;
  font-size: 14px;
}

.part-name-cell { font-weight: 800; color: #0f172a; }

.quantity-control { display: flex; align-items: stretch; width: 100%; }
.quantity-control .quantity-input { flex: 1 1 0%; min-width: 0; }
.quantity-stepper {
  display: flex;
  flex: 0 0 20px;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid #cbd5e1;
}
.quantity-stepper-button {
  display: flex;
  flex: 1 1 50%;
  align-items: center;
  justify-content: center;
  min-height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 8px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.quantity-stepper-button:hover,
.quantity-stepper-button:active { background: #e2e8f0; color: #0f172a; }

.grid-cell-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  padding: 5px;
  color: #0f172a;
}

.cell-center { text-align: center; color: #0a2367; font-size: 16px; font-weight: 800px; }

.live-summary-bar {
  display: flex;
  justify-content: space-around;
  background: #0f172a;
  color: white;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}

.summary-metric { display: flex; align-items: center; gap: 8px; }
.summary-metric i { color: #60a5fa; }
.summary-metric strong { color: #38bdf8; font-weight: 800; }

.action-dock { display: flex; gap: 12px; }

.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.btn-pdf { background: #16a34a; }
.btn-pdf:hover { background: #15803d; transform: translateY(-1px); }

.btn-print { background: #2563eb; }
.btn-print:hover { background: #1d4ed8; transform: translateY(-1px); }

.btn-reset { background: #dc2626; }
.btn-reset:hover { background: #b91c1c; transform: translateY(-1px); }

/* PRINT RULES - YAZDIRMA VE PDF ÇIKTI AYARLARI */
@media print {
  .no-print, #authOverlay, .app-header { display: none !important; }
  body { background: white; padding: 0; }
  .sheet-viewport { padding: 0; background: white; }
  .paper-sheet { box-shadow: none; border: none; padding: 0; width: 100%; max-width: 100%; position: relative; }
  .paper-inline-input, .grid-cell-input { color: black !important; }
  
  /* Yazdırırken adresin kapanmaması için sağ üst boşluk ve damga konumlandırması */
  .sheet-contact-details { padding-right: 140px !important; }
  .urgency-badge-stamp { 
    position: absolute !important; 
    top: 5px !important; 
    right: 10px !important; 
    border-color: black !important; 
    color: black !important; 
    background: white !important; 
  }
}
/* MOBİL VE DAR EKRAN DÜZENİ */
@media screen and (max-width: 760px) {
  .app-header { padding: 12px 16px; }
  .header-container { gap: 12px; flex-wrap: wrap; }
  .header-brand { gap: 10px; }
  .header-user-panel { gap: 8px; }

  .sheet-viewport { padding: 16px 10px; }
  .paper-sheet { padding: 36px 18px 22px; }
  .sheet-header { flex-direction: column; gap: 12px; }
  .sheet-contact-details { padding-right: 0; text-align: left; }
  .sheet-title-strip { flex-wrap: wrap; gap: 10px; }
  .control-toolbar { grid-template-columns: 1fr; }
  .live-summary-bar { flex-wrap: wrap; justify-content: flex-start; gap: 10px 20px; }
  .action-dock { flex-direction: column; }
  .btn { min-height: 46px; }
}

@media screen and (max-width: 480px) {
  .app-header { padding: 10px 12px; }
  .brand-info h1 { font-size: 14px; }
  .brand-info p { font-size: 10px; }
  .user-chip { padding: 5px 9px; gap: 6px; }
  .user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .sheet-viewport { padding: 10px 6px; }
  .paper-sheet { padding: 34px 12px 18px; }
  .sheet-brand { gap: 8px; }
  .sheet-brand-titles h1 { font-size: 19px; }
  .sheet-brand-titles h2 { font-size: 10px; letter-spacing: 0.7px; }
  .sheet-tagline { font-size: 9.5px; }
  .sheet-contact-details { font-size: 10px; }
  .sheet-doc-title { font-size: 16px; letter-spacing: 1px; }
  .sheet-date-box { font-size: 12px; }
  .sheet-date-box .paper-inline-input { font-size: 13px; }

  .paper-field-line { align-items: flex-start; flex-direction: column; gap: 3px; font-size: 12px; }
  .paper-label { min-width: 0; }
  .dotted-line { width: 100%; min-width: 0; }
  .control-toolbar { padding: 10px; }
  .paper-grid-table th { padding: 7px 4px; font-size: 10px; letter-spacing: 0; }
  .paper-grid-table td { padding: 3px 4px; }
  .grid-cell-input { padding: 5px 3px; font-size: 12px; }
  .quantity-stepper { flex-basis: 18px; }
  .cell-center { font-size: 16px; }
  .live-summary-bar { flex-direction: column; gap: 8px; font-size: 12px; }
  .urgency-badge-stamp { top: 8px; right: 8px; font-size: 9px; padding: 3px 7px; }
}

@page { size: A4; margin: 12mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .paper-grid-table tr { break-inside: avoid; page-break-inside: avoid; }
}




/* PDF PAYLAŞIMI */
.time-label { font-weight: 800; color: #0f172a; margin-left: 8px; }
.time-output { min-width: 42px; border-bottom: 2px solid #0f172a; color: #1d4ed8; }
.pdf-export-sheet {
  width: 194mm !important; min-width: 194mm !important; max-width: none !important; margin: 0 !important;
  padding: 0 !important; border: none !important; border-radius: 0 !important;
  box-shadow: none !important; position: relative !important; background: #fff !important;
}
.pdf-export-sheet .no-print { display: none !important; }
.pdf-export-sheet .sheet-header { display: flex !important; flex-direction: row !important; align-items: flex-start !important; gap: 10px !important; margin-bottom: 9px !important; padding: 0 0 9px !important; }
.pdf-export-sheet .sheet-logo-badge { flex: 0 0 58px !important; width: 58px !important; height: 58px !important; margin: 0 !important; }
.pdf-export-sheet .sheet-brand { flex: 0 0 auto !important; gap: 9px !important; }
.pdf-export-sheet .sheet-brand-titles h1 { font-size: 21px !important; }
.pdf-export-sheet .sheet-brand-titles h2 { font-size: 11px !important; letter-spacing: .7px !important; }
.pdf-export-sheet .sheet-tagline { margin-top: 4px !important; padding-left: 7px !important; border-left-width: 2px !important; font-size: 9.5px !important; font-weight: 700 !important; line-height: 1.15 !important; }
.pdf-export-sheet .sheet-contact-details { flex: 1 1 auto !important; min-width: 0 !important; align-self: flex-end !important; padding-right: 0 !important; text-align: right !important; font-size: 10px !important; line-height: 1.25 !important; }
.pdf-export-sheet .urgency-badge-stamp { top: 5px; right: 10px; }
.pdf-export-sheet .sheet-title-strip { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 8px !important; margin-bottom: 10px !important; }
.pdf-export-sheet .sheet-doc-title { flex: 0 0 auto !important; font-size: 17px !important; letter-spacing: 1px !important; white-space: nowrap !important; }
.pdf-export-sheet .sheet-date-box { flex: 0 0 auto !important; gap: 4px !important; font-size: 11px !important; white-space: nowrap !important; }
.pdf-export-sheet .sheet-date-box .paper-inline-input { font-size: 11px !important; }
.pdf-export-sheet .time-label { margin-left: 3px !important; }
.pdf-export-sheet .time-output { min-width: 34px !important; }
.pdf-export-sheet .sheet-customer-meta { gap: 5px !important; margin-bottom: 10px !important; }
.pdf-export-sheet .paper-field-line { flex-direction: row !important; align-items: baseline !important; gap: 5px !important; font-size: 11px !important; }
.pdf-export-sheet .paper-label { flex: 0 0 120px !important; min-width: 120px !important; }
.pdf-export-sheet .dotted-line { flex: 1 1 auto !important; width: auto !important; min-width: 0 !important; font-size: 18px !important; }
.pdf-export-sheet .sheet-table-wrapper { margin-bottom: 0 !important; overflow: visible !important; }
.pdf-export-sheet .paper-grid-table { width: 100% !important; table-layout: fixed !important; }
.pdf-export-sheet .paper-grid-table th { padding: 5px 5px !important; font-size: 12px !important; line-height: 1.2 !important; }
.pdf-export-sheet .paper-grid-table tbody tr { height: 42px !important; }
.pdf-export-sheet .paper-grid-table td { padding: 2px 6px !important; font-size: 16px !important; line-height: 1.2 !important;font-weight: 400px !important; }
.pdf-export-sheet .grid-cell-input { padding: 3px 4px !important; font-size: 13px !important; line-height: 1.15 !important; }
.pdf-export-sheet .live-summary-bar { flex-direction: row !important; flex-wrap: nowrap !important; justify-content: space-around !important; align-items: center !important; margin: 8px 0 0 !important; padding: 8px 10px !important; font-size: 10px !important; }
.pdf-export-sheet .summary-metric { gap: 5px !important; }
.pdf-export-sheet .summary-metric i { font-size: 10px !important; }
.pdf-export-sheet .cell-center { font-size: 16px !important; font-weight: 800 !important; }
.pdf-preparing-card { display: flex; align-items: center; gap: 12px; }
.pdf-preparing-card p { margin: 0; }
.pdf-loading-spinner { width: 20px; height: 20px; flex: 0 0 20px; border: 3px solid #cbd5e1; border-top-color: #2563eb; border-radius: 50%; animation: pdfSpin .8s linear infinite; }
@keyframes pdfSpin { to { transform: rotate(360deg); } }
.pdf-share-modal {
  position: fixed; inset: 0; z-index: 100000; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 42, 0.62);
}
.pdf-share-card {
  width: min(100%, 420px); padding: 24px; border-radius: 16px;
  background: #fff; color: #0f172a; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.pdf-share-card h2 { margin-bottom: 8px; font-size: 18px; }
.pdf-share-card p { margin-bottom: 18px; font-size: 14px; line-height: 1.5; color: #475569; }
.pdf-share-actions { display: flex; flex-direction: column; gap: 8px; }
.pdf-share-actions button {
  min-height: 44px; padding: 10px 14px; border: 0; border-radius: 8px;
  color: #fff; background: #16a34a; font-weight: 800; cursor: pointer;
}
.pdf-share-actions button.secondary { background: #475569; }
.pdf-share-close { margin-top: 12px; color: #475569; background: none; border: 0; cursor: pointer; }
.sheet-customer-meta .paper-inline-input {
  color: #0f172a;
}

/* Personel girişi ve ortak sipariş geçmişi */
#authOverlay .auth-card { max-height: 95vh; overflow-y: auto; }
#authOverlay .auth-body { padding-top: 22px; }
#authOverlay .btn-auth { font-size: 14px; min-height: 48px; padding: 12px 16px; }
#authOverlay .btn-auth:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-body .form-group { margin-bottom: 14px; }
.order-history-dialog { width: min(760px, calc(100% - 24px)); max-height: 86vh; margin: auto; padding: 20px; border: 0; border-radius: 16px; color: #0f172a; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.order-history-dialog::backdrop { background: rgba(15,23,42,.68); backdrop-filter: blur(3px); }
.history-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.history-dialog-header h2 { margin: 0 0 5px; font-size: 20px; }
.history-dialog-header p { color: #64748b; font-size: 13px; line-height: 1.4; }
.history-close { width: 36px; height: 36px; flex: 0 0 36px; border: 0; border-radius: 50%; background: #f1f5f9; color: #334155; font-size: 25px; line-height: 1; cursor: pointer; }
.history-search { width: 100%; min-height: 44px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 14px; }
.history-results { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.history-order-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.history-order-details { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.history-order-details strong { overflow-wrap: anywhere; font-size: 14px; }
.history-order-details span { color: #64748b; font-size: 11px; line-height: 1.4; }
.history-copy-button { min-height: 40px; flex: 0 0 auto; padding: 8px 12px; border: 0; border-radius: 8px; background: #2563eb; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.history-more-button { min-height: 42px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: #334155; font-size: 13px; font-weight: 700; cursor: pointer; }
.history-empty { padding: 18px 8px; color: #64748b; font-size: 14px; text-align: center; }
.btn-history { border: 0; background: #475569; color: #fff; }
.btn-history:hover { background: #334155; }
.local-preview-notice { max-width: 900px; margin: 0 auto 12px; padding: 10px 14px; border: 1px solid #fcd34d; border-radius: 9px; background: #fffbeb; color: #854d0e; font-size: 12px; font-weight: 700; line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media screen and (max-width: 480px) {
  .order-history-dialog { padding: 16px 12px; }
  .history-order-card { align-items: stretch; flex-direction: column; }
  .history-copy-button { width: 100%; }
  #authOverlay .auth-card { max-height: 96vh; border-radius: 18px; }
  #authOverlay .auth-header { padding: 20px 18px; }
  #authOverlay .auth-body { padding: 18px 18px 20px; }
}
