:root {
  --purple: #6b22d8;
  --purple-dark: #2f0b55;
  --gold: #d79a22;
  --bg: #fbf6ff;
  --ink: #241331;
  --muted: #6d5b79;
  --line: rgba(91,40,138,.13);
  --shadow: 0 24px 70px rgba(64,23,95,.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: linear-gradient(135deg, #fff9fd, #f2e9ff); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: .8rem;
  padding: 2rem;
  border-radius: 32px;
  background: white;
  box-shadow: var(--shadow);
}
.login-card img { width: 118px; height: 118px; border-radius: 50%; margin: auto; box-shadow: 0 0 0 5px #fff3d3; }
.login-card h1 { text-align: center; margin: 0; color: var(--purple-dark); font-size: 2.3rem; }
.login-card p { text-align: center; margin: 0; color: var(--gold); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
label { display: grid; gap: .35rem; font-weight: 850; color: var(--purple-dark); }
input, select, textarea { border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; background: white; outline: none; }
button, .export, .login-card a { border: 0; border-radius: 999px; padding: .9rem 1rem; font-weight: 950; text-align: center; cursor: pointer; }
button, .export { color: white; background: linear-gradient(135deg, var(--purple), #ff58bf); }
.login-card a { color: var(--purple); background: #f4edff; }
#loginMsg { color: #c52d4b; text-align: center; min-height: 1rem; }
.panel { min-height: 100vh; display: grid; grid-template-columns: 270px 1fr; }
aside {
  background: white;
  border-right: 1px solid var(--line);
  padding: 1.2rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
aside img { width: 90px; height: 90px; border-radius: 50%; }
aside h2 { margin: 1rem 0 .2rem; color: var(--purple-dark); }
aside p { color: var(--muted); }
aside a, aside button { display: block; width: 100%; margin-top: .7rem; background: #f4edff; color: var(--purple-dark); }
.content { padding: clamp(1rem,3vw,2rem); }
header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.tag { margin: 0; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-weight: 950; }
h1 { margin: 0; color: var(--purple-dark); font-size: clamp(2rem,5vw,3.7rem); letter-spacing: -.055em; }
.tools { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.tools input { min-width: 270px; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: .9rem; margin-bottom: .9rem; }
.stats article, .chart-card, .client, .detail {
  background: white;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}
.stats article { padding: 1rem; }
.stats span { color: var(--muted); }
.stats strong { display: block; color: var(--purple); font-size: 2.2rem; margin-top: .25rem; }
.chart-card { padding: 1rem; margin-bottom: 1rem; }
.bar { display: grid; grid-template-columns: 145px 1fr 32px; gap: .6rem; align-items: center; margin: .6rem 0; color: var(--muted); }
.bar div { height: 12px; background: #f0e6ff; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), #ff58bf); border-radius: inherit; }
.list-title { display: flex; justify-content: space-between; color: var(--muted); }
.cards { display: grid; gap: .8rem; }
.client { padding: .95rem; display: grid; grid-template-columns: 88px 1fr auto; gap: .9rem; align-items: center; }
.client img { width: 88px; height: 88px; object-fit: cover; border-radius: 22px; background: #f4edff; }
.placeholder { width: 88px; height: 88px; border-radius: 22px; display: grid; place-items: center; background: #f4edff; font-size: 2rem; }
.client h3 { margin: 0 0 .25rem; color: var(--purple-dark); }
.client p { margin: 0; color: var(--muted); }
.state { display: inline-flex; padding: .35rem .65rem; border-radius: 999px; background: #fff3d3; color: #805400; font-weight: 950; font-size: .82rem; margin-bottom: .35rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.actions a, .actions button { padding: .7rem .85rem; border-radius: 999px; background: #f4edff; color: var(--purple-dark); border: 0; font-weight: 950; }
.actions a:first-child { background: #25d366; color: white; }
dialog { border: 0; padding: 0; background: transparent; width: min(860px, calc(100% - 1rem)); }
dialog::backdrop { background: rgba(36,19,49,.45); backdrop-filter: blur(6px); }
.detail { padding: 1.2rem; }
.detail-photo { width: 100%; max-height: 360px; object-fit: contain; border-radius: 22px; background: #f4edff; margin-bottom: 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .7rem; }
.detail-grid div { padding: .75rem; background: #fbf7ff; border-radius: 16px; }
.detail-grid span { display: block; color: var(--muted); font-size: .84rem; }
.detail-grid strong { white-space: pre-wrap; }
.detail-actions { display: grid; gap: .7rem; margin-top: 1rem; }
.empty { padding: 1rem; background: white; border-radius: 22px; color: var(--muted); }
@media (max-width: 920px) {
  .panel { grid-template-columns: 1fr; }
  aside { position: relative; height: auto; }
  header { flex-direction: column; align-items: stretch; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .client { grid-template-columns: 70px 1fr; }
  .actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 560px) {
  .stats, .detail-grid { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr; }
}
