* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:Arial,sans-serif; background:#f0f0f0; }

/* Top Bar */
.top { background:#1a237e; color:#fff; padding:15px; display:flex; align-items:center; gap:10px; }
.top h1 { flex:1; font-size:20px; }

/* Buttons */
.reset-btn { background:#f44336; color:#fff; border:none; padding:10px 15px; border-radius:8px; font-size:14px; font-weight:bold; cursor:pointer; }
.badge { background:#fff; color:#1a237e; width:45px; height:45px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:bold; font-size:20px; }

/* Input Box */
.input-box { margin:15px; padding:15px; background:#fff; border:3px solid #1a237e; border-radius:12px; display:flex; align-items:center; }
.input-box input { flex:1; border:none; font-size:20px; outline:none; }
.search-barcode-btn { background:#1a237e; color:#fff; border:none; padding:10px 20px; border-radius:8px; font-size:16px; font-weight:bold; cursor:pointer; margin-left:10px; }

/* Last Scanned Item */
.last { margin:0 15px 10px; padding:15px; background:#c8e6c9; border-radius:12px; display:flex; align-items:center; }
.last-info { flex:1; }
.last-kod { font-weight:bold; color:#1a237e; font-size:16px; }
.last-ad { color:#333; font-size:13px; }
.last-meta { display:flex; gap:8px; margin-top:5px; flex-wrap:wrap; }
.last-meta span { background:#fff; padding:2px 6px; border-radius:4px; font-size:11px; color:#555; }
.last-adet { font-size:60px; font-weight:bold; color:#2e7d32; cursor:pointer; }

/* Items List */
.list { margin:0 15px; background:#fff; border-radius:12px; max-height:calc(100vh - 380px); overflow-y:auto; }
.item { padding:10px 12px; border-bottom:1px solid #eee; display:flex; align-items:center; }
.item-info { flex:1; }
.item-kod { font-weight:bold; font-size:14px; }
.item-ad { color:#666; font-size:12px; }
.item-meta { display:flex; gap:6px; margin-top:4px; flex-wrap:wrap; }
.item-meta span { background:#c8e6c9; padding:3px 8px; border-radius:4px; font-size:12px; color:#2e7d32; font-weight:500; }
.item-adet { font-size:28px; font-weight:bold; color:#1a237e; min-width:50px; text-align:center; background:#e8eaf6; padding:8px 12px; border-radius:8px; cursor:pointer; }

/* Barkod Tag */
.barcode-tag { background:#e3f2fd; padding:4px 8px; border-radius:4px; font-size:12px; color:#1565c0; display:inline-flex; align-items:center; gap:5px; }
.barcode-tag button { background:none; border:none; color:#f44336; font-weight:bold; cursor:pointer; font-size:14px; padding:0 2px; }

/* Save Button */
.save { margin:15px; padding:18px; background:#4caf50; color:#fff; border:none; border-radius:12px; font-size:20px; font-weight:bold; width:calc(100% - 30px); cursor:pointer; }
.save:disabled { background:#ccc; }

/* Empty State */
.empty { text-align:center; color:#999; padding:40px; }

/* Search */
.search-input { width:100%; padding:12px; font-size:16px; border:2px solid #1a237e; border-radius:8px; margin-bottom:10px; }
.search-results { max-height:250px; overflow-y:auto; margin-bottom:15px; }
.search-item { padding:12px; border-bottom:1px solid #eee; cursor:pointer; }
.search-item:hover { background:#e3f2fd; }
.search-item-kod { font-weight:bold; color:#1a237e; }
.search-item-ad { font-size:13px; color:#333; }
.search-item-meta { font-size:11px; color:#888; margin-top:3px; }

/* Barcode Tags */
.barcode-list { margin:10px 0; }
.barcode-tag { display:inline-block; background:#e8eaf6; padding:5px 10px; margin:3px; border-radius:5px; font-size:14px; }
.barcode-tag button { background:none; border:none; color:#f44336; margin-left:5px; cursor:pointer; font-weight:bold; }

/* Not Found */
.not-found-box { background:#ffebee; padding:15px; border-radius:10px; margin-bottom:15px; text-align:center; }
.not-found-box span { color:#c62828; font-weight:bold; }

/* Modal */
.modal { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:100; }
.modal-box { background:#fff; padding:25px; border-radius:15px; width:90%; max-width:350px; }
.modal-title { font-size:20px; font-weight:bold; color:#1a237e; text-align:center; margin-bottom:15px; }
.modal-title.warning { color:#f44336; }
.modal-subtitle { font-size:14px; color:#666; text-align:center; margin-bottom:10px; }
.modal-input { width:100%; padding:15px; font-size:18px; border:2px solid #1a237e; border-radius:10px; margin-bottom:15px; }
.modal-btns { display:flex; gap:10px; }
.modal-btns.vertical { flex-direction:column; }
.modal-btn { flex:1; padding:15px; border:none; border-radius:10px; font-size:16px; cursor:pointer; }
.modal-cancel { background:#ddd; }
.modal-ok { background:#1a237e; color:#fff; }
.modal-warn { background:#ff9800; color:#fff; }

/* Home Screen */
.home { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100vh; padding:20px; }
.home h1 { font-size:32px; color:#1a237e; margin-bottom:30px; }
.depo-row { display:flex; gap:10px; margin-bottom:30px; }
.depo-btn { width:55px; height:55px; border-radius:50%; border:none; font-size:20px; font-weight:bold; cursor:pointer; background:#ddd; color:#666; }
.depo-btn.active { background:#1a237e; color:#fff; }
.start-btn { background:#1a237e; color:#fff; padding:25px 40px; border-radius:15px; border:none; font-size:22px; font-weight:bold; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:10px; }

/* Nav Buttons */
.nav-buttons { display:flex; gap:15px; margin-top:20px; }
.nav-btn { background:#fff; color:#1a237e; border:2px solid #1a237e; padding:12px 20px; border-radius:10px; font-size:14px; font-weight:bold; cursor:pointer; display:flex; align-items:center; gap:8px; }
.nav-btn:hover { background:#e8eaf6; }
.nav-btn span { font-size:18px; }

/* Raf Conflict */
.conflict-info { background:#fff3e0; padding:15px; border-radius:10px; margin-bottom:15px; }
.conflict-detail { margin:8px 0; font-size:14px; }
.raf-badge { display:inline-block; padding:4px 10px; border-radius:5px; font-weight:bold; }
.raf-badge.old { background:#ffcdd2; color:#c62828; }
.raf-badge.new { background:#c8e6c9; color:#2e7d32; }
.conflict-question { text-align:center; font-weight:bold; margin-bottom:10px; color:#333; }

/* History Screen */
.filter-box { margin:15px; display:flex; gap:10px; }
.filter-box input, .filter-box select { flex:1; padding:12px; font-size:14px; border:2px solid #1a237e; border-radius:8px; }
.history-list { margin:0 15px; background:#fff; border-radius:12px; max-height:calc(100vh - 180px); overflow-y:auto; }
.history-item { padding:15px; border-bottom:1px solid #eee; cursor:pointer; }
.history-item:hover { background:#f5f5f5; }
.history-item-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.history-item-raf { font-weight:bold; color:#1a237e; font-size:16px; }
.history-item-date { font-size:12px; color:#888; }
.history-item-stats { display:flex; gap:15px; }
.history-stat { font-size:13px; color:#555; }
.history-stat strong { color:#1a237e; }

/* Detail Modal */
.detail-header { background:#e8eaf6; padding:15px; border-radius:10px; margin-bottom:15px; }
.detail-header p { margin:5px 0; font-size:14px; }
.detail-items { max-height:300px; overflow-y:auto; }
.detail-item { padding:10px; border-bottom:1px solid #eee; display:flex; justify-content:space-between; }
.detail-item-info { flex:1; }
.detail-item-kod { font-weight:bold; font-size:13px; }
.detail-item-ad { font-size:11px; color:#666; }
.detail-item-qty { font-size:18px; font-weight:bold; color:#1a237e; }

/* Custom Keyboard */
.custom-keyboard { 
  background:#e8eaf6; 
  padding:10px; 
  border-radius:10px; 
  margin:10px 0;
}
.kb-row { 
  display:flex; 
  justify-content:center; 
  gap:5px; 
  margin-bottom:5px; 
}
.kb-btn { 
  width:38px; 
  height:45px; 
  border:none; 
  background:#fff; 
  border-radius:6px; 
  font-size:18px; 
  font-weight:bold; 
  color:#1a237e; 
  cursor:pointer; 
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.1s;
}
.kb-btn:active { 
  background:#1a237e; 
  color:#fff; 
  transform: scale(0.95);
}
.kb-back { 
  width:55px; 
  background:#ff9800; 
  color:#fff; 
}
.kb-clear { 
  width:100%; 
  background:#f44336; 
  color:#fff; 
  height:40px;
}

/* TAM EKRAN ARAMA MODALI */
#search-modal.modal {
  display: none;
}
#search-modal.modal[style*="flex"] .search-fullscreen,
#search-modal .search-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}
.search-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

/* ÜST BAR */
.search-top-bar {
  background: #1a237e;
  color: #fff;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.search-title {
  font-size: 20px;
  font-weight: bold;
}
.search-close-btn {
  background: #f44336;
  color: #fff;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
}

/* ARAMA INPUT */
.search-input-full {
  margin: 8px;
  padding: 15px;
  font-size: 24px;
  font-weight: bold;
  border: 3px solid #1a237e;
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
}

/* NUMARA TUŞLARI - BÜYÜK VE ÖN PLANDA */
.num-keyboard {
  display: flex;
  flex-wrap: wrap;
  padding: 5px 8px;
  gap: 5px;
  flex-shrink: 0;
  background: #e3f2fd;
}
.num-btn {
  flex: 1 0 calc(20% - 5px);
  height: 60px;
  border: none;
  background: linear-gradient(180deg, #1a237e 0%, #0d1642 100%);
  border-radius: 10px;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  -webkit-tap-highlight-color: transparent;
}
.num-btn:active {
  background: linear-gradient(180deg, #3949ab 0%, #1a237e 100%);
  transform: scale(0.95);
}

/* HARF TUŞLARI */
.letter-keyboard {
  padding: 5px 8px;
  flex-shrink: 0;
  background: #e8eaf6;
}
.letter-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  justify-content: center;
}
.letter-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: #fff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: bold;
  color: #1a237e;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  -webkit-tap-highlight-color: transparent;
  max-width: 42px;
}
.letter-btn:active {
  background: #1a237e;
  color: #fff;
}
.back-btn {
  background: #ff9800;
  color: #fff;
  max-width: 60px;
  flex: 1.5;
}
.back-btn:active {
  background: #e65100;
}

/* TEMİZLE BUTONU */
.clear-btn-full {
  margin: 5px 8px;
  padding: 12px;
  background: #f44336;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}
.clear-btn-full:active {
  background: #c62828;
}

/* ARAMA SONUÇLARI - ORTADA SCROLL */
.search-results-middle {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  margin: 5px 8px;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
  min-height: 100px;
  max-height: 200px;
}

/* ARAMA SONUÇLARI - ÜSTTE SCROLL */
.search-results-top {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  margin: 5px 8px;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
  min-height: 80px;
}

/* ARAMA SONUÇLARI - KLAVYENİN ÜSTÜNE KADAR */
.search-results-area {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  margin: 5px 8px;
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

/* KLAVYE - ALTTA SABİT */
.keyboard-bottom {
  flex-shrink: 0;
  background: #f0f0f0;
  border-top: 2px solid #ddd;
}
.results-placeholder {
  text-align: center;
  color: #999;
  padding: 30px;
  font-size: 16px;
}
.search-item { 
  padding: 15px; 
  border-bottom: 1px solid #eee; 
  cursor: pointer; 
}
.search-item:active { 
  background: #e3f2fd; 
}
.search-item-kod { 
  font-weight: bold; 
  color: #1a237e; 
  font-size: 16px;
}
.search-item-ad { 
  font-size: 14px; 
  color: #333; 
  margin-top: 3px;
}
.search-item-meta { 
  font-size: 12px; 
  color: #888; 
  margin-top: 5px; 
}
