:root {
  --orange: #F5821F;
  --orange-dark: #D96A0D;
  --orange-light: #FFE8D1;
  --green: #8BC34A;
  --text: #2B2118;
  --text-light: #7A6E62;
  --bg: #FAF6F1;
  --white: #FFFFFF;
  --danger: #D64545;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(180, 90, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 40px;
}

.topbar {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--orange);
}

.topbar-text h1 {
  margin: 0;
  color: var(--white);
  font-size: 1.3rem;
  letter-spacing: 0.3px;
}

.topbar-text span {
  color: var(--orange-light);
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 80px;
  z-index: 9;
}

.tab-btn {
  flex: 1;
  padding: 14px 8px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn.active {
  color: var(--orange-dark);
  border-bottom-color: var(--orange);
}

.badge {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  padding: 13px 14px;
  border: 1.5px solid #E5DACB;
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  color: var(--text);
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='8'><path d='M0 0l7 8 7-8z' fill='%23D96A0D'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 31, 0.15);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-danger {
  border: none;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245, 130, 31, 0.35);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--white);
  color: var(--orange-dark);
  border: 1.5px solid var(--orange);
}

.btn-secondary.small {
  flex: none;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.hidden { display: none !important; }

.registros-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

#searchInput {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid #E5DACB;
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--white);
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-light);
}

.empty-state p {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 6px;
}

.clientes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cliente-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--orange);
}

.cliente-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cliente-nome {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 2px 0;
}

.cliente-negocio {
  color: var(--orange-dark);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

.cliente-ramo-pill {
  display: inline-block;
  background: var(--orange-light);
  color: var(--orange-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.cliente-info {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 8px 0 0 0;
}

.cliente-info strong { color: var(--text); }

.cliente-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.icon-btn {
  border: none;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.icon-btn.edit { color: var(--orange-dark); }
.icon-btn.delete { color: var(--danger); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--white);
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 100;
  animation: fadeInUp 0.2s ease;
}

.toast.success { background: var(--green); }
.toast.danger { background: var(--danger); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}

.modal-box p {
  margin: 0 0 18px 0;
  font-weight: 600;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 10px;
}
