:root {
  --bg-main: #0a0a0a;
  --bg-card: #1a1a1a;
  --gold-primary: #d4af37;
  --gold-hover: #e4c25a;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --status-green: #4caf50;
  --status-red: #f44336;
  --line: rgba(212, 175, 55, 0.28);
  --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(212, 175, 55, 0.14), transparent 36%),
    radial-gradient(circle at 96% 12%, rgba(212, 175, 55, 0.1), transparent 30%),
    linear-gradient(180deg, #111111 0%, #080808 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(212, 175, 55, 0.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 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(212, 175, 55, 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)),
    #111111;
  z-index: 40;
}

.sidebar-brand {
  margin-bottom: 22px;
  padding: 10px 8px;
}

.sidebar-brand h1 {
  margin: 0;
  color: var(--gold-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(212, 175, 55, 0.35);
}

.tab-btn.active {
  color: var(--gold-primary);
  border-color: rgba(212, 175, 55, 0.5);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 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(212, 175, 55, 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(--gold-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(212, 175, 55, 0.4);
  background: linear-gradient(135deg, #f3d6c0 0%, #d5a98a 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3f2a17;
  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(360px, 54vw);
  max-width: 100%;
  max-height: 140px;
  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;
}

.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(--gold-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(212, 175, 55, 0.7);
  color: var(--gold-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(212, 175, 55, 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(--gold-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(212, 175, 55, 0.36);
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f4e6c5;
  background: rgba(212, 175, 55, 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: #ffd54f;
  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(--gold-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;
}

.form-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.form-field span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--gold-primary);
  color: #1d1606;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: var(--gold-hover);
}

button.secondary {
  background: #2a2a2a;
  color: #f2f2f2;
  border-color: rgba(255, 255, 255, 0.14);
}

button.secondary:hover {
  border-color: rgba(212, 175, 55, 0.52);
  color: var(--gold-hover);
}

button.ghost {
  background: transparent;
  color: #e4e4e4;
  border-color: rgba(255, 255, 255, 0.25);
}

button.ghost:hover {
  border-color: rgba(212, 175, 55, 0.64);
  color: var(--gold-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%, #d4af37 50%),
    linear-gradient(135deg, #d4af37 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: #1b1b1b;
}

select option:checked,
select option:hover,
select option:focus {
  color: #ffffff;
  background-color: #2b2b2b;
}

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(212, 175, 55, 0.18);
  border-radius: 10px;
  background: rgba(212, 175, 55, 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(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.6);
  color: var(--gold-hover);
}

.settings-panels {
  display: block;
}

.settings-subpanel {
  display: none;
}

.settings-subpanel.active {
  display: block;
}

.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(212, 175, 55, 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(212, 175, 55, 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: #2a2a2a;
  color: #f2f2f2;
  text-decoration: none;
}

.receipt-link:hover {
  border-color: rgba(212, 175, 55, 0.52);
  color: var(--gold-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(212, 175, 55, 0.74);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 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(212, 175, 55, 0.45), rgba(212, 175, 55, 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;
  gap: 6px;
}

.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(212, 175, 55, 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(244, 67, 54, 0.42);
  background: rgba(244, 67, 54, 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(212, 175, 55, 0.65);
  background: rgba(212, 175, 55, 0.12);
}

.whatsapp-conversation-filters {
  align-items: center;
}

#whatsappMineConversationsBtn.is-active,
#whatsappMineOpenConversationsBtn.is-active {
  border-color: rgba(212, 175, 55, 0.72);
  background: rgba(212, 175, 55, 0.2);
  color: var(--gold-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(--gold-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(76, 175, 80, 0.45);
  background: rgba(76, 175, 80, 0.12);
}

.whatsapp-sla-pill.warning,
.whatsapp-sla-pill.waiting {
  color: var(--gold-hover);
  border-color: rgba(212, 175, 55, 0.52);
  background: rgba(212, 175, 55, 0.14);
}

.whatsapp-sla-pill.critical {
  color: var(--status-red);
  border-color: rgba(244, 67, 54, 0.55);
  background: rgba(244, 67, 54, 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(212, 175, 55, 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(212, 175, 55, 0.22);
  border-color: rgba(212, 175, 55, 0.6);
  color: var(--gold-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(212, 175, 55, 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(212, 175, 55, 0.42);
  background: #121212;
  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: #101010;
  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(212, 175, 55, 0.2);
  border-radius: 10px;
  background: rgba(212, 175, 55, 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(--gold-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(212, 175, 55, 0.2);
  border-radius: 10px;
  background: rgba(212, 175, 55, 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(212, 175, 55, 0.65);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 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(212, 175, 55, 0.28);
  border-radius: 10px;
  background: rgba(212, 175, 55, 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(102, 183, 217, 0.16);
  border: 1px solid rgba(102, 183, 217, 0.32);
  color: #9fd8ee;
  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(--gold);
}

.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(212, 175, 55, 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(212, 175, 55, 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;
  }

  .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;
  }

  .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(212, 175, 55, 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(212, 175, 55, 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(280px, 82vw);
      max-height: 110px;
  }

  .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;
  }
}
