/* === PhoneReader Pro — Global Styles === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: #f2f2f7;
  color: #1c1c1e;
  font-size: 14px;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #1c1c1e;
  color: #e5e5ea;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: #0a84ff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand h1 {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.sidebar-brand small {
  font-size: 11px;
  color: #636366;
  display: block;
  margin-top: 1px;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-section {
  margin-bottom: 2px;
}
.nav-section-title {
  padding: 16px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #636366;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  margin: 1px 8px;
  color: #aeaeb2;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  border-left: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: #f2f2f7;
}
.nav-item.active {
  background: rgba(10,132,255,0.18);
  color: #0a84ff;
  font-weight: 600;
}
.nav-item-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-user {
  font-size: 12px;
  font-weight: 500;
  color: #aeaeb2;
}
.btn-logout {
  padding: 4px 10px;
  background: rgba(255,255,255,0.06);
  color: #aeaeb2;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* === MAIN CONTENT === */
.main-content {
  margin-left: 220px;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: white;
  padding: 20px 32px;
  border-bottom: 1px solid #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  letter-spacing: -0.3px;
}
.page-header p {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 2px;
  font-weight: 400;
}

.page-body {
  padding: 24px 32px;
  flex: 1;
}

/* === CARDS === */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0.5px 1px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}
.card + .card {
  margin-top: 20px;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #f2f2f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  letter-spacing: -0.1px;
}
.card-body { padding: 20px; }

/* === STAT CARDS === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 0.5px 1px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: #8e8e93;
  text-transform: none;
  letter-spacing: 0;
}
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #1c1c1e;
  margin-top: 4px;
  letter-spacing: -0.5px;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: #aeaeb2;
  margin-top: 2px;
}
.stat-card.accent-purple { border-left: 3px solid #0a84ff; }
.stat-card.accent-green { border-left: 3px solid #30d158; }
.stat-card.accent-blue { border-left: 3px solid #5ac8fa; }
.stat-card.accent-orange { border-left: 3px solid #ff9f0a; }

/* === FORMS === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group {
  margin-bottom: 0;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #3a3a3c;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #1c1c1e;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
}
.form-group .highlight {
  background: #fff8e1 !important;
  border-color: #ff9f0a;
}

/* === BUTTONS === */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  letter-spacing: -0.1px;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: #0a84ff;
  color: white;
}
.btn-primary:hover:not(:disabled) { background: #0070e0; }
.btn-success {
  background: #30d158;
  color: white;
}
.btn-success:hover:not(:disabled) { background: #28b84c; }
.btn-danger {
  background: #ff3b30;
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #e0332a; }
.btn-secondary {
  background: #f2f2f7;
  color: #3a3a3c;
  border: 1px solid #d1d1d6;
}
.btn-secondary:hover { background: #e5e5ea; }
.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn-group {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* === TABLES === */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  color: #8e8e93;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 1px solid #e5e5ea;
  white-space: nowrap;
  cursor: pointer;
}
table th:hover { color: #636366; }
table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f2f2f7;
  color: #3a3a3c;
}
table tr:hover { background: #fafafa; }
table .badge,
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-verified { background: #e8f4fd; color: #0a6dc2; }
.badge-in_stock, .badge-in-stock { background: #d4edda; color: #155724; }
.badge-sold { background: #f0e6ff; color: #6b21a8; }
.badge-draft { background: #f2f2f7; color: #8e8e93; }
.badge-submitted { background: #e8f4fd; color: #0a6dc2; }
.badge-received { background: #d4edda; color: #155724; }
.badge-closed { background: #f2f2f7; color: #8e8e93; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-refunded { background: #fde8e8; color: #c0392b; }

.text-green { color: #30d158; }
.text-red { color: #ff3b30; }
.text-gray { color: #aeaeb2; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* === CONNECTION SECTION (Testing page) === */
.connection-section {
  background: #0a84ff;
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.conn-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: background 0.3s;
}
.status-dot.connected { background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,0.3); }
.status-dot.disconnected { background: rgba(255,255,255,0.4); }
.status-dot.checking { background: #ff9f0a; box-shadow: 0 0 0 3px rgba(255,159,10,0.3); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.conn-info h3 { font-size: 14px; font-weight: 600; color: #fff; }
.conn-info p { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.conn-buttons { display: flex; gap: 8px; }
.conn-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.conn-btn.check { background: rgba(255,255,255,0.2); color: white; }
.conn-btn.check:hover { background: rgba(255,255,255,0.3); }
.conn-btn.read { background: white; color: #0a84ff; }
.conn-btn.read:hover { background: #f2f2f7; }
.conn-btn:hover { transform: none; }

/* === TOAST === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: slideIn 0.25s ease;
  max-width: 360px;
}
.toast.success { background: #30d158; color: white; }
.toast.error { background: #ff3b30; color: white; }
.toast.info { background: #0a84ff; color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === LABEL PREVIEW === */
.label-preview {
  background: white;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000;
  width: 384px;
  min-height: 192px;
}
.lp-title {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1.5px solid #000;
  padding-bottom: 6px;
  margin-bottom: 8px;
}
.lp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
  margin-bottom: 8px;
}
.lp-row { display: flex; gap: 4px; }
.lp-label { font-weight: 700; font-size: 10px; }
.lp-value { font-size: 10px; }
.lp-barcode { text-align: center; margin-top: 6px; }
.lp-imei { font-size: 10px; text-align: center; font-family: monospace; }
.lp-grade {
  font-size: 32px;
  font-weight: 900;
  text-align: center;
  border: 2px solid #000;
  border-radius: 6px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.lp-failed {
  font-size: 10px;
  color: #c00;
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
}
.lp-notes {
  font-size: 9px;
  color: #555;
  text-align: center;
  margin-top: 2px;
}

/* === UPLOAD === */
.upload-zone {
  border: 2px dashed #d1d1d6;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fafafa;
}
.upload-zone:hover { border-color: #0a84ff; background: #f0f5ff; }
.upload-zone.dragging { border-color: #0a84ff; background: #e8f0fe; }
.upload-zone p { font-size: 14px; color: #8e8e93; margin-top: 8px; }
.upload-zone .icon { font-size: 32px; }

/* === POS SPECIFIC === */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100vh - 140px);
}
.pos-items { overflow-y: auto; }
.pos-cart {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0.5px 1px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f2f2f7;
  font-weight: 600;
  font-size: 15px;
  color: #1c1c1e;
}
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-item {
  padding: 10px;
  border-bottom: 1px solid #f2f2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-item-info { font-size: 13px; color: #3a3a3c; }
.cart-item-price { font-weight: 600; font-size: 14px; color: #1c1c1e; }
.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e5ea;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #1c1c1e;
}

/* === SEARCH === */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-bar input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}
.search-bar input:focus { border-color: #0a84ff; box-shadow: 0 0 0 3px rgba(10,132,255,0.12); }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #aeaeb2;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 17px; color: #8e8e93; margin-bottom: 4px; font-weight: 600; }
.empty-state p { font-size: 14px; }

/* === MANIFEST TABLE === */
.manifest-table { margin-top: 16px; }
.manifest-table td.imei { font-family: 'SF Mono', SFMono-Regular, Menlo, monospace; font-size: 13px; }
.manifest-check { width: 18px; height: 18px; cursor: pointer; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
}

/* === DIAGNOSTICS === */
.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.diag-item {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  border: 1px solid #e5e5ea;
}
.diag-item.pass { background: #d4edda; color: #155724; border-color: #a3d9b1; }
.diag-item.fail { background: #fde8e8; color: #991b1b; border-color: #f5c2c2; }
.diag-item.untested { background: #f9f9f9; color: #aeaeb2; }

/* Manual iPhone diagnostic checklist */
.diag-checklist { list-style: none; padding: 0; }
.diag-checklist li {
  padding: 10px 14px;
  border-bottom: 1px solid #f2f2f7;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s;
}
.diag-checklist li:hover { background: #fafafa; }
.diag-status {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
}
.diag-status.untested { background: #f2f2f7; color: #aeaeb2; }
.diag-status.pass { background: #d4edda; color: #155724; }
.diag-status.fail { background: #fde8e8; color: #991b1b; }

/* === MODAL === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f2f2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.1px; }
.modal-close {
  width: 28px; height: 28px;
  border: none; background: #f2f2f7;
  border-radius: 50%; cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  color: #8e8e93;
  transition: background 0.15s;
}
.modal-close:hover { background: #e5e5ea; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #f2f2f7;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Steps indicator */
.steps {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
}
.step {
  flex: 1;
  padding: 10px;
  background: #f2f2f7;
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #8e8e93;
  transition: all 0.15s;
}
.step.active { background: #0a84ff; color: white; }
.step.done { background: #d4edda; color: #155724; }

/* === LOGIN === */
.login-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f2f2f7;
}
.login-header {
  background: #1c1c1e;
  color: white;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-header-icon {
  width: 40px; height: 40px;
  background: #0a84ff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.login-header h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.2px; }
.login-header p { font-size: 13px; opacity: 0.6; margin-top: 2px; }
.login-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.login-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  padding: 36px;
  width: 100%;
  max-width: 380px;
}
.login-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: -0.3px;
}
.login-card .subtitle {
  font-size: 14px;
  color: #8e8e93;
  text-align: center;
  margin-bottom: 28px;
}
.login-card .form-group { margin-bottom: 16px; }
.btn-login {
  width: 100%;
  padding: 12px;
  background: #0a84ff;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
.btn-login:hover { background: #0070e0; }
.error-msg {
  background: #fde8e8;
  color: #ff3b30;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  text-align: center;
}

/* === RECEIVING STEPS === */
.receive-phone-card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid #e5e5ea;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.receive-phone-card.matched { border-color: #a3d9b1; background: #f4fbf6; }
.receive-phone-card.unmatched { border-color: #ffe0a3; background: #fffbf2; }

/* === MISC === */
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }

/* === SELLING CALCULATOR === */
.calc-inputs { margin-bottom: 20px; }
.calc-inputs .card h3 { font-size: 16px; font-weight: 600; color: #1c1c1e; margin-bottom: 16px; letter-spacing: -0.1px; }
.calc-marketplace-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.calc-mp-card {
  background: white; border-radius: 10px; box-shadow: 0 0.5px 1px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
  padding: 20px; border-left: 3px solid #d1d1d6;
}
.calc-mp-card.amazon { border-left-color: #ff9f0a; }
.calc-mp-card.backmarket { border-left-color: #30d158; }
.calc-mp-card.walmart { border-left-color: #0a84ff; }
.calc-mp-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: #1c1c1e; }
.calc-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; color: #3a3a3c; }
.calc-row + .calc-row { border-top: 1px solid #f2f2f7; }
.calc-val { font-weight: 600; }
.calc-val.big { font-weight: 700; font-size: 17px; }
.profit-pos { color: #30d158; }
.profit-neg { color: #ff3b30; }
.calc-settings {
  background: white; border-radius: 10px; box-shadow: 0 0.5px 1px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04); overflow: hidden;
}
.calc-settings-header {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: #3a3a3c; background: #fafafa; user-select: none;
}
.calc-settings-header:hover { background: #f2f2f7; }
.calc-settings-body { display: none; padding: 16px 20px; }
.calc-settings.open .calc-settings-body { display: block; }
.calc-settings-grid { display: grid; grid-template-columns: 140px repeat(3, 1fr); gap: 10px; align-items: center; font-size: 14px; }
.calc-settings-grid .col-header { font-weight: 600; text-align: center; color: #1c1c1e; }
.calc-settings-grid .row-label { font-weight: 500; color: #3a3a3c; }
.calc-settings-grid input {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d1d6; border-radius: 8px;
  font-size: 14px; font-family: inherit; text-align: center; outline: none; background: #fff; transition: border-color 0.15s;
}
.calc-settings-grid input:focus { border-color: #0a84ff; box-shadow: 0 0 0 2px rgba(10,132,255,0.12); }
@media (max-width: 900px) { .calc-marketplace-grid { grid-template-columns: 1fr; } }

/* === VOIDED / CANCELLED / DELETED BADGES === */
.badge-voided { background: #fde8e8; color: #ff3b30; }
.badge-cancelled { background: #fff8e1; color: #a16207; }
.badge-deleted { background: #f2f2f7; color: #8e8e93; }
.badge-returned { background: #fff3e0; color: #c2410c; }
.badge-reversed { background: #fff3e0; color: #c2410c; }
tr.row-voided td { text-decoration: line-through; opacity: 0.55; }
tr.row-cancelled td { opacity: 0.55; }
.btn-warning { background: #ff9f0a; color: white; border: none; cursor: pointer; }
.btn-warning:hover { background: #e08e09; }

/* === SEGMENTED CONTROL === */
.seg-control {
  display: inline-flex;
  background: #e5e5ea;
  border-radius: 8px;
  padding: 2px;
  margin-bottom: 16px;
}
.seg-control button {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-control button.active {
  background: white;
  color: #1c1c1e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* === FILTER BAR === */
.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar .btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: #f2f2f7;
  color: #636366;
  border: none;
  border-radius: 6px;
}
.filter-bar .btn.active {
  background: #1c1c1e;
  color: white;
}
.filter-bar .btn:hover:not(.active) {
  background: #e5e5ea;
}

/* === TAB PANEL helper === */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* === SELECTION / LINK STYLES === */
a { color: #0a84ff; text-decoration: none; }
a:hover { text-decoration: underline; }
table a { text-decoration: none; }
table a:hover { text-decoration: underline; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c7c7cc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aeaeb2; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
