/* Shared by the blank form (auftragszettel.html) and the filled one (/auftragszettel/<id>). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

  body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: #1e293b;
    background: #fff;
    font-size: 11px;
    line-height: 1.4;
  }

  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  .page {
    max-width: 210mm;
    margin: 0 auto;
    padding: 12mm 14mm;
  }

  @media print {
    .page { padding: 0; }
    .no-print { display: none !important; }
  }

  /* Header */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 3px solid #0C4A6E;
    margin-bottom: 16px;
  }

  .logo-block { display: flex; align-items: center; gap: 12px; }

  .logo-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
  }

  .logo-icon img { width: 40px; height: 40px; }

  .brand-name {
    font-size: 22px;
    font-weight: 700;
    color: #0C4A6E;
    letter-spacing: -0.5px;
  }

  .brand-sub {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 1px;
  }

  .company-info {
    text-align: right;
    font-size: 9px;
    color: #64748b;
    line-height: 1.5;
  }

  .company-info strong { color: #0C4A6E; }

  /* Title bar */
  .title-bar {
    background: linear-gradient(135deg, #0C4A6E, #0EA5E9);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .title-bar h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  .title-bar .lab-select {
    display: flex;
    gap: 14px;
    font-size: 11px;
    font-weight: 500;
  }

  .title-bar .lab-select label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }

  .title-bar .lab-select input[type="checkbox"] {
    width: 15px; height: 15px;
    accent-color: #F59E0B;
    cursor: pointer;
  }

  /* Info grid */
  .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
    margin-bottom: 16px;
  }

  .info-field {
    display: flex;
    align-items: baseline;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding: 5px 0;
  }

  .info-field .label {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 90px;
  }

  .info-field .value {
    flex: 1;
    font-size: 11px;
    min-height: 16px;
  }

  /* Tooth chart */
  .tooth-chart {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    text-align: center;
  }

  .tooth-chart-label {
    font-size: 8px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }

  .tooth-row {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 4px;
  }

  .tooth-row:last-child { margin-bottom: 0; }

  .tooth-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #334155;
    border: 1px solid #cbd5e1;
    background: white;
    cursor: pointer;
    transition: all 0.15s;
  }

  .tooth-num:hover { background: #0EA5E9; color: white; border-color: #0EA5E9; }

  .tooth-divider {
    width: 2px;
    background: #0C4A6E;
    margin: 0 2px;
  }

  .quadrant-labels {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 2px;
  }

  .quadrant-label {
    width: 224px;
    font-size: 8px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Section cards */
  .sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .section-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
  }

  .section-card-header {
    background: #0C4A6E;
    color: white;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 12px;
  }

  .section-card-body { padding: 10px 12px; min-height: 120px; }

  .field-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
  }

  .field-row:last-child { margin-bottom: 0; }

  .field-row .flabel {
    font-size: 9px;
    font-weight: 500;
    color: #64748b;
    min-width: 65px;
  }

  .field-row .fvalue {
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
    min-height: 14px;
    font-size: 11px;
  }

  .checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
  }

  .checkbox-item:last-child { margin-bottom: 0; }

  .cb {
    width: 14px; height: 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .checkbox-item span {
    font-size: 10px;
    color: #334155;
  }

  /* Farbverlauf tooth diagram */
  .color-diagram {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
  }

  .color-tooth {
    width: 24px;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
  }

  .color-tooth div {
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6px;
    font-weight: 600;
    color: white;
  }

  .ct-gingival { background: #f59e0b; }
  .ct-body { background: #fbbf24; }
  .ct-incisal { background: #fde68a; color: #92400e !important; }

  /* Options grid */
  .options-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .option-group h4 {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #0C4A6E;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid #0EA5E9;
  }

  /* Anweisungen */
  .instructions {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
  }

  .instructions-header {
    background: #0C4A6E;
    color: white;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 12px;
  }

  .instructions-body {
    padding: 8px 12px;
    min-height: 160px;
  }

  .instructions-line {
    border-bottom: 1px dashed #e2e8f0;
    height: 20px;
  }

  /* Footer */
  .footer {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .footer-left {
    font-size: 8px;
    color: #94a3b8;
  }

  .footer-badges {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 8px;
    font-weight: 700;
    color: #0C4A6E;
  }

  /* Print button */
  .print-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0C4A6E;
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 100;
  }

  .print-bar button {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
  }

  .print-bar button:hover { background: #d97706; }

  .print-bar button.secondary {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
  }

  .print-bar button.secondary:hover { background: rgba(255,255,255,0.1); }

  /* Mobile responsive */
  @media screen and (max-width: 700px) {
    .page { padding: 4mm 3mm; }

    .header { flex-direction: column; gap: 8px; }
    .company-info { text-align: left; }

    .brand-name { font-size: 18px; }

    .title-bar { flex-direction: column; gap: 8px; text-align: center; }
    .title-bar h1 { font-size: 14px; }

    .info-grid { grid-template-columns: 1fr; gap: 4px; }

    .tooth-chart { padding: 8px 4px; overflow-x: auto; }
    .tooth-row { flex-wrap: nowrap; min-width: 0; }
    .tooth-num { width: 22px; height: 22px; font-size: 8px; }
    .tooth-divider { margin: 0 1px; }

    .sections-row { grid-template-columns: 1fr; gap: 8px; }

    .options-grid {
      grid-template-columns: 1fr 1fr;
      gap: 12px 16px;
    }

    .instructions-body { min-height: 120px; }

    .footer { flex-direction: column; gap: 6px; align-items: flex-start; }

    .print-bar { padding: 8px 12px; }
    .print-bar button { font-size: 12px; padding: 8px 16px; }
  }

  @media screen and (max-width: 400px) {
    .tooth-num { width: 18px; height: 18px; font-size: 7px; }
    .options-grid { grid-template-columns: 1fr; }
  }
