* {
  box-sizing: border-box;
}

:root {
  --bg: #07101e;
  --panel: #101b2d;
  --panel-2: #142239;
  --border: #243653;
  --text: #f4f7fb;
  --muted: #8fa1bd;
  --primary: #ff7a1a;
  --primary-hover: #ff9147;
  --green: #2dd881;
  --yellow: #ffc857;
  --red: #ff5d6c;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(
      circle at top,
      #172a47 0,
      #07101e 48%,
      #03070d 100%
    );
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 36px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(16, 27, 45, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
}

h1 {
  margin: 34px 0 10px;
  font-size: 32px;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

label {
  display: grid;
  gap: 8px;
  color: #d8e0ed;
  font-size: 14px;
  font-weight: bold;
}

form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #091426;
  color: white;
}

input:focus {
  border-color: var(--primary);
}

button {
  border: 0;
  cursor: pointer;
}

.login-card button,
.primary {
  padding: 14px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-weight: bold;
}

.login-card button:hover,
.primary:hover {
  background: var(--primary-hover);
}

.erro {
  min-height: 22px;
  margin-top: 18px;
  color: var(--red);
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #091426;
}

.sidebar-brand {
  padding: 0 8px 28px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.menu,
.logout {
  padding: 13px 14px;
  text-align: left;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.menu:hover,
.menu.active {
  background: var(--panel-2);
  color: white;
}

.logout {
  margin-top: auto;
  color: var(--red);
}

.content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar small {
  color: var(--muted);
}

.topbar h2 {
  margin: 5px 0 0;
  font-size: 28px;
}

.user-badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  color: #dbe4f3;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.metric,
.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.metric {
  padding: 20px;
}

.metric span {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.panel {
  padding: 24px;
  margin-top: 20px;
}

.panel h3 {
  margin: 0 0 8px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.status-grid div {
  padding: 15px;
  border-radius: 10px;
  background: var(--panel-2);
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
}

.green {
  background: var(--green);
}

.yellow {
  background: var(--yellow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.panel-header p {
  margin: 6px 0 0;
}

.small {
  padding: 10px 14px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
}

.badge.ativo {
  background: rgba(45, 216, 129, 0.15);
  color: var(--green);
}

.badge.pausado {
  background: rgba(255, 200, 87, 0.15);
  color: var(--yellow);
}

.badge.bloqueado {
  background: rgba(255, 93, 108, 0.15);
  color: var(--red);
}

.action-button {
  padding: 8px 10px;
  margin-right: 5px;
  border-radius: 8px;
  background: var(--panel-2);
  color: white;
}

.form-panel {
  max-width: 940px;
}

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

.form-actions {
  grid-column: 1 / -1;
}

#clienteMensagem {
  margin-top: 18px;
  font-weight: bold;
}

.sucesso {
  color: var(--green);
}

@media (max-width: 1000px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .app {
    grid-template-columns: 88px 1fr;
  }

  .sidebar-brand div,
  .menu {
    font-size: 0;
  }

  .menu::first-letter {
    font-size: 16px;
  }
}

@media (max-width: 700px) {
  .app {
    display: block;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar nav {
    display: flex;
  }

  .menu {
    font-size: 13px;
    white-space: nowrap;
  }

  .logout {
    margin: 0 0 0 auto;
  }

  .content {
    padding: 18px;
  }

  .cards,
  .status-grid,
  .client-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}

/* ==========================================
   DOUBLE FIRE DIGITAL — IDENTIDADE OFICIAL
   ========================================== */

:root {
  --fire-orange: #ff6a00;
  --fire-yellow: #ffb000;
  --fire-red: #ff2400;
  --fire-glow: rgba(255, 85, 0, 0.38);
  --silver: #dce3eb;
  --deep-black: #030406;
}

body {
  background:
    radial-gradient(
      circle at 80% 0%,
      rgba(255, 68, 0, 0.08),
      transparent 30%
    ),
    radial-gradient(
      circle at 10% 20%,
      rgba(255, 153, 0, 0.06),
      transparent 28%
    ),
    var(--bg);
}

.brand-logo-box {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #020203;
  border: 1px solid rgba(255, 113, 0, 0.55);
  box-shadow:
    0 0 18px rgba(255, 75, 0, 0.25),
    inset 0 0 12px rgba(255, 111, 0, 0.08);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
}

.login-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 107, 0, 0.35);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    0 0 35px rgba(255, 72, 0, 0.08);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background:
    linear-gradient(
      90deg,
      transparent,
      var(--fire-red),
      var(--fire-yellow),
      var(--fire-red),
      transparent
    );
}

.login-card h1,
.topbar h2 {
  letter-spacing: -0.02em;
}

.login-card button,
.primary {
  background:
    linear-gradient(
      135deg,
      var(--fire-red),
      var(--fire-orange)
    );
  box-shadow: 0 10px 28px var(--fire-glow);
}

.login-card button:hover,
.primary:hover {
  background:
    linear-gradient(
      135deg,
      var(--fire-orange),
      var(--fire-yellow)
    );
}

.sidebar {
  background:
    linear-gradient(
      180deg,
      #070a10,
      #091426 55%,
      #05070c
    );
}

.sidebar-brand {
  border-bottom: 1px solid rgba(255, 111, 0, 0.17);
  margin-bottom: 20px;
}

.menu:hover,
.menu.active {
  background:
    linear-gradient(
      90deg,
      rgba(255, 72, 0, 0.18),
      rgba(255, 137, 0, 0.05)
    );
  color: #ffffff;
  border-left: 3px solid var(--fire-orange);
}

.metric {
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 3px;
  background:
    linear-gradient(
      var(--fire-yellow),
      var(--fire-red)
    );
}

.metric strong {
  color: #ffffff;
  text-shadow: 0 0 18px rgba(255, 107, 0, 0.12);
}

.panel {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

@media (max-width: 700px) {
  .brand-logo-box {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .login-card {
    padding: 27px;
  }
}

/* ==========================================
   FASE 4 — FICHA COMPLETA DO CLIENTE
   ========================================== */

.client-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
}

.client-link:hover {
  color: var(--fire-orange);
  text-decoration: underline;
}

.client-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

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

.secondary-button,
.delete-button {
  padding: 11px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: #ffffff;
  font-weight: 700;
}

.secondary-button:hover {
  border-color: var(--fire-orange);
}

.warning-button {
  color: var(--yellow);
}

.danger-button,
.delete-button {
  color: var(--red);
}

.delete-button {
  background: rgba(255, 93, 108, 0.08);
  border-color: rgba(255, 93, 108, 0.4);
}

.delete-button:hover {
  background: rgba(255, 93, 108, 0.17);
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-columns .panel {
  height: calc(100% - 20px);
}

.full-field {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  background: #091426;
  color: #ffffff;
  font: inherit;
}

textarea:focus {
  border-color: var(--fire-orange);
}

.danger-panel {
  border-color: rgba(255, 93, 108, 0.28);
}

@media (max-width: 1000px) {
  .detail-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .client-detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-actions,
  .detail-columns {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-metrics {
    grid-template-columns: 1fr;
  }
}

/* FASE 5B — SESSÕES ADMINISTRATIVAS */

.sessions-admin-panel {
  margin-top: 20px;
}

.session-contract-summary {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 15px 17px;
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
}

.session-contract-summary strong {
  color: #ffffff;
}

.session-form-container {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid rgba(255, 107, 0, 0.32);
  border-radius: 14px;
  background: rgba(255, 107, 0, 0.025);
}

.weekday-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 9px;
}

.weekday-selector label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2);
  cursor: pointer;
}

.weekday-selector input {
  width: auto;
  margin: 0;
}

.field-label {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.sessions-list {
  display: grid;
  gap: 12px;
}

.session-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
}

.session-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.session-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.session-title-line h4 {
  margin: 0;
  color: #ffffff;
  font-size: 17px;
}

.session-card p {
  margin: 8px 0;
  color: #ffffff;
  font-weight: 700;
}

.session-card small {
  color: var(--muted);
}

.session-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-text {
  color: var(--red);
}

.empty-session-state {
  padding: 25px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 800px) {
  .session-card-main {
    align-items: stretch;
    flex-direction: column;
  }

  .session-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
