:root {
  --bg: #080a0f;
  --bg-soft: #11151f;
  --panel: #151925;
  --panel-light: #1c2230;
  --gold: #d8ad55;
  --gold-soft: #f2d892;
  --text: #f8f3e8;
  --muted: #b9ad9a;
  --line: rgba(216, 173, 85, 0.25);
  --danger: #e86f6f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top right, rgba(216, 173, 85, 0.12), transparent 32rem),
    linear-gradient(135deg, #050608 0%, var(--bg) 52%, #12151d 100%);
  color: var(--text);
  display: grid;
  font-family: "Inter", Arial, sans-serif;
  grid-template-columns: 280px 1fr;
  line-height: 1.6;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.section-hidden {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.login-screen {
  align-items: center;
  display: flex;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}

.login-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  max-width: 440px;
  padding: 2rem;
  width: 100%;
}

.login-card img {
  margin: 0 auto 0.75rem;
  width: 220px;
}

.login-card label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 0.45rem;
}

.login-message {
  color: var(--muted);
}

.login-message.error {
  color: var(--danger);
}

.login-back {
  margin-top: -0.25rem;
  width: 100%;
}

.sidebar {
  background: rgba(8, 10, 15, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 100vh;
  padding: 1.5rem;
  position: sticky;
  top: 0;
}

.admin-brand img {
  margin-bottom: 2rem;
  width: 190px;
}

.admin-nav {
  display: grid;
  gap: 0.7rem;
}

.admin-nav a,
.admin-nav button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0.9rem 1rem;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-nav a:hover,
.admin-nav button:hover {
  background: rgba(216, 173, 85, 0.1);
  border-color: var(--line);
  color: var(--gold-soft);
}

.admin-nav a.active {
  background: linear-gradient(135deg, rgba(216, 173, 85, 0.22), rgba(242, 216, 146, 0.08));
  border-color: rgba(242, 216, 146, 0.5);
  color: var(--gold-soft);
}

.admin-main {
  margin: 0 auto;
  max-width: 1240px;
  padding: 2rem;
  width: 100%;
}

.mobile-menu-button,
.mobile-menu-overlay {
  display: none;
}

.admin-hero {
  align-items: start;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, auto);
  margin-bottom: 2rem;
}

.admin-hero-text {
  max-width: 640px;
}

.eyebrow {
  color: var(--gold-soft);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 4.1rem);
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  white-space: nowrap;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
}

.admin-hero p:not(.eyebrow),
.admin-card label,
.empty-message {
  color: var(--muted);
}

.summary-cards {
  align-items: stretch;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.summary-cards article {
  background:
    linear-gradient(155deg, rgba(216, 173, 85, 0.14), rgba(255, 255, 255, 0.03) 42%, rgba(8, 10, 15, 0.72)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(242, 216, 146, 0.28);
  border-radius: 20px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 126px;
  min-width: 130px;
  padding: 1.25rem;
  position: relative;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.summary-cards article::before {
  background: linear-gradient(90deg, transparent, rgba(242, 216, 146, 0.65), transparent);
  content: "";
  height: 1px;
  left: 16px;
  position: absolute;
  right: 16px;
  top: 12px;
}

.summary-cards article:hover {
  border-color: rgba(242, 216, 146, 0.58);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.34);
  transform: translateY(-4px);
}

.summary-cards span,
.summary-cards strong {
  display: block;
}

.summary-cards span {
  color: #f5dfad;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
}

.summary-cards strong {
  color: #d7c7a8;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
  margin-top: 0.55rem;
}

.admin-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-card,
.records,
.dashboard-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card-heading {
  margin-bottom: 1.4rem;
}

.admin-card {
  display: grid;
  gap: 1rem;
}

.admin-card label {
  display: grid;
  font-weight: 700;
  gap: 0.45rem;
}

.security-form {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.security-form label {
  color: var(--muted);
  display: grid;
  font-weight: 700;
  gap: 0.45rem;
}

.form-message {
  color: var(--muted);
}

.form-message.success {
  color: var(--gold-soft);
}

.form-message.error {
  color: var(--danger);
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

input,
select,
textarea {
  background: rgba(8, 10, 15, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: var(--text);
  outline: none;
  padding: 0.9rem 1rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 173, 85, 0.12);
}

.button {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.2rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  color: #161006;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.button.danger {
  color: var(--danger);
}

.records {
  margin-bottom: 1.5rem;
}

.dashboard-panel {
  margin-bottom: 1.5rem;
}

.dashboard-list {
  display: grid;
  gap: 0.85rem;
}

.dashboard-item {
  align-items: center;
  background: rgba(8, 10, 15, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto;
  padding: 1rem;
}

.dashboard-item strong,
.dashboard-item span {
  display: block;
}

.dashboard-item strong {
  color: var(--text);
}

.dashboard-item span,
.dashboard-item time {
  color: var(--muted);
}

.dashboard-date {
  color: var(--gold-soft);
  font-weight: 800;
  text-align: right;
}

.records-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.records-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--gold-soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

.whatsapp-link {
  color: var(--gold-soft);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.whatsapp-link:hover {
  color: var(--gold);
}

.table-action {
  background: rgba(232, 111, 111, 0.1);
  border: 1px solid rgba(232, 111, 111, 0.35);
  border-radius: 999px;
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
  padding: 0.45rem 0.75rem;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-soft);
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
}

.status-pill.status-agendado {
  background: rgba(255, 201, 107, 0.12);
  border-color: rgba(255, 201, 107, 0.48);
  color: #ffd488;
}

.status-pill.status-confirmado {
  background: rgba(86, 209, 133, 0.14);
  border-color: rgba(86, 209, 133, 0.45);
  color: #98e7b6;
}

.status-pill.status-realizado {
  background: rgba(96, 170, 255, 0.14);
  border-color: rgba(96, 170, 255, 0.45);
  color: #a8ceff;
}

.status-pill.status-cancelado {
  background: rgba(232, 111, 111, 0.14);
  border-color: rgba(232, 111, 111, 0.45);
  color: #ffb0b0;
}

.dashboard-item.status-confirmado {
  border-left: 3px solid rgba(86, 209, 133, 0.8);
}

.dashboard-item.status-agendado {
  border-left: 3px solid rgba(255, 201, 107, 0.8);
}

.dashboard-item.status-realizado {
  border-left: 3px solid rgba(96, 170, 255, 0.8);
}

.dashboard-item.status-cancelado {
  border-left: 3px solid rgba(232, 111, 111, 0.8);
}

.empty-message {
  padding: 1.25rem;
  text-align: center;
}

.modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1.25rem;
  position: fixed;
  z-index: 1000;
}

.modal-backdrop {
  background: rgba(5, 6, 8, 0.78);
  backdrop-filter: blur(10px);
  inset: 0;
  position: absolute;
}

.modal-panel {
  max-height: min(92vh, 860px);
  max-width: 720px;
  overflow-y: auto;
  position: relative;
  width: min(100%, 720px);
  z-index: 1;
}

.modal-panel .admin-card {
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.modal-close {
  align-items: center;
  background: rgba(8, 10, 15, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-soft);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.5rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 42px;
  z-index: 2;
}

@media (max-width: 1020px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-radius: 0 28px 28px 0;
    box-shadow: 24px 0 70px rgba(0, 0, 0, 0.36);
    height: 100vh;
    left: 0;
    max-width: 320px;
    min-height: 100vh;
    overflow-y: auto;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    width: min(82vw, 320px);
    z-index: 1200;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-menu-button {
    align-items: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    border: 0;
    border-radius: 999px;
    color: #161006;
    cursor: pointer;
    display: inline-flex;
    font-weight: 900;
    gap: 0.45rem;
    margin-bottom: 1.25rem;
    min-height: 46px;
    padding: 0 1rem;
    position: sticky;
    top: 1rem;
    z-index: 900;
  }

  .mobile-menu-button span {
    display: block;
  }

  .mobile-menu-button .menu-icon {
    display: grid;
    gap: 3px;
  }

  .mobile-menu-button .menu-icon span {
    background: #161006;
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 14px;
  }

  .mobile-menu-overlay {
    background: rgba(5, 6, 8, 0.62);
    backdrop-filter: blur(8px);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.24s ease;
    z-index: 1100;
  }

  .mobile-menu-overlay.mobile-open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-brand img {
    margin-bottom: 1rem;
    width: 160px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .admin-hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .admin-main {
    padding: 1rem;
  }

  .sidebar {
    padding: 1rem;
  }

  .login-card,
  .admin-card,
  .records,
  .dashboard-panel {
    border-radius: 22px;
    padding: 1.15rem;
  }

  .admin-hero {
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  h2 {
    font-size: clamp(1.8rem, 10vw, 2.45rem);
  }

  .quick-actions,
  .records-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button,
  .records-actions .button,
  .quick-actions .button {
    width: 100%;
  }

  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-item,
  .form-row {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    gap: 0.75rem;
  }

  .summary-cards article {
    border-radius: 16px;
    min-height: 105px;
    padding: 1rem;
  }

  .summary-cards span {
    font-size: clamp(1.9rem, 7vw, 2.3rem);
  }

  .summary-cards strong {
    font-size: 0.84rem;
    margin-top: 0.35rem;
  }

  .dashboard-date {
    text-align: left;
  }

  .records-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 0.9rem;
  }

  .records-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .table-wrapper {
    margin: 0;
    overflow: visible;
  }

  table,
  .records table,
  .records thead,
  .records tbody,
  .records tr,
  .records td {
    display: block;
    width: 100%;
  }

  .records table {
    min-width: 0;
  }

  .records thead {
    display: none;
  }

  .records tbody {
    display: grid;
    gap: 0.75rem;
  }

  .records tr {
    background: rgba(8, 10, 15, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
  }

  th,
  td {
    padding: 0.75rem 0.9rem;
  }

  .records td {
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 0.2rem;
    text-align: left;
  }

  .records td:last-child {
    border-bottom: 0;
  }

  .records td::before {
    color: var(--gold-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .clientes-table td:nth-child(1)::before {
    content: "Nome";
  }

  .clientes-table td:nth-child(2)::before {
    content: "Telefone";
  }

  .clientes-table td:nth-child(3)::before {
    content: "E-mail";
  }

  .clientes-table td:nth-child(4)::before {
    content: "CPF";
  }

  .clientes-table td:nth-child(5)::before {
    content: "Ações";
  }

  .agendamentos-table td:nth-child(1)::before {
    content: "Cliente";
  }

  .agendamentos-table td:nth-child(2)::before {
    content: "Serviço";
  }

  .agendamentos-table td:nth-child(3)::before {
    content: "Data";
  }

  .agendamentos-table td:nth-child(4)::before {
    content: "Horário";
  }

  .agendamentos-table td:nth-child(5)::before {
    content: "Status";
  }

  .agendamentos-table td:nth-child(6)::before {
    content: "Ações";
  }

  .agendamentos-table tr.status-confirmado {
    border-left: 3px solid rgba(86, 209, 133, 0.85);
  }

  .agendamentos-table tr.status-agendado {
    border-left: 3px solid rgba(255, 201, 107, 0.85);
  }

  .agendamentos-table tr.status-realizado {
    border-left: 3px solid rgba(96, 170, 255, 0.85);
  }

  .agendamentos-table tr.status-cancelado {
    border-left: 3px solid rgba(232, 111, 111, 0.85);
  }

  .table-action {
    width: 100%;
  }

  .status-pill {
    justify-self: start;
  }

  .whatsapp-link {
    word-break: break-word;
  }

  .modal {
    align-items: flex-end;
    padding: 0.5rem;
  }

  .modal-panel {
    max-height: 94vh;
    width: 100%;
  }

  .modal-panel .admin-card {
    border-radius: 24px;
    padding: 1rem;
  }
}
