:root {
  --bg: #f4f6f3;
  --bg-2: #eef2ec;
  --surface: #ffffff;
  --surface-strong: #f1f5f0;
  --ink: #14201d;
  --muted: #647069;
  --line: #e2e8e2;
  --line-soft: #edf1ec;
  --brand: #0b4b43;
  --brand-2: #0f5d52;
  --brand-dark: #073229;
  --gold: #cda24f;
  --gold-soft: #e7cf94;
  --rose: #a63a47;
  --blue: #2f6f94;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 2px 8px rgba(16, 32, 28, 0.06);
  --shadow: 0 18px 44px rgba(16, 32, 28, 0.12);
  --shadow-lg: 0 28px 70px rgba(7, 50, 41, 0.22);
  --grad-brand: linear-gradient(135deg, #0f5d52 0%, #0b4b43 55%, #073229 100%);
  --grad-gold: linear-gradient(135deg, #e7cf94, #cda24f);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(11, 75, 67, 0.12), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(205, 162, 79, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(205, 162, 79, 0.32);
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.app {
  min-height: 100vh;
}

/* ---------- Login ---------- */
.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 70%;
  background: var(--grad-brand);
  filter: blur(70px);
  opacity: 0.16;
  pointer-events: none;
}

.login-panel {
  position: relative;
  width: min(100%, 400px);
  padding: 36px 30px 32px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: pop 0.6s var(--ease) both;
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 22px 22px 0 0;
  background: var(--grad-gold);
}

.login-logo {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  padding: 14px;
  border-radius: 24px;
  background: var(--grad-brand);
  box-shadow: 0 14px 30px rgba(7, 50, 41, 0.28);
}

.login-panel h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-panel h1::after {
  content: "Acesse sua conta";
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
}

.login-panel .form-stack {
  margin-top: 22px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(226, 232, 226, 0.7);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(160%) blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 14px;
  background: var(--grad-brand);
  box-shadow: var(--shadow-sm);
}

.brand strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

/* ---------- Workspace ---------- */
.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
  animation: rise 0.5s var(--ease) both;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

/* ---------- Admin shell + menu ---------- */
.admin-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  animation: rise 0.5s var(--ease) both;
}

.admin-nav {
  position: sticky;
  top: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-nav-title {
  margin: 4px 6px 12px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav-list {
  display: grid;
  gap: 6px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s var(--ease),
    box-shadow 0.25s var(--ease);
}

.admin-nav-item:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.admin-nav-item.is-active {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 12px 24px rgba(11, 75, 67, 0.26);
}

.admin-nav-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--brand);
  background: var(--surface-strong);
  transition: background 0.18s, color 0.18s;
}

.admin-nav-item.is-active .admin-nav-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.admin-nav-icon svg {
  width: 18px;
  height: 18px;
}

.admin-nav-label {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.admin-nav-label strong {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.admin-nav-label small {
  margin-top: 1px;
  font-size: 0.72rem;
  opacity: 0.72;
  overflow-wrap: anywhere;
}

.admin-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-head h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.3rem, 3vw, 1.62rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-head-count {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(15, 93, 82, 0.09);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-stack {
  display: grid;
  gap: 16px;
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 16px;
  align-items: start;
}

/* ---------- Quick actions ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s;
}

.quick-action:hover {
  transform: translateY(-3px);
  border-color: rgba(205, 162, 79, 0.5);
  box-shadow: var(--shadow);
}

.quick-action .admin-nav-icon {
  width: 44px;
  height: 44px;
}

.quick-action .admin-nav-icon svg {
  width: 21px;
  height: 21px;
}

.quick-action span {
  display: grid;
  min-width: 0;
}

.quick-action strong {
  color: var(--brand-dark);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.quick-action small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------- Import history ---------- */
.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-strong);
}

.history-item strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.history-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.history-badge {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--grad-gold);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.metric-card,
.panel,
.seller-hero,
.client-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  position: relative;
  min-height: 98px;
  padding: 20px;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--grad-gold);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--brand-dark);
  font-size: clamp(1.4rem, 4vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.workgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.section-head h2 {
  position: relative;
  margin: 0;
  padding-left: 13px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head h2::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 17px;
  border-radius: 4px;
  background: var(--grad-brand);
  transform: translateY(-50%);
}

/* ---------- Forms ---------- */
.form-stack,
.form-grid {
  display: grid;
  gap: 15px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span,
dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdfb;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input::placeholder {
  color: #9aa6a0;
}

input:hover,
select:hover {
  border-color: #c5d0c8;
}

input:focus,
select:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 93, 82, 0.13);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkbox-field input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  accent-color: var(--brand);
  cursor: pointer;
}

.checkbox-field span {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

input[type="file"] {
  padding: 9px 12px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--brand);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 18px;
  color: var(--ink);
  background: var(--surface-strong);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
    filter 0.2s, background 0.2s;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button-primary {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 10px 24px rgba(11, 75, 67, 0.28);
}

.button-primary:hover {
  box-shadow: 0 14px 30px rgba(11, 75, 67, 0.36);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.button-ghost:hover {
  border-color: #c5d0c8;
  background: #fff;
}

.button-danger {
  color: #fff;
  background: linear-gradient(135deg, #b8434f, #a63a47);
  box-shadow: 0 10px 22px rgba(166, 58, 71, 0.26);
}

.button-compact {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 0.85rem;
}

/* ---------- Notices ---------- */
.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  background: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: rise 0.35s var(--ease) both;
}

.notice::before {
  font-size: 1.05rem;
}

.notice-success {
  border-color: rgba(11, 75, 67, 0.26);
  color: var(--brand-dark);
  background: linear-gradient(180deg, rgba(11, 75, 67, 0.09), rgba(11, 75, 67, 0.04));
}

.notice-success::before {
  content: "✓";
}

.notice-error {
  border-color: rgba(166, 58, 71, 0.28);
  color: #7f2430;
  background: linear-gradient(180deg, rgba(166, 58, 71, 0.09), rgba(166, 58, 71, 0.04));
}

.notice-error::before {
  content: "!";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--rose);
  font-size: 0.78rem;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead {
  background: var(--surface-strong);
}

th,
td {
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

tbody tr {
  transition: background 0.18s;
}

tbody tr:hover {
  background: rgba(15, 93, 82, 0.035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ---------- Seller hero ---------- */
.seller-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border: 0;
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.seller-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(205, 162, 79, 0.32), transparent 65%);
  pointer-events: none;
}

.seller-hero h1 {
  position: relative;
  margin: 0;
  font-size: clamp(1.4rem, 5vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.seller-hero span {
  position: relative;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
}

.seller-total {
  position: relative;
  display: grid;
  min-width: 112px;
  min-height: 88px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.seller-total strong {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.seller-total span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Filters ---------- */
.clients-panel {
  margin-top: 16px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(126px, 1fr));
  gap: 13px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--surface-strong);
}

.filter-search {
  grid-column: span 2;
}

.result-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(15, 93, 82, 0.09);
  font-size: 0.84rem;
  font-weight: 700;
}

/* ---------- Client cards ---------- */
.client-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.client-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease),
    border-color 0.28s;
  animation: pop 0.4s var(--ease) both;
}

.client-card:hover {
  transform: translateY(-4px);
  border-color: rgba(205, 162, 79, 0.5);
  box-shadow: var(--shadow);
}

.client-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.client-title h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.client-code {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.state-badge {
  min-width: 44px;
  border-radius: 9px;
  padding: 6px 10px;
  color: var(--brand-dark);
  background: var(--grad-gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 4px 10px rgba(205, 162, 79, 0.3);
}

.client-fields {
  display: grid;
  gap: 11px;
  margin: 0;
}

.client-fields div {
  min-width: 0;
}

.client-fields dt {
  font-size: 0.67rem;
}

.client-fields dd {
  margin: 3px 0 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.client-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}

.client-actions {
  padding-top: 14px;
}

.client-actions .button {
  flex: 1;
  min-width: 110px;
}

.client-actions .button[href^="https://wa.me"] {
  color: #fff;
  background: linear-gradient(135deg, #2bb673, #1f9d62);
  box-shadow: 0 8px 18px rgba(31, 157, 98, 0.26);
}

.client-actions .button[href^="tel:"] {
  border-color: var(--line);
  background: #fff;
}

/* ---------- Empty ---------- */
.empty-state {
  margin: 0;
  border: 1.5px dashed #c8d2cb;
  border-radius: 14px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  text-align: center;
}

/* ---------- Install banner ---------- */
.install-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(205, 162, 79, 0.4);
  border-radius: var(--radius);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--shadow);
  animation: rise 0.45s var(--ease) both;
}

.install-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.install-icon img {
  width: 30px;
  height: 30px;
}

.install-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.install-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.install-copy span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.84rem;
}

.install-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.install-banner .button-primary {
  color: var(--brand-dark);
  background: var(--grad-gold);
  box-shadow: 0 10px 22px rgba(205, 162, 79, 0.32);
}

.install-banner .button-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.install-hint {
  position: relative;
  flex: 1 1 100%;
  margin: 6px 0 0;
  padding: 11px 40px 11px 14px;
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
}

.install-hint strong {
  color: var(--gold-soft);
}

.install-close {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

/* ---------- Seller mobile focus ---------- */
.seller-workspace .filters {
  position: sticky;
  top: 78px;
  z-index: 5;
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .admin-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 940px) {
  .workgrid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-search {
    grid-column: span 2;
  }
}

@media (max-width: 880px) {
  .admin-shell {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-top: 16px;
  }

  .admin-nav {
    position: sticky;
    top: 0;
    z-index: 15;
    padding: 8px;
  }

  .admin-nav-title {
    display: none;
  }

  .admin-nav-list {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .admin-nav-list::-webkit-scrollbar {
    display: none;
  }

  .admin-nav-item {
    gap: 9px;
    white-space: nowrap;
  }

  .admin-nav-label small {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
  }

  .brand-icon {
    width: 40px;
    height: 40px;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .login-page {
    padding: 16px;
  }

  .login-panel {
    padding: 28px 20px 24px;
  }

  .panel,
  .seller-hero,
  .client-card {
    padding: 16px;
  }

  .form-grid,
  .filters {
    grid-template-columns: 1fr;
  }

  .span-2,
  .filter-search {
    grid-column: auto;
  }

  .seller-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .seller-total {
    width: 100%;
  }

  .client-list {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .row-actions .button {
    width: auto;
  }

  .install-banner {
    flex-wrap: wrap;
  }

  .install-actions {
    width: 100%;
  }

  .install-actions .button {
    flex: 1;
  }

  .seller-workspace .filters {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   MODO VENDEDOR — letras grandes, menos opcoes, acoes obvias
   Escopado em body[data-view="seller"]: nao afeta o admin.
   ============================================================ */
body[data-view="seller"] {
  font-size: 17px;
}

/* Faixa de saudacao compacta no topo */
.seller-greeting {
  padding: 18px 22px;
}

.seller-greeting h1 {
  font-size: clamp(1.3rem, 5vw, 1.7rem);
}

.seller-greeting .seller-total {
  min-width: 92px;
  min-height: 72px;
}

/* Filtros: busca grande + cidade visiveis; resto recolhido */
body[data-view="seller"] .filters {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
}

body[data-view="seller"] .filter-search {
  grid-column: 1 / -1;
}

body[data-view="seller"] .filters > label > span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

body[data-view="seller"] .filters input,
body[data-view="seller"] .filters select {
  min-height: 54px;
  border-radius: 12px;
  font-size: 1.08rem;
}

/* Bloco "Mais filtros" (details nativo) */
.more-filters {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.more-filters > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  color: var(--brand-dark);
  font-size: 1rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.more-filters > summary::-webkit-details-marker {
  display: none;
}

.more-filters > summary::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
}

.more-filters[open] > summary::after {
  content: "\2212";
}

.more-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}

.more-filters-grid [data-clear-filters] {
  grid-column: 1 / -1;
  min-height: 50px;
}

/* Cards maiores e mais legiveis */
body[data-view="seller"] .client-card {
  gap: 16px;
  padding: 20px;
}

body[data-view="seller"] .client-title h3 {
  font-size: 1.4rem;
  line-height: 1.2;
}

body[data-view="seller"] .client-fields {
  gap: 13px;
}

body[data-view="seller"] .client-fields dt {
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
}

body[data-view="seller"] .client-fields dd {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
}

body[data-view="seller"] .state-badge {
  min-width: 50px;
  padding: 8px 12px;
  font-size: 0.95rem;
}

/* Botoes grandes de acao (Ligar / WhatsApp) */
body[data-view="seller"] .client-actions {
  gap: 12px;
}

body[data-view="seller"] .client-actions .button {
  flex: 1;
  min-height: 56px;
  border-radius: 13px;
  font-size: 1.1rem;
}

/* "Ver mais" dentro do card */
.client-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 2px;
  color: var(--brand);
  font-size: 1rem;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.client-more > summary::-webkit-details-marker {
  display: none;
}

.client-more > summary::after {
  content: "+";
  font-size: 1.3rem;
  line-height: 1;
}

.client-more[open] > summary::after {
  content: "\2212";
}

.client-more .client-fields {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

/* =====================================================================
   REDESIGN MOBILE DA TELA DO VENDEDOR (app-native)
   ===================================================================== */

/* Safe-area (notch / barra de gestos do iPhone) -- viewport-fit=cover */
.topbar {
  min-height: calc(70px + env(safe-area-inset-top));
  padding-top: calc(12px + env(safe-area-inset-top));
}

.seller-main {
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

/* Saudacao compacta (rola pra fora) */
.seller-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 2px 0;
}

.seller-greet-hi {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.seller-greet h1 {
  margin: 2px 0 0;
  font-size: clamp(1.4rem, 6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
}

.seller-count {
  flex: 0 0 auto;
  text-align: right;
}

.seller-count strong {
  display: block;
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.seller-count span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Busca fixa (sticky) abaixo da topbar */
.seller-search {
  position: sticky;
  top: calc(70px + env(safe-area-inset-top));
  z-index: 15;
  margin: 10px 0 12px;
  padding: 8px 0 10px;
  background: var(--bg);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-ico {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.search-row input {
  flex: 1;
  min-width: 0;
  padding: 15px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.08rem;
  font-family: inherit;
}

.seller-search .more-filters {
  margin-top: 10px;
}

/* Filtro de cidade sempre visivel, abaixo da busca */
.city-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 0 8px 0 14px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.city-ico {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--gold);
}

.city-select select {
  flex: 1;
  min-width: 0;
  padding: 14px 6px 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
}

/* Card "lista de contatos" */
body[data-view="seller"] .client-list {
  grid-template-columns: 1fr;
  gap: 10px;
}

.contact-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: pop 0.32s var(--ease) both;
}

.contact-card:active {
  transform: scale(0.99);
  border-color: var(--gold-soft);
}

.contact-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
}

.contact-main {
  min-width: 0;
}

.contact-main h3 {
  margin: 0;
  overflow: hidden;
  font-size: 1.06rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-main p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-quick {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.qbtn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
}

.qbtn svg {
  width: 20px;
  height: 20px;
}

.qbtn-wa {
  border-color: transparent;
  background: linear-gradient(135deg, #2bb673, #1f9d62);
  color: #fff;
}

.contact-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
}

.load-more {
  width: 100%;
  margin-top: 12px;
  min-height: 52px;
  font-size: 1.02rem;
}

/* Bottom-sheet de detalhes */
.sheet[hidden] {
  display: none;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 32, 28, 0.5);
  animation: sheet-fade 0.2s ease;
}

.sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 6px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.28s var(--ease);
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes sheet-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 8px auto 6px;
  border-radius: 3px;
  background: var(--line);
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.sheet-head h3 {
  margin: 4px 0 0;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sheet-x {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.sheet-fields {
  margin-top: 16px;
  gap: 14px;
}

.sheet-fields dt {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
}

.sheet-fields dd {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 600;
}

.sheet-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.sheet-actions .button {
  flex: 1;
  min-height: 56px;
  border-radius: 14px;
  font-size: 1.1rem;
}

.button-wa {
  border-color: transparent;
  background: linear-gradient(135deg, #2bb673, #1f9d62);
  color: #fff;
}

.sheet-nophone {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
}

body.sheet-open {
  overflow: hidden;
}

@media (max-width: 360px) {
  .contact-chevron {
    display: none;
  }
}
