/* PMVM Hub: tokens e componentes do portal do aluno (subset) */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #1D1805;
  --card-bg: #15120A;
  --card-bg-light: #251F0A;
  --border: #3D3520;
  --yellow: #F2C419;
  --yellow-light: #FCD753;
  --gold: #D4A843;
  --white: #FFFFFF;
  --text: #E8E4D8;
  --text-muted: #B0A88C;
  --green: #25D366;
  --font: "Inter", sans-serif;
}

body.hub-body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100vh;
  max-width: 100%;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo img {
  display: block;
  height: 24px;
  width: auto;
  max-width: min(184px, 55vw);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.student-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .student-name-desktop,
  .navbar-sair-desktop {
    display: none;
  }
}

.btn-sair {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  min-height: 44px;
  background: transparent;
  border: 2px solid var(--yellow);
  border-radius: 8px;
  color: var(--yellow);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-sair:hover {
  background: var(--yellow);
  color: var(--bg);
}

.page-title {
  font-family: var(--font);
  font-weight: 900;
  font-size: 1.75rem;
  line-height: 1.2;
  color: var(--white);
  margin: 0 0 1.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.page-title em {
  font-family: "Source Serif 4", serif;
  font-style: italic;
  font-weight: 400;
  color: var(--yellow);
}

.links-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--yellow);
  margin: 0 0 0.5rem;
}

.links-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
}

.sn-sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7A7260;
  padding: 16px 20px 6px;
  margin: 0;
}

.page-card {
  background: var(--card-bg-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s;
  min-width: 0;
  max-width: 100%;
}

.page-card:hover {
  border-color: var(--yellow);
}

.paginas-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"],
.login-form input[type="tel"],
.login-form input[type="url"],
.login-form input[type="datetime-local"],
.login-form textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 16px;
}

.login-form input:focus,
.login-form textarea:focus {
  outline: none;
  border-color: var(--yellow);
}

.form-error {
  font-size: 0.85rem;
  color: #e74c3c;
  margin-bottom: 0.5rem;
  min-height: 1.2em;
}

.btn-cta {
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.9rem 1.25rem;
  min-height: 48px;
  background: transparent;
  border: 2px solid var(--yellow);
  border-radius: 8px;
  color: var(--yellow);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-cta:hover {
  background: var(--yellow);
  color: var(--bg);
}

.btn-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-cta.btn-sm {
  width: auto;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  font-size: 0.75rem;
  margin-top: 0;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  font-size: 0.85rem;
  border-radius: 4px;
}

.btn-ghost:hover {
  color: var(--yellow);
  background: var(--card-bg-light);
}

.app-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sn-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 20px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sn-tab:hover {
  background: rgba(242, 196, 25, 0.05);
  color: #E8E4D8;
}

.sn-tab.active {
  background: rgba(242, 196, 25, 0.1);
  color: var(--yellow);
  border-left-color: var(--yellow);
  font-weight: 700;
}

.sn-tab-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sn-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-main {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  width: 100%;
}

.app-main > * {
  min-width: 0;
  max-width: 100%;
}

.mobile-tabs {
  display: none;
}

.mobile-tab {
  display: none;
}

.mobile-tab-label {
  font-size: 0.65rem;
}

.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(29, 24, 5, 0.85);
  display: flex;
  align-items: flex-end;
}

.mobile-sheet-panel {
  width: 100%;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  padding: 1rem 1.25rem 1.5rem;
}

.mobile-sheet-panel a,
.mobile-sheet-panel button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0;
  color: var(--text);
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}

.ach-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(29, 24, 5, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ach-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.ach-title {
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.75rem;
  line-height: 1.25;
  text-align: center;
}

.public-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
  overflow-x: hidden;
}

@media (min-width: 769px) {
  .public-shell {
    max-width: 480px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.packshot-wrap {
  text-align: center;
  margin-bottom: 1rem;
  max-width: 100%;
  overflow: hidden;
}

.packshot-wrap img {
  display: block;
  max-width: min(220px, 100%);
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.login-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.media-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}

.login-form input,
.login-form textarea {
  max-width: 100%;
  width: 100%;
}

.login-form label.flex,
.login-form label[style*='flex'] {
  max-width: 100%;
}

.login-form label span {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.sensor-metrics-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.sensor-metric-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sensor-metric-num {
  margin: 0;
  font-weight: 900;
  line-height: 1;
}

.sensor-metric-num-lg {
  font-size: 2rem;
}

.sensor-metric-num-sm {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.sensor-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.2;
}

.sensor-link-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  max-width: 100%;
}

.sensor-link-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.btn-copy-link:hover {
  color: var(--yellow);
}

.page-card .flex {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
  min-width: 0;
}

.page-card .btn-cta.flex-1 {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 0;
  max-width: 100%;
}

.chart-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  max-width: 100%;
  min-width: 0;
}

.chart-bars .bar {
  flex: 1;
  min-width: 0;
  background: var(--yellow);
  min-height: 0;
}

.chart-hour-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.chart-day-labels {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin-top: 6px;
}

.chart-day-labels .chart-bar-label {
  flex: 1;
  min-width: 0;
}

.chart-bar-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  line-height: 1;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

@media (min-width: 769px) {
  .packshot-wrap img {
    max-width: 320px;
  }
}

@media (max-width: 768px) {
  .mobile-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 8px 0;
    justify-content: space-around;
  }

  .mobile-tab {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 6px 2px;
    cursor: pointer;
    min-height: 44px;
    text-decoration: none;
  }

  .mobile-tab-label {
    font-size: 0.65rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab.active {
    color: var(--yellow);
  }

  .sidebar {
    display: none !important;
  }

  body.hub-body {
    padding-bottom: 72px;
  }

  .app-main {
    padding-bottom: 5rem;
    max-width: 100%;
  }

  .navbar {
    max-width: 100%;
    min-width: 0;
  }
}
