/* ================================================================
   SINIF OTURMA PLANI — style.css (Ultra Mobile Responsive Edition)
================================================================ */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-hover: #15803d;
  --warning: #d97706;
  --danger: #dc2626;

  --bg-workspace: #ffffff;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;

  --a4-landscape-w: 1140px;
  --a4-landscape-h: 800px;

  --a4-portrait-w: 860px;
  --a4-portrait-h: 1200px;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.app-container {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px 24px;
  background: #ffffff;
  min-height: 100vh;
}

/* ================================================================
   1. ARAÇ ÇUBUĞU (TOOLBAR - DESKTOP & MOBİL UYUMLU)
================================================================ */
.app-toolbar {
  width: 100%;
  max-width: var(--a4-landscape-w);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 8px;
  z-index: 100;
  transition: max-width 0.2s ease;
  flex-wrap: wrap;
}

.is-portrait .app-toolbar {
  max-width: var(--a4-portrait-w);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Butonlar */
.btn-main-add {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #2563eb;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37,99,235,0.2);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-main-add svg { width: 14px; height: 14px; color: #ffffff; flex-shrink: 0; }
.btn-main-add:hover { background: #1d4ed8; transform: translateY(-1px); }

.btn-main-import {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 6px;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-main-import svg { width: 14px; height: 14px; color: #16a34a; flex-shrink: 0; }
.btn-main-import:hover { background: #dcfce7; border-color: #4ade80; }

.dropdown-wrapper {
  position: relative;
}

.dropdown-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.dropdown-toggle-btn svg { width: 13px; height: 13px; color: #64748b; flex-shrink: 0; }
.dropdown-toggle-btn .arrow-down { font-size: 10px; color: #94a3b8; }
.dropdown-toggle-btn:hover { background: #f1f5f9; border-color: #94a3b8; color: #0f172a; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 12px;
  min-width: 270px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: popDown 0.15s ease;
}

.dropdown-panel-wide {
  min-width: 320px;
}

.dropdown-panel.active {
  display: flex;
}

@keyframes popDown {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.panel-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel-section { display: flex; flex-direction: column; gap: 4px; }
.panel-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

.segmented-control { display: flex; background: #f1f5f9; padding: 2px; border-radius: 6px; border: 1px solid #e2e8f0; }
.seg-btn {
  flex: 1;
  padding: 4px 6px;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.seg-btn:hover { color: #0f172a; }
.seg-btn.active { background: #ffffff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

.toggle-buttons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.toggle-vis-btn {
  padding: 5px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.toggle-vis-btn.active { background: #eff6ff; border-color: #3b82f6; color: #1e40af; font-weight: 700; }

.row-adjuster {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  justify-content: space-between;
}

.btn-step {
  width: 24px;
  height: 24px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-step:hover { background: #e2e8f0; color: #000; }
#displayRowCount { font-size: 11.5px; font-weight: 700; color: #1e293b; }

.menu-action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
  font-family: inherit;
}

.menu-action-item svg { width: 14px; height: 14px; color: #64748b; }
.menu-action-item:hover { background: #f1f5f9; color: #0f172a; }
.menu-action-item.danger { color: var(--danger); }
.menu-action-item.danger:hover { background: #fef2f2; }
.menu-divider { height: 1px; background: #e2e8f0; margin: 2px 0; }

.export-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.export-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-pdf { background: #dc2626; color: #ffffff; }
.btn-pdf:hover { background: #b91c1c; }
.btn-word { background: #2563eb; color: #ffffff; }
.btn-word:hover { background: #1d4ed8; }
.btn-print { background: #0f172a; color: #ffffff; }
.btn-print:hover { background: #334155; }

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f8fafc;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.zoom-btn {
  padding: 2px 6px;
  height: 22px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
}

.zoom-btn:hover { background: #e2e8f0; color: #0f172a; }
#zoomPercent { min-width: 32px; text-align: center; font-size: 11px; font-weight: 700; color: #334155; }

/* ================================================================
   2. KAĞIT VE ÖLÇEKLEME ALANI (SCALE WRAPPER)
================================================================ */
.paper-wrapper {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 0 30px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Ölçekleme Taşıyıcısı (DOM Taşırmaz, Tam Boyutlanır) */
.sheet-scaler-box {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transition: width 0.1s ease, height 0.1s ease;
  transform-origin: top center;
}

/* ----------------------------------------------------------------
   A4 KAĞIT YAPISI
---------------------------------------------------------------- */
.a4-sheet {
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transform-origin: top center;
  transition: width 0.2s ease, min-height 0.2s ease;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  flex-shrink: 0;
}

.a4-sheet.landscape {
  width: var(--a4-landscape-w);
  min-height: var(--a4-landscape-h);
  height: var(--a4-landscape-h);
}

.a4-sheet.portrait {
  width: var(--a4-portrait-w);
  min-height: var(--a4-portrait-h);
  height: var(--a4-portrait-h);
}

.input-editable {
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.input-editable:hover { border-color: #cbd5e1; background: #f8fafc; }
.input-editable:focus { border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

/* 1. ÜST BAŞLIK */
.a4-header {
  border: 2px solid #1e293b;
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 6px;
  background: #ffffff;
  flex-shrink: 0;
}

.header-main-title {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
}

.school-name-input {
  font-size: 15.5px;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 100%;
  line-height: 1.2;
  padding: 1px 4px;
}

.academic-year-input {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  line-height: 1.2;
  padding: 1px 4px;
}

.class-title-input {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  text-align: center;
  text-transform: uppercase;
  width: 100%;
  line-height: 1.2;
  padding: 1px 4px;
}

.header-meta-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 8px;
  border-top: 1px solid #cbd5e1;
  padding-top: 4px;
  font-size: 11px;
}

.meta-box { display: flex; align-items: center; gap: 4px; }
.meta-label-input { font-weight: 700; color: #475569; width: auto; max-width: 130px; padding: 1px 3px; font-size: 11px; }
.meta-input { flex: 1; font-weight: 600; color: #0f172a; padding: 1px 4px; }
.meta-static { font-weight: 800; color: #0f172a; white-space: nowrap; }

/* 2. SINIFIN ÖNÜ */
.classroom-front-container {
  margin-bottom: 6px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.front-row-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.front-slot { min-width: 120px; display: flex; align-items: center; }
.front-slot.left-slot { justify-content: flex-start; }
.front-slot.right-slot { justify-content: flex-end; }

.blackboard-wrapper {
  flex: 1;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.blackboard {
  width: 100%;
  background: #1e293b;
  color: #ffffff;
  border-radius: 5px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.blackboard-input {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  width: 100%;
  outline: none;
  cursor: text;
  text-transform: uppercase;
}

.blackboard-input:focus { background: rgba(255,255,255,0.15); border-radius: 3px; }
.board-icon { width: 13px; height: 13px; flex-shrink: 0; }
.front-center-slot { display: flex; justify-content: center; width: 100%; }

.door-sign {
  background: #f1f5f9;
  border: 1.5px dashed #94a3b8;
  border-radius: 5px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.door-sign-input { font-size: 10.5px; font-weight: 700; color: #475569; background: transparent; border: none; outline: none; text-align: center; width: 100%; }

.teacher-desk {
  background: #f8fafc;
  border: 1.5px solid #64748b;
  border-radius: 5px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.teacher-desk-input { font-size: 10.5px; font-weight: 700; color: #1e293b; background: transparent; border: none; outline: none; text-align: center; width: 100%; }
.teacher-desk.center-desk { background: #eff6ff; border-color: #3b82f6; box-shadow: 0 1px 3px rgba(37,99,235,0.12); }
.teacher-desk.center-desk .teacher-desk-input { color: #1e40af; }

/* 3. SIRALAR & GRID */
.seating-grid { flex: 1; display: grid; gap: 8px; height: 100%; min-height: 0; }
.seating-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.seating-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.seating-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.seating-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.column-group {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  min-height: 0;
}

.column-header {
  font-size: 10.5px;
  font-weight: 800;
  color: #334155;
  text-align: center;
  padding-bottom: 2px;
  border-bottom: 1.5px dashed #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.desk-row { flex: 1; display: flex; gap: 5px; min-height: 0; }
.seat-box {
  flex: 1;
  height: 100%;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.15s ease;
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.seat-box:hover { border-color: var(--primary); box-shadow: 0 3px 8px rgba(0,0,0,0.09); }
.seat-box:active { cursor: grabbing; }
.seat-box.empty { background: #ffffff; border-style: dashed; }
.seat-box.empty:hover { background: #f0fdf4; border-color: var(--success); }

.seat-box.dragging { opacity: 0.45; transform: scale(0.96); border: 2px dashed #3b82f6 !important; }
.seat-box.drag-over { border: 2.5px solid #2563eb !important; background: #eff6ff !important; box-shadow: 0 0 12px rgba(37,99,235,0.35) !important; transform: scale(1.03); z-index: 10; }
.seat-box.swap-selected { border: 2.5px solid #16a34a !important; background: #f0fdf4 !important; box-shadow: 0 0 12px rgba(22,163,74,0.45) !important; animation: pulseSwap 1.2s infinite; }

@keyframes pulseSwap { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.seat-top { display: flex; align-items: center; justify-content: space-between; gap: 2px; flex-shrink: 0; }
.seat-num-input {
  width: 46px;
  font-size: 10px;
  font-weight: 800;
  color: #334155;
  background: rgba(0,0,0,0.06);
  padding: 1px 3px;
  border-radius: 3px;
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
  transition: all 0.12s ease;
  cursor: text;
}

.seat-num-input:hover { border-color: #cbd5e1; background: #ffffff; }
.seat-num-input:focus { border-color: var(--primary); background: #ffffff; color: #0f172a; box-shadow: 0 0 0 1px var(--primary); }

.seat-action-icons { display: flex; align-items: center; gap: 4px; }
.seat-swap-btn {
  font-size: 11px;
  color: #64748b;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
  user-select: none;
}

.seat-swap-btn:hover { background: #e2e8f0; color: #0f172a; transform: scale(1.15); }
.seat-color-badge { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.25); cursor: pointer; transition: transform 0.12s ease; }
.seat-color-badge:hover { transform: scale(1.3); }

.seat-name-input {
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  border: 1px solid transparent;
  background: transparent;
  outline: none;
  font-family: inherit;
  padding: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 3px;
  transition: all 0.12s ease;
  cursor: text;
}

.seat-name-input::placeholder { color: #94a3b8; font-weight: 500; font-style: italic; font-size: 11.5px; }
.seat-name-input:hover { border-color: #cbd5e1; background: rgba(255,255,255,0.8); }
.seat-name-input:focus { background: #ffffff; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.seating-grid.rows-5 .seat-name-input { font-size: 11.5px; }
.seating-grid.rows-6 .seat-name-input { font-size: 10.5px; }
.seating-grid.rows-6 .seat-box { padding: 2px 4px; }
.seating-grid.rows-7 .seat-name-input, .seating-grid.rows-8 .seat-name-input { font-size: 10px; }

.a4-footer {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid #cbd5e1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 10px;
  flex-shrink: 0;
  min-height: 48px;
}

.footer-slot { display: flex; align-items: center; }
.footer-slot.footer-left { flex: 1; justify-content: flex-start; }
.footer-slot.footer-center { flex: 1; justify-content: center; }
.footer-slot.footer-right { flex: 1; justify-content: flex-end; }

.signature-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 170px;
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
}

.sig-input-title { font-size: 10.5px; font-weight: 700; color: #475569; text-align: center; width: 100%; }
.sig-input-name { font-size: 11.5px; font-weight: 800; color: #0f172a; text-align: center; width: 100%; }
.sig-line { margin-top: 8px; border-top: 1px dotted #94a3b8; padding-top: 1px; color: #64748b; font-size: 9px; }

/* Renk Paleti */
.color-picker-flyout {
  position: fixed;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 1000;
  display: none;
  width: 180px;
}

.color-picker-flyout.active { display: block; }
.color-picker-title { font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 6px; }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 8px; }
.color-opt { width: 26px; height: 26px; border-radius: 5px; cursor: pointer; transition: transform 0.12s ease; }
.color-opt:hover { transform: scale(1.15); }
.color-picker-footer { border-top: 1px solid #f1f5f9; padding-top: 6px; }
.btn-clear-seat { width: 100%; padding: 4px; background: #fee2e2; color: #dc2626; border: none; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-clear-seat:hover { background: #fecaca; }

/* Modallar */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.modal-backdrop.active { display: flex; }
.modal-card { background: #ffffff; border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); width: 100%; overflow: hidden; animation: popIn 0.18s ease; max-height: 90vh; display: flex; flex-direction: column; }
.modal-card.modal-sm { max-width: 420px; }
.modal-card.modal-lg { max-width: 600px; }

@keyframes popIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header { padding: 12px 18px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-size: 14px; font-weight: 700; color: #0f172a; }
.modal-close-btn { background: transparent; border: none; font-size: 14px; color: #64748b; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.modal-close-btn:hover { background: #f1f5f9; color: #0f172a; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: #334155; margin-bottom: 4px; }
.form-label .required { color: var(--danger); }
.form-input { width: 100%; padding: 8px 12px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-size: 13px; font-family: inherit; outline: none; transition: border-color 0.15s ease; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.radio-hint { font-size: 11.5px; color: #64748b; line-height: 1.4; background: #f8fafc; padding: 8px 10px; border-radius: 5px; border: 1px solid #e2e8f0; }

.import-tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.tab-btn { padding: 6px 12px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12px; font-weight: 600; color: #475569; cursor: pointer; transition: all 0.15s ease; }
.tab-btn.active { background: #eff6ff; border-color: var(--primary); color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

.upload-dropzone { border: 2px dashed #cbd5e1; border-radius: 8px; padding: 22px 14px; text-align: center; background: #f8fafc; cursor: pointer; transition: all 0.15s ease; }
.upload-dropzone.dragover { border-color: var(--primary); background: #eff6ff; }
.dropzone-icon { width: 34px; height: 34px; color: var(--primary); margin-bottom: 6px; }
.dropzone-title { font-size: 12.5px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.dropzone-subtitle { font-size: 11px; color: #64748b; margin-bottom: 10px; }
.btn-select-file { display: inline-block; padding: 6px 14px; background: var(--primary); color: #ffffff; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s ease; }
.btn-select-file:hover { background: var(--primary-hover); }
.file-status { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--primary); text-align: center; }

.modal-desc { font-size: 11.5px; color: #64748b; margin-bottom: 8px; line-height: 1.4; }
.modal-desc code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-family: monospace; }
#importTextArea { width: 100%; min-height: 120px; padding: 8px 10px; border: 1.5px solid #cbd5e1; border-radius: 6px; font-size: 12px; font-family: inherit; outline: none; resize: vertical; }
#importTextArea:focus { border-color: var(--primary); }

.parsed-preview-box { margin-top: 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; padding: 8px 12px; }
.preview-header { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.preview-list { max-height: 100px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 4px; }
.preview-tag { background: #ffffff; border: 1px solid #cbd5e1; border-radius: 4px; padding: 2px 6px; font-size: 10.5px; font-weight: 600; color: #0f172a; }

.modal-footer { padding: 10px 18px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 8px; background: #f8fafc; flex-shrink: 0; }
.btn-secondary { padding: 6px 14px; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12px; font-weight: 600; color: #475569; cursor: pointer; }
.btn-secondary:hover { background: #f1f5f9; }
.btn-primary { padding: 6px 18px; background: var(--primary); border: 1px solid var(--primary); border-radius: 6px; font-size: 12px; font-weight: 700; color: #ffffff; cursor: pointer; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.toast-container { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; z-index: 3000; }
.toast { padding: 9px 14px; background: #1e293b; color: #ffffff; border-radius: 7px; font-size: 12px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,0.25); animation: slideToast 0.25s ease; }
.toast.success { background: #15803d; }
.toast.error   { background: #b91c1c; }
.toast.info    { background: #1d4ed8; }

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

/* ================================================================
   3. ÖZEL MOBİL VE TABLET DÜZENİ (MÜKEMMEL AUTO-FIT)
================================================================ */
@media (max-width: 900px) {
  .app-container {
    padding: 4px 4px 16px;
  }

  .app-toolbar {
    padding: 6px 8px;
    gap: 6px;
    justify-content: center;
  }

  .toolbar-group {
    justify-content: center;
    gap: 5px;
  }

  .dropdown-panel {
    position: fixed;
    top: 50px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: 500px;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 2px 2px 12px;
  }

  .app-toolbar {
    padding: 5px 6px;
    gap: 4px;
  }

  .btn-main-add, .btn-main-import, .dropdown-toggle-btn, .export-btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  .btn-main-add span, .btn-main-import span {
    font-size: 11px;
  }

  .zoom-controls {
    padding: 1px 2px;
  }

  .zoom-btn {
    padding: 1px 4px;
    font-size: 10.5px;
  }

  #zoomPercent {
    font-size: 10px;
    min-width: 26px;
  }
}

@media screen and (max-width: 900px) {
  .app-toolbar button, .dropdown-panel button, .modal-card button, .btn-select-file { min-height: 44px; }
  .zoom-btn, .btn-step, .modal-close-btn { min-width: 44px; height: 44px; }
  .dropdown-panel, .dropdown-panel-wide { min-width: 0; max-height: calc(100dvh - 72px); }
  .dropdown-panel input:not([type=checkbox]):not([type=radio]), .dropdown-panel select,
  .modal-card input:not([type=checkbox]):not([type=radio]), .modal-card select, #importTextArea { min-width: 0; max-width: 100%; font-size: 16px; min-height: 44px; }
  .panel-grid-2, .toggle-buttons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented-control, .import-tabs, .modal-footer { flex-wrap: wrap; }
  .seg-btn { white-space: normal; }
  .modal-card { max-height: calc(100dvh - 24px); }
  .modal-body { min-height: 0; }
  .paper-wrapper { justify-content: flex-start; overscroll-behavior-x: contain; }
  .sheet-scaler-box { flex-shrink: 0; margin-inline: auto; }
  .toast-container { left: 12px; right: 12px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .toast { overflow-wrap: anywhere; }
}

/* ================================================================
   4. YAZDIRMA (PRINT) STİLLERİ
================================================================ */
@page {
  size: landscape;
  margin: 0;
}

@media print {
  html, body {
    background: #ffffff !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .no-print {
    display: none !important;
  }

  .seat-swap-btn {
    display: none !important;
  }

  .app-container, .paper-wrapper, .sheet-scaler-box {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
  }

  .a4-sheet {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 8mm 12mm !important;
    margin: 0 auto !important;
    transform: none !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .input-editable, .seat-num-input, .seat-name-input {
    border: none !important;
    background: transparent !important;
  }

  .seat-box {
    page-break-inside: avoid;
    break-inside: avoid;
    cursor: default !important;
  }
}
