* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; background: #f0f2f5; color: #1a1a2e; }

/* SCREENS */
.screen { display: none; }
.screen.active { display: flex; }

/* LOGIN */
#screen-login { justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.logo { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.sub { color: #666; text-align: center; margin-bottom: 24px; }
.login-box input { width: 100%; padding: 10px 14px; border: 1.5px solid #ddd; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #667eea; }
.login-box button { width: 100%; padding: 12px; background: #667eea; color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #5a6fd8; }
.hint { font-size: 12px; color: #999; text-align: center; margin-top: 12px; }

/* APP LAYOUT */
#screen-app { min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a2e; color: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-logo { padding: 20px 16px; font-size: 16px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); }
nav { flex: 1; padding: 12px 0; }
.nav-item { display: block; padding: 10px 16px; color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 6px; margin: 2px 8px; transition: all 0.15s; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.15); color: #fff; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.btn-logout { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.7); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; width: 100%; }
.btn-logout:hover { border-color: rgba(255,255,255,0.6); color: #fff; }

/* MAIN */
.main-content { flex: 1; overflow: auto; }
.tab { display: none; padding: 28px; }
.tab.active { display: block; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tab-header h1 { font-size: 22px; font-weight: 700; }
.header-actions { display: flex; gap: 8px; }

/* BUTTONS */
.btn-primary { background: #667eea; color: #fff; border: none; padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-primary:hover { background: #5a6fd8; }
.btn-secondary { background: #fff; color: #555; border: 1.5px solid #ddd; padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.btn-secondary:hover { border-color: #667eea; color: #667eea; }
.btn-success { background: #10b981; color: #fff; border: none; padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: #fff; border: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-danger:hover { background: #dc2626; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 15px; }
.btn-icon:hover { background: #f0f2f5; }
.btn-lang { background: #fff; color: #555; border: 1.5px solid #ddd; padding: 7px 18px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.15s; }
.btn-lang:hover { border-color: #667eea; color: #667eea; }
.btn-lang.active { background: #667eea; color: #fff; border-color: #667eea; }

/* PAYMENT TYPE FILTER CARDS — matches stat-chip style */
.pt-filter-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pt-filter-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border: 1.5px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  min-width: 100px;
  gap: 1px;
}

.ptb-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--ptc, #667eea);
  line-height: 1.2;
  white-space: nowrap;
  display: block;
}

.ptb-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
  display: block;
}

.pt-filter-btn:hover {
  border-color: var(--ptc, #667eea);
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.pt-filter-btn.active {
  border-color: var(--ptc, #667eea);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ptc, #667eea) 20%, transparent);
  background: #fafbff;
}

.pt-filter-btn.active .ptb-label { color: var(--ptc, #667eea); font-weight: 600; }

/* FILTERS */
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input, .filters select { padding: 7px 12px; border: 1.5px solid #ddd; border-radius: 7px; font-size: 13px; }
.filters input:focus, .filters select:focus { outline: none; border-color: #667eea; }
.filters input { min-width: 200px; }

/* STATS */
.stats-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-chip {
  background: #fff;
  border: 1.5px solid #e9ecef;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.3px;
  min-width: 90px;
}
.stat-chip strong { font-size: 20px; display: block; color: #667eea; font-weight: 700; line-height: 1.2; margin-bottom: 2px; }
.stat-chip.locked strong { color: #f59e0b; }
.stat-chip.success strong { font-size: 16px; color: #10b981; }

/* TABLE */
.table-wrap { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f8f9fc; }
th { padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; cursor: pointer; user-select: none; }
th:hover { color: #667eea; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f2f5; font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }
tr.locked-row td { background: #fffbeb; color: #78716c; }
tr.locked-row:hover td { background: #fef3c7; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-locked { background: #fef3c7; color: #92400e; }
.badge-pt { background: #ede9fe; color: #5b21b6; }
.badge-submitted     { background: #d1fae5; color: #065f46; }
.badge-not-submitted { background: #fef3c7; color: #92400e; }
.badge-ota           { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-modified      { background: #dbeafe; color: #1e40af; }

.lock-icon { font-size: 14px; }
.inv-no { font-weight: 600; font-family: monospace; font-size: 13px; }
.inv-no-changed { color: #f59e0b; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 60px; color: #9ca3af; }
.empty-state a { color: #667eea; text-decoration: none; }

/* BULK BAR */
.bulk-bar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: #fff; padding: 12px 24px; border-radius: 30px; display: flex; gap: 16px; align-items: center; box-shadow: 0 4px 20px rgba(0,0,0,0.3); z-index: 100; }

/* IMPORT */
.steps { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; }
.step { padding: 8px 20px; border-radius: 20px; background: #e5e7eb; color: #6b7280; font-size: 13px; font-weight: 500; }
.step.active { background: #667eea; color: #fff; }
.step-arrow { color: #9ca3af; }

.upload-zone { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 60px 40px; text-align: center; background: #fff; transition: all 0.2s; }
.upload-zone:hover, .upload-zone.drag-over { border-color: #667eea; background: #f5f7ff; }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-zone p { color: #6b7280; margin-bottom: 12px; }
.upload-zone label { cursor: pointer; }

.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 20px; }
.mapping-row { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 10px; }
.mapping-row label { font-size: 12px; color: #6b7280; min-width: 100px; }
.mapping-row select { flex: 1; padding: 6px 10px; border: 1.5px solid #ddd; border-radius: 6px; font-size: 13px; }
.mapping-row .field-name { font-weight: 600; font-size: 13px; min-width: 120px; }

.step-actions { display: flex; gap: 10px; justify-content: flex-end; }

.error-box { background: #fef2f2; border: 1px solid #fca5a5; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; color: #dc2626; font-size: 13px; }

/* MODALS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 200; }
.modal-overlay.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; padding: 28px; width: 560px; max-width: 95vw; max-height: 85vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal h3 { font-size: 18px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; color: #6b7280; font-weight: 500; }
.form-group input, .form-group select { padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 7px; font-size: 13px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #667eea; }

/* PUSH MODAL */
.push-summary { background: #f8f9fc; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.push-summary .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #e5e7eb; }
.push-summary .row:last-child { border-bottom: none; }
.progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
#progress-fill { height: 100%; background: #667eea; border-radius: 4px; transition: width 0.3s; }
.push-log { font-size: 12px; font-family: monospace; background: #1a1a2e; color: #a3e635; border-radius: 8px; padding: 12px; max-height: 200px; overflow-y: auto; }
.push-log div { padding: 2px 0; }
.push-log .ok { color: #86efac; }
.push-log .err { color: #fca5a5; }

/* SETTINGS */
.settings-section { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; padding: 20px; margin-bottom: 20px; }
.settings-section h3 { margin-bottom: 14px; font-size: 15px; }
.settings-section p { margin-bottom: 8px; color: #555; }
.pt-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.pt-row:last-of-type { border-bottom: none; }
.pt-code { font-family: monospace; font-weight: 700; color: #667eea; min-width: 60px; }
.add-payment-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.add-payment-row input { padding: 8px 12px; border: 1.5px solid #ddd; border-radius: 7px; font-size: 13px; flex: 1; min-width: 120px; }

/* UTILS */
.hidden { display: none !important; }
.error-msg { color: #ef4444; font-size: 13px; margin-bottom: 10px; }
.amount { text-align: right; font-family: monospace; }
