/* Design system Studio EWOS — paleta oficial (PLANO_MESTRE V2, secao 5.1) */
:root {
  --ewos-bg: #0C0E0D;
  --ewos-surface: #151917;
  --ewos-surface-raised: #202522;
  --ewos-border: #2A2E2C;
  --ewos-primary: #39D321;
  --ewos-primary-hover: #45E62C;
  --ewos-on-primary: #0C0E0D;
  --ewos-text: #E8ECEA;
  --ewos-text-muted: #9AA39E;
  --ewos-info: #55A8FF;
  --ewos-warning: #F4C84A;
  --ewos-danger: #FF6464;

  /* Aliases usados pelo restante da folha */
  --bg-main: var(--ewos-bg);
  --bg-card: var(--ewos-surface);
  --text-main: var(--ewos-text);
  --text-muted: var(--ewos-text-muted);
  --status-green: var(--ewos-primary);
  --status-red: var(--ewos-danger);
  --line: rgba(57, 211, 33, 0.24);
  --sidebar-width: 240px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(circle at 10% 0%, rgba(57, 211, 33, 0.14), transparent 36%),
    radial-gradient(circle at 96% 12%, rgba(57, 211, 33, 0.1), transparent 30%),
    linear-gradient(180deg, #121512 0%, #0A0C0B 100%);
}

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(57, 211, 33, 0.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(57, 211, 33, 0.08), transparent 42%),
    rgba(5, 5, 5, 0.94);
}

.lock-screen.active {
  display: flex;
}

.lock-card {
  width: min(420px, 100%);
  border: 1px solid rgba(57, 211, 33, 0.34);
  border-radius: 16px;
  padding: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.46);
}

.lock-card h2 {
  margin: 0;
}

.lock-card p {
  margin: 8px 0 12px;
}

.lock-card input {
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-align: center;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.app-layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    #121512;
  z-index: 40;
}

.sidebar-brand {
  margin-bottom: 22px;
  padding: 10px 8px;
}

.sidebar-brand h1 {
  margin: 0;
  color: var(--ewos-primary);
  font-size: 1.02rem;
  letter-spacing: 0.06em;
}

.sidebar-brand p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.sidebar-tabs {
  display: grid;
  gap: 8px;
}

.tab-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  font-size: 1.02rem;
  padding: 13px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(57, 211, 33, 0.35);
}

.tab-btn.active {
  color: var(--ewos-primary);
  border-color: rgba(57, 211, 33, 0.5);
  background: linear-gradient(90deg, rgba(57, 211, 33, 0.22) 0%, rgba(57, 211, 33, 0.05) 100%);
}

.tab-icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.tab-icon-img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.94;
}

.tab-btn.active .tab-icon-img,
.tab-btn:hover .tab-icon-img {
  opacity: 1;
  transform: scale(1.04);
}

.main-shell {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 86px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(57, 211, 33, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(10px);
}

.search-shell {
  position: relative;
  width: min(360px, 60vw);
}

.search-shell input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 12px 14px;
}

.search-shell input::placeholder {
  color: #8f8f8f;
}

.topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.notify-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ewos-primary);
  font-size: 1rem;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #d5d5d5;
  font-size: 0.95rem;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(57, 211, 33, 0.4);
  background: linear-gradient(135deg, #C9F4C0 0%, #8FE87D 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #14300D;
  font-weight: 700;
}

.content-shell {
  padding: 22px 26px 30px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

#tab-dashboard.tab-panel.active {
  display: grid;
  gap: 18px;
}

.dashboard-logo {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.dashboard-logo img {
  width: min(560px, 70vw);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.finance-summary-card {
  min-height: 108px;
}

.finance-summary-card .kpi-meta small {
  font-size: 0.84rem;
}

.finance-summary-card .kpi-meta strong {
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
}

.finance-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finance-chart-panel {
  padding-bottom: 10px;
}

.finance-chart-wrap {
  position: relative;
  height: 290px;
}

.cash-flow-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.cash-flow-breakdown-grid,
.cash-flow-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.cash-flow-section {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  padding: 12px;
}

.cash-flow-section h4 {
  margin: 0 0 10px;
}

.cash-flow-breakdown-list {
  display: grid;
  gap: 8px;
}

.cash-flow-breakdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.cash-flow-breakdown-row span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.cash-flow-breakdown-row strong {
  white-space: nowrap;
}

.cash-flow-controls {
  max-width: 720px;
}

.compact-section-head {
  margin-bottom: 8px;
}

.kpi-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)), var(--bg-card);
  border: 1px solid var(--ewos-primary);
  border-radius: 8px;
  min-height: 114px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.kpi-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid rgba(57, 211, 33, 0.7);
  color: var(--ewos-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
}

.kpi-meta small {
  display: block;
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.kpi-meta strong {
  font-size: clamp(1.7rem, 2.8vw, 2.3rem);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)), var(--bg-card);
  border: 1px solid rgba(57, 211, 33, 0.28);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

h2,
h3,
h4 {
  margin: 0 0 10px;
  color: var(--ewos-primary);
}

.feed {
  display: grid;
  gap: 9px;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.avatar,
.avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(57, 211, 33, 0.36);
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #DFF5DA;
  background: rgba(57, 211, 33, 0.18);
  font-weight: 600;
}

.status-row {
  display: grid;
  gap: 9px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 11px 10px;
  background: rgba(255, 255, 255, 0.02);
  color: #ececec;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9d9d9d;
  flex: 0 0 auto;
}

.dot.ok {
  background: var(--status-green);
}

.dot.fail {
  background: var(--status-red);
}

#whatsapp-log-list {
  margin: 0;
  padding-left: 18px;
  max-height: 180px;
  overflow: auto;
}

#whatsapp-log-list li {
  color: var(--text-muted);
  margin-bottom: 5px;
}

#whatsapp-reception-alert-list {
  margin: 0;
  padding-left: 18px;
  max-height: 220px;
  overflow: auto;
}

#whatsapp-reception-alert-list li {
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.35;
}

.reception-alert-item {
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  margin-left: -18px;
  background: rgba(255, 255, 255, 0.02);
}

.reception-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sla-pill {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: #f5f5f5;
  background: rgba(255, 255, 255, 0.06);
}

.sla-pill.warn {
  border-color: rgba(255, 195, 0, 0.55);
  color: #F4C84A;
  background: rgba(255, 193, 7, 0.16);
}

.sla-pill.danger {
  border-color: rgba(198, 40, 40, 0.55);
  color: #ffb4b4;
  background: rgba(198, 40, 40, 0.2);
}

.reception-alert-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.reception-alert-actions {
  margin-top: 6px;
}

.reception-alert-actions button {
  padding: 4px 10px;
  font-size: 0.78rem;
}

.queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(198, 40, 40, 0.4);
  background: rgba(198, 40, 40, 0.18);
  color: #ffb4b4;
  font-size: 0.78rem;
  font-weight: 700;
}

.tab-btn .queue-badge {
  margin-left: auto;
}

.tag-ok {
  color: var(--status-green);
  font-weight: 600;
}

.tag-warning {
  color: var(--ewos-primary-hover);
  font-weight: 600;
}

.tag-danger {
  color: var(--status-red);
  font-weight: 600;
}

.status {
  font-size: 0.88rem;
}

.muted {
  color: var(--text-muted);
}

.status-ok {
  color: var(--status-green);
  font-weight: 600;
}

.status-danger {
  color: var(--status-red);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: 1.35fr 1fr;
}

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

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

.inline > * {
  flex: 1;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--ewos-primary);
  color: #0C0E0D;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: var(--ewos-primary-hover);
}

button.secondary {
  background: #2A2E2C;
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.14);
}

button.secondary:hover {
  border-color: rgba(57, 211, 33, 0.52);
  color: var(--ewos-primary-hover);
}

button.ghost {
  background: transparent;
  color: #e4e4e4;
  border-color: rgba(255, 255, 255, 0.25);
}

button.ghost:hover {
  border-color: rgba(57, 211, 33, 0.64);
  color: var(--ewos-primary-hover);
}

button.danger {
  background: #89271f;
  color: #fff;
}

button.danger:hover {
  background: #a83024;
}

form {
  display: grid;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px;
  color: #f3f3f3;
  background: rgba(255, 255, 255, 0.03);
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-color: rgba(255, 255, 255, 0.05);
  background-image:
    linear-gradient(45deg, transparent 50%, #39D321 50%),
    linear-gradient(135deg, #39D321 50%, transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 32px) 50%;
  background-size:
    6px 6px,
    6px 6px,
    1px 60%;
  background-repeat: no-repeat;
}

select[multiple],
select[size]:not([size="1"]) {
  appearance: auto;
  -webkit-appearance: auto;
  -moz-appearance: auto;
  padding-right: 10px;
  background-image: none;
}

select option,
select optgroup {
  color: #f3f3f3;
  background-color: #171B19;
}

select option:checked,
select option:hover,
select option:focus {
  color: #ffffff;
  background-color: #2A2E2C;
}

input::placeholder,
textarea::placeholder {
  color: #8f8f8f;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

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

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  vertical-align: top;
}

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

.student-tabs,
.workouts-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-detail-panel {
  display: grid;
  gap: 12px;
}

.student-detail-panel .student-detail-card > hr:first-child {
  display: none;
}

.student-detail-panel .student-detail-card > h3:first-of-type {
  display: none;
}

.student-detail-card {
  display: grid;
  gap: 10px;
}

.student-financial-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.student-financial-summary div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(57, 211, 33, 0.18);
  border-radius: 10px;
  background: rgba(57, 211, 33, 0.08);
}

.student-financial-summary span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.student-financial-summary strong {
  font-size: 1.35rem;
}

.student-financial-actions {
  margin-bottom: 12px;
}

.student-financial-list,
.student-confirmation-list {
  display: grid;
  gap: 10px;
}

.student-financial-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.student-financial-head,
.student-confirmation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: start;
}

.student-confirmation-item {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.finance-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.finance-subtab-btn,
.settings-subtab-btn {
  border: 1px solid rgba(255, 255, 255, 0.23);
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.finance-subtab-btn.active,
.settings-subtab-btn.active {
  background: rgba(57, 211, 33, 0.22);
  border-color: rgba(57, 211, 33, 0.6);
  color: var(--ewos-primary-hover);
}

.settings-panels {
  display: block;
}

.settings-subpanel {
  display: none;
}

.settings-subpanel.active {
  display: block;
}

.access-log-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.access-log-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.access-log-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.access-log-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.access-log-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.finance-subpanel,
.students-subpanel {
  display: none;
}

.finance-subpanel.active,
.students-subpanel.active {
  display: block;
}

.payment-confirmation-panel {
  border-color: rgba(198, 40, 40, 0.42);
  background: rgba(198, 40, 40, 0.08);
}

.finance-alert-card.attention {
  border-color: rgba(198, 40, 40, 0.52);
  background: rgba(198, 40, 40, 0.12);
}

.compact-btn {
  margin-top: 8px;
  min-height: 34px;
  padding: 6px 10px;
}

.compact-actions {
  max-width: 360px;
}

.overdue-collections-panel {
  border-color: rgba(198, 40, 40, 0.32);
  background: rgba(198, 40, 40, 0.06);
}

.overdue-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.overdue-summary-grid div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.overdue-summary-grid span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.overdue-summary-grid strong {
  font-size: 1.12rem;
}

.overdue-collections-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.overdue-collection-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, max-content);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(57, 211, 33, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.overdue-collection-head,
.overdue-collection-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.overdue-collection-head {
  justify-content: space-between;
}

.overdue-collection-actions {
  justify-content: flex-end;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.payment-confirmation-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.payment-confirmation-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, max-content);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(57, 211, 33, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.payment-confirmation-head,
.payment-confirmation-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.payment-confirmation-head {
  justify-content: space-between;
}

.payment-confirmation-actions {
  justify-content: flex-end;
}

.biometric-review-card {
  grid-template-columns: minmax(0, 1fr) minmax(160px, max-content);
}

.biometric-review-main {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.biometric-selfie-wrap {
  width: 76px;
}

.biometric-selfie-thumb,
.biometric-selfie-placeholder {
  width: 76px;
  height: 76px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.biometric-selfie-placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  text-align: center;
}

.receipt-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2A2E2C;
  color: #f2f2f2;
  text-decoration: none;
}

.receipt-link:hover {
  border-color: rgba(57, 211, 33, 0.52);
  color: var(--ewos-primary-hover);
}

.pdv-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pdv-product-card {
  display: grid;
  gap: 4px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #f2f2f2;
  padding: 10px;
}

.pdv-product-card.selected {
  border-color: rgba(57, 211, 33, 0.74);
  box-shadow: 0 0 0 2px rgba(57, 211, 33, 0.16) inset;
}

.pdv-product-card.out {
  opacity: 0.6;
}

.pdv-product-card small {
  color: var(--text-muted);
}

.pdv-top-products {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.pdv-top-products-controls {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.pdv-top-products-controls h4 {
  margin: 0;
}

.pdv-top-products-controls select {
  width: auto;
  min-width: 156px;
}

.pdv-top-products-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pdv-top-item {
  display: grid;
  gap: 4px;
}

.pdv-top-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.pdv-top-item-name {
  font-weight: 600;
}

.pdv-top-item-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pdv-top-item-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.pdv-top-item-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(57, 211, 33, 0.45), rgba(57, 211, 33, 0.9));
}

select[data-action="invoice-payment-method"] {
  min-width: 128px;
  margin-bottom: 6px;
}

.assessment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.assessment-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.assessment-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#evaluationsHistoryList {
  display: grid;
  gap: 8px;
}

.evaluation-history-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.evaluation-history-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.agenda-filters {
  max-width: 420px;
}

.agenda-days-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-days-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #ededed;
  font-size: 0.84rem;
}

.agenda-days-picker input[type="checkbox"] {
  width: auto;
}

.agenda-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.agenda-slot-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.agenda-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.agenda-slot-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.agenda-slot-edit-btn,
.agenda-slot-delete-btn {
  padding: 6px 8px;
  font-size: 0.75rem;
}

.agenda-bookings-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.agenda-booking-row {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.agenda-booking-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.agenda-booking-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.68);
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: min(760px, 100%);
  border: 1px solid rgba(57, 211, 33, 0.34);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)), var(--bg-card);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.agenda-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.agenda-delete-warning {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 100, 100, 0.42);
  background: rgba(255, 100, 100, 0.14);
  color: #ffd7d4;
  font-size: 0.84rem;
}

.whatsapp-desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr) minmax(0, 0.8fr);
  gap: 12px;
}

.whatsapp-conversation-list,
.whatsapp-messages-list,
.whatsapp-events-list {
  display: grid;
  gap: 8px;
  max-height: 62vh;
  overflow: auto;
}

.whatsapp-conversation-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.whatsapp-conversation-item.active {
  border-color: rgba(57, 211, 33, 0.65);
  background: rgba(57, 211, 33, 0.12);
}

.whatsapp-conversation-filters {
  align-items: center;
}

#whatsappMineConversationsBtn.is-active,
#whatsappMineOpenConversationsBtn.is-active {
  border-color: rgba(57, 211, 33, 0.72);
  background: rgba(57, 211, 33, 0.2);
  color: var(--ewos-primary-hover);
}

.whatsapp-meta-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(160px, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.whatsapp-status-pill {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.whatsapp-status-pill.open {
  color: var(--status-green);
}

.whatsapp-status-pill.waiting {
  color: var(--ewos-primary-hover);
}

.whatsapp-status-pill.closed {
  color: var(--status-red);
}

.whatsapp-sla-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.whatsapp-sla-pill.ok {
  color: var(--status-green);
  border-color: rgba(57, 211, 33, 0.45);
  background: rgba(57, 211, 33, 0.12);
}

.whatsapp-sla-pill.warning,
.whatsapp-sla-pill.waiting {
  color: var(--ewos-primary-hover);
  border-color: rgba(57, 211, 33, 0.52);
  background: rgba(57, 211, 33, 0.14);
}

.whatsapp-sla-pill.critical {
  color: var(--status-red);
  border-color: rgba(255, 100, 100, 0.55);
  background: rgba(255, 100, 100, 0.14);
}

.whatsapp-sla-pill.neutral {
  color: var(--text-muted);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.whatsapp-message-row {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.whatsapp-message-row.outbound {
  border-color: rgba(57, 211, 33, 0.45);
}

.whatsapp-message-row.inbound {
  border-color: rgba(255, 255, 255, 0.18);
}

.whatsapp-event-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.student-tab-btn,
.workouts-tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.23);
  background: rgba(255, 255, 255, 0.05);
  color: #f0f0f0;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  cursor: pointer;
}

.student-tab-btn.active,
.workouts-tab-btn.active {
  background: rgba(57, 211, 33, 0.22);
  border-color: rgba(57, 211, 33, 0.6);
  color: var(--ewos-primary-hover);
}

.student-tab-panel,
.workouts-panel {
  display: none;
}

.student-tab-panel.active,
.workouts-panel.active {
  display: block;
}

.drag-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.exercise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 360px;
  overflow: auto;
}

.exercise-list li {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  cursor: grab;
}

.exercise-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
}

.exercise-item-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.exercise-thumb,
.builder-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid rgba(57, 211, 33, 0.34);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.builder-thumb {
  width: 42px;
  height: 42px;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-style: dashed;
}

.builder-exercise {
  display: flex;
  gap: 8px;
  align-items: center;
}

.builder-exercise-name {
  display: grid;
  gap: 2px;
}

.thumb-hover {
  position: relative;
  display: inline-flex;
}

.thumb-zoom {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  width: 220px;
  border-radius: 12px;
  border: 1px solid rgba(57, 211, 33, 0.42);
  background: #141816;
  padding: 4px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.thumb-zoom img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.thumb-hover:hover .thumb-zoom {
  display: block;
}

.load-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.load-input {
  min-width: 180px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.load-tip {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: #d6d6d6;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex: 0 0 auto;
}

.load-tip::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(360px, 70vw);
  background: #121614;
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  z-index: 60;
}

.load-tip:hover::after {
  display: block;
}

.template-meta {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

.template-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.template-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.template-toolbar button {
  flex: 0 1 auto;
}

.template-variable-panel {
  border: 1px solid rgba(57, 211, 33, 0.2);
  border-radius: 10px;
  background: rgba(57, 211, 33, 0.06);
  padding: 10px;
}

.compact-section-head {
  margin-bottom: 8px;
}

.compact-section-head h4 {
  margin: 0;
}

.template-variable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-variable-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
}

.template-variable-chip strong {
  color: var(--ewos-primary-hover);
}

.template-variable-chip span {
  color: var(--text-muted);
}

.chatbot-knowledge-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 10px;
  border: 1px solid rgba(57, 211, 33, 0.2);
  border-radius: 10px;
  background: rgba(57, 211, 33, 0.05);
}

.chatbot-knowledge-list {
  display: grid;
  gap: 10px;
}

.chatbot-knowledge-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.chatbot-knowledge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.student-workout-blocks-list {
  display: grid;
  gap: 8px;
}

.student-workout-block {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.student-workout-block.active {
  border-color: rgba(57, 211, 33, 0.65);
  box-shadow: 0 0 0 1px rgba(57, 211, 33, 0.22);
}

.student-workout-block small {
  display: block;
  margin-top: 2px;
}

.student-progress-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(57, 211, 33, 0.28);
  border-radius: 10px;
  background: rgba(57, 211, 33, 0.07);
}

.student-progress-head,
.student-progress-card-head,
.student-progress-summary,
.student-progress-columns {
  display: flex;
  gap: 10px;
}

.student-progress-head,
.student-progress-card-head {
  justify-content: space-between;
  align-items: flex-start;
}

.student-progress-head p {
  margin: 3px 0 0;
}

.student-progress-summary {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.student-progress-summary span,
.tag-info {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(85, 168, 255, 0.16);
  border: 1px solid rgba(85, 168, 255, 0.32);
  color: #A9CFFF;
  font-size: 0.82rem;
}

.student-progress-list {
  display: grid;
  gap: 8px;
}

.student-progress-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.student-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.student-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ewos-primary);
}

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

.student-progress-columns div div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.student-progress-columns div div span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #e7e7e7;
  font-size: 0.78rem;
}

.drop-zone {
  border: 2px dashed rgba(57, 211, 33, 0.36);
  border-radius: 12px;
  padding: 10px;
  min-height: 220px;
  background: rgba(255, 255, 255, 0.02);
}

#whatsappQr {
  width: 100%;
  max-width: 220px;
  display: none;
  border: 1px dashed rgba(57, 211, 33, 0.42);
  border-radius: 10px;
}

hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

@media (max-width: 1180px) {
  .dashboard-grid,
  .grid-2,
  .drag-layout {
    grid-template-columns: 1fr;
  }

  .assessment-grid {
    grid-template-columns: 1fr;
  }

  .assessment-form-grid,
  .evaluation-history-meta,
  .agenda-slots-grid {
    grid-template-columns: 1fr;
  }

  .pdv-product-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-desk-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-meta-form {
    grid-template-columns: 1fr;
  }

  .agenda-booking-compose,
  .agenda-modal-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .finance-chart-grid {
    grid-template-columns: 1fr;
  }

  .cash-flow-kpi-grid,
  .cash-flow-breakdown-grid,
  .cash-flow-table-grid {
    grid-template-columns: 1fr;
  }

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

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

  .student-financial-head,
  .student-confirmation-item,
  .overdue-collection-card {
    grid-template-columns: 1fr;
  }

  .payment-confirmation-card {
    grid-template-columns: 1fr;
  }

  .biometric-review-main {
    grid-template-columns: 1fr;
  }

  .payment-confirmation-actions,
  .overdue-collection-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .finance-summary-grid {
    grid-template-columns: 1fr;
  }

  .cash-flow-kpi-grid {
    grid-template-columns: 1fr;
  }

  .student-financial-summary {
    grid-template-columns: 1fr;
  }

  .overdue-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 88px;
  }

  .sidebar-brand h1,
  .sidebar-brand p,
  .tab-label {
    display: none;
  }

  .tab-btn {
    justify-content: center;
    padding: 12px;
  }

  .tab-icon {
    margin: 0;
  }

  .topbar {
    padding: 0 18px;
  }

  .content-shell {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: sticky;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-tabs::-webkit-scrollbar {
    height: 6px;
  }

  .sidebar-tabs::-webkit-scrollbar-thumb {
    background: rgba(57, 211, 33, 0.4);
    border-radius: 999px;
  }

  .tab-btn {
    min-width: 130px;
    justify-content: flex-start;
    padding: 10px;
    font-size: 0.9rem;
  }

  .tab-label {
    display: none;
  }

  .main-shell {
    margin-left: 0;
  }

  .topbar {
    margin: 10px 12px 0;
    border: 1px solid rgba(57, 211, 33, 0.2);
    border-radius: 12px;
    height: auto;
    padding: 10px;
    flex-wrap: wrap;
  }

  .search-shell {
    width: 100%;
  }

  .content-shell {
    padding: 14px 12px 18px;
  }

  .dashboard-logo img {
    width: min(420px, 90vw);
  }

  .exercise-item {
    grid-template-columns: 42px 1fr;
  }

  .exercise-item-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: stretch;
  }

  .student-workout-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .student-progress-head,
  .student-progress-card-head,
  .student-progress-columns {
    grid-template-columns: 1fr;
    display: grid;
  }

  .student-progress-summary {
    justify-content: flex-start;
  }
}

/* Admin CSS repair - 20260525 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  min-width: 0;
}

.app-layout {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  .app-layout {
    overflow-x: clip;
  }
}

.main-shell,
.content-shell,
.tab-panel,
.panel,
.student-detail-panel,
.student-detail-card,
.finance-subpanel.active,
.students-subpanel.active {
  min-width: 0;
  max-width: 100%;
}

.content-shell {
  width: 100%;
}

.topbar-right,
.profile-pill {
  min-width: 0;
}

#profileName {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-head {
  flex-wrap: wrap;
}

.panel {
  overflow-x: auto;
}

table {
  min-width: 680px;
}

td {
  overflow-wrap: anywhere;
}

.finance-subtabs,
.settings-subtabs {
  min-width: 0;
}

.modal-card {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

@media (max-width: 768px) {
  .access-log-filters {
    grid-template-columns: 1fr;
  }

  .access-log-pager {
    justify-content: stretch;
  }

  .access-log-pager button {
    flex: 1;
  }

  body {
    min-width: 0;
  }

  .app-layout {
    display: block;
    overflow-x: hidden;
  }

  .sidebar {
    top: 0;
    overflow: hidden;
  }

  .sidebar-tabs {
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    min-width: 132px;
    flex: 0 0 auto;
  }

  .tab-label {
    display: inline;
  }

  .main-shell {
    width: 100%;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .profile-pill {
    flex: 1 1 100%;
  }

  .topbar-auth-btn {
    flex: 1 1 calc(50% - 4px);
  }

  .content-shell {
    max-width: 100vw;
  }

  .panel {
    padding: 12px;
    border-radius: 12px;
  }

  .section-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .section-head .inline {
    max-width: none !important;
  }

  .inline {
    width: 100%;
  }

  .inline > * {
    flex: 1 1 100%;
  }

  .finance-subtabs,
  .settings-subtabs,
  .student-tabs,
  .workouts-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .finance-subtab-btn,
  .settings-subtab-btn,
  .student-tab-btn,
  .workouts-tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
  }

  .panel button,
  .modal-card button,
  .receipt-link {
    width: 100%;
  }

  table button,
  table select,
  table .receipt-link {
    width: auto;
    max-width: 100%;
  }

  .agenda-slot-head,
  .agenda-slot-head-actions,
  .agenda-booking-actions,
  .payment-confirmation-actions,
  .overdue-collection-actions,
  .pdv-top-products-controls,
  .chatbot-knowledge-head {
    align-items: stretch;
    flex-direction: column;
  }

  .whatsapp-conversation-list,
  .whatsapp-messages-list,
  .whatsapp-events-list {
    max-height: 48vh;
  }

  .load-cell {
    align-items: stretch;
    flex-direction: column;
  }

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

  .thumb-zoom {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding-inline: 8px;
  }

  .tab-btn {
    min-width: 116px;
    padding: 9px;
    font-size: 0.82rem;
  }

  .tab-icon,
  .tab-icon-img {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .topbar {
    margin-inline: 8px;
  }

  .content-shell {
    padding-inline: 8px;
  }

  .profile-avatar {
    width: 30px;
    height: 30px;
  }

  .kpi-card,
  .feed-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .kpi-icon {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }

  table {
    min-width: 620px;
  }
}

/* ---------------------------------------------------------------
   Design system EWOS: modal de confirmacao de operacoes sensiveis
   --------------------------------------------------------------- */
.ewos-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 7, 0.72);
  backdrop-filter: blur(4px);
}

.ewos-modal {
  width: min(440px, 100%);
  border: 1px solid var(--ewos-border);
  border-radius: 14px;
  padding: 20px;
  background: var(--ewos-surface-raised);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.ewos-modal h3 {
  margin: 0 0 8px;
  color: var(--ewos-text);
  font-size: 1.05rem;
}

.ewos-modal p {
  margin: 0 0 16px;
  color: var(--ewos-text-muted);
  line-height: 1.55;
  white-space: pre-line;
}

.ewos-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ewos-modal-actions button {
  min-height: 40px;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}

.ewos-modal-cancel {
  border: 1px solid var(--ewos-border);
  background: transparent;
  color: var(--ewos-text);
}

.ewos-modal-cancel:hover,
.ewos-modal-cancel:focus-visible {
  border-color: rgba(57, 211, 33, 0.5);
  outline: none;
}

.ewos-modal-confirm {
  border: 1px solid transparent;
  background: var(--ewos-primary);
  color: var(--ewos-on-primary);
}

.ewos-modal-confirm:hover {
  background: var(--ewos-primary-hover);
}

.ewos-modal-confirm.danger {
  background: var(--ewos-danger);
  color: #1c0808;
}

.ewos-modal-confirm.danger:hover {
  background: #ff7d7d;
}

/* ---------------------------------------------------------------
   Gestao de Treinos - Fase A: contexto do aluno, chips e ferramentas
   --------------------------------------------------------------- */
.workout-student-context {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(57, 211, 33, 0.05);
  font-size: 0.92rem;
}

.workout-student-context.muted {
  background: transparent;
  color: var(--text-muted);
}

.workout-context-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.workout-context-item {
  color: var(--text-muted);
}

.workout-context-restrictions {
  margin-top: 6px;
  color: var(--ewos-warning);
}

.workout-context-ok {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.template-browser {
  border: 1px solid var(--ewos-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chip {
  border: 1px solid var(--ewos-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip:hover {
  border-color: rgba(57, 211, 33, 0.5);
  color: var(--text-main);
}

.chip.active {
  border-color: var(--ewos-primary);
  background: rgba(57, 211, 33, 0.16);
  color: var(--ewos-primary);
}

.exercise-list-note {
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  list-style: none;
}

#weekDayTabs .student-tab-btn.preferred-day::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--ewos-primary);
  vertical-align: middle;
}
