/* =========================
   RESET / BASE
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #eef2f7;
    color: #1f2937;
}

a {
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* =========================
   LAYOUT GERAL
========================= */

.app-shell,
.app-container {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

/* =========================
   SIDEBAR MODERNA
========================= */

.sidebar-modern {
    width: 290px;
    min-height: 100vh;
    padding: 22px 18px;
    background: linear-gradient(180deg, var(--sidebar-secondary, #111827) 0%, #0b1220 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.14);
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.sidebar-modern__top {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-modern__brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
}

.sidebar-modern__logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--sidebar-primary, #2563eb) 0%, rgba(255, 255, 255, 0.18) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.sidebar-modern__brand-text h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
    color: #fff;
}

.sidebar-modern__brand-text p {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.4;
}

.sidebar-modern__user-box {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-modern__user-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.56);
    margin-bottom: 6px;
}

.sidebar-modern__user-name {
    display: block;
    font-size: 14px;
    color: #fff;
    line-height: 1.4;
}

.sidebar-modern__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 22px 0;
}

.sidebar-modern__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.82);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-modern__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-modern__link.is-active {
    background: linear-gradient(135deg, var(--sidebar-primary, #2563eb) 0%, rgba(255, 255, 255, 0.22) 100%);
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
}

.sidebar-modern__icon {
    width: 22px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-modern__label {
    font-size: 14px;
    font-weight: 600;
}

.sidebar-modern__footer {
    padding-top: 8px;
}

.sidebar-modern__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.sidebar-modern__logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* =========================
   TOPO / BANNERS
========================= */

.top-banner {
    background: linear-gradient(135deg, #111827, #334155);
    color: #fff;
    padding: 28px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.gym-banner {
    background: linear-gradient(135deg, #be123c, #7f1d1d);
}

.top-banner h1 {
    font-size: 30px;
    margin-bottom: 8px;
}

.top-banner p {
    color: #e5e7eb;
    max-width: 700px;
}

/* =========================
   CARDS / BOXES
========================= */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.card-label {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
}

.card h3 {
    font-size: 28px;
    margin-bottom: 6px;
    color: #0f172a;
}

.card p {
    color: #6b7280;
    font-size: 14px;
}

.content-box {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-header h2 {
    font-size: 22px;
    color: #0f172a;
}

/* =========================
   BOTÕES
========================= */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: bold;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    color: #111827;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: bold;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #d1d5db;
    color: #111827;
}

.small {
    padding: 10px 14px;
    font-size: 13px;
}

.full {
    width: 100%;
}

/* =========================
   ACADEMIAS
========================= */

.academy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.academy-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
}

.academy-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.academy-logo {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.red {
    background: #e11d48;
}

.blue {
    background: #2563eb;
}

.academy-header h3 {
    color: #0f172a;
}

.academy-header p {
    color: #6b7280;
    font-size: 14px;
}

.academy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.academy-stats div {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px;
}

.academy-stats strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    color: #0f172a;
}

.academy-stats span {
    color: #6b7280;
    font-size: 13px;
}

.academy-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   PLANOS
========================= */

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.plan-card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    background: #fff;
}

.plan-card h3 {
    margin-bottom: 10px;
    color: #0f172a;
}

.price {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #0f172a;
}

.tag {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    margin-bottom: 18px;
}

.plan-details {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}

.plan-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
    flex-wrap: wrap;
}

/* =========================
   TABELA
========================= */

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

thead {
    background: #f9fafb;
}

th,
td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

th {
    font-size: 14px;
    color: #6b7280;
}

td {
    color: #111827;
}

.status {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.status.ok {
    background: #dcfce7;
    color: #166534;
}

.status.warning {
    background: #fef3c7;
    color: #92400e;
}

.status.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.text-warning {
    color: #b45309;
}

.actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* =========================
   FILTROS
========================= */

.students-header {
    gap: 16px;
    flex-wrap: wrap;
}

.students-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input-search,
.input-select {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

.input-search {
    min-width: 240px;
}

.input-select {
    min-width: 190px;
}

/* =========================
   PORTAL
========================= */

.portal-page {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #1d4ed8, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.portal-card {
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.portal-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #2563eb;
    color: #fff;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-brand h1 {
    color: #0f172a;
}

.portal-brand p {
    color: #6b7280;
    margin-top: 4px;
}

.portal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.portal-form label {
    font-weight: bold;
    color: #111827;
}

.portal-form input {
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
}

.portal-info {
    background: #f9fafb;
    border-radius: 16px;
    padding: 18px;
}

.portal-info h3 {
    margin-bottom: 10px;
    color: #0f172a;
}

.portal-info ul {
    padding-left: 18px;
    color: #4b5563;
}

.portal-info li {
    margin-bottom: 8px;
}

.portal-shell {
    min-height: 100vh;
    background: #f3f6fb;
    padding: 30px;
    width: 100%;
}

.portal-topbar {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.portal-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.small-logo {
    width: 48px;
    height: 48px;
    font-size: 16px;
    border-radius: 14px;
}

.portal-topbar h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: #0f172a;
}

.portal-topbar p {
    color: #6b7280;
    font-size: 14px;
}

.portal-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.portal-user {
    font-size: 14px;
    color: #4b5563;
}

.portal-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.portal-grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.invoice-highlight {
    background: #f9fafb;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
}

.invoice-highlight-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-highlight-row:last-child {
    border-bottom: none;
}

.invoice-highlight-row span {
    color: #6b7280;
}

.portal-payment-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.payment-option {
    display: block;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    color: #111827;
    transition: 0.2s;
}

.payment-option:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
}

.payment-option h3 {
    margin-bottom: 8px;
    font-size: 17px;
    color: #0f172a;
}

.payment-option p {
    color: #6b7280;
    font-size: 14px;
}

.portal-data-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portal-data-item {
    background: #f9fafb;
    border-radius: 16px;
    padding: 16px;
}

.portal-data-item span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 6px;
}

.payment-boxes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.payment-box {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    background: #fff;
}

.active-box {
    border-color: #2563eb;
    background: #eff6ff;
}

.payment-box h3 {
    margin-bottom: 8px;
    color: #0f172a;
}

.payment-box p {
    color: #6b7280;
    margin-bottom: 14px;
}

.pix-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pix-qrcode {
    height: 180px;
    border-radius: 16px;
    border: 2px dashed #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #6b7280;
    font-weight: bold;
}

.pix-area input {
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    background: #fff;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    font-size: 14px;
    color: #111827;
}

.form-group input {
    height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.checkbox-group label {
    font-size: 14px;
    color: #374151;
}

.payment-actions-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* =========================
   FORMULÁRIOS GYM
========================= */

.form-box {
    max-width: 1100px;
}

.gym-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.gym-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gym-form .form-group label {
    font-size: 14px;
    font-weight: bold;
    color: #111827;
}

.gym-form .form-group input,
.gym-form .form-group select,
.gym-form .form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

.gym-form .form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #374151;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.details-text {
    color: #4b5563;
    line-height: 1.7;
    font-size: 15px;
}

/* =========================
   EMAIL / ALERTAS
========================= */

.email-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-preview-label {
    font-size: 13px;
    font-weight: bold;
    color: #6b7280;
}

.email-preview-box,
.email-preview-body {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    color: #111827;
}

.email-preview-body {
    line-height: 1.7;
}

.email-preview-body p {
    margin-bottom: 10px;
}

.email-preview-body p:last-child {
    margin-bottom: 0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 1100px) {
    .cards-grid,
    .academy-grid,
    .plan-grid,
    .portal-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-grid-2,
    .portal-payment-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-shell,
    .app-container {
        flex-direction: column;
    }

    .sidebar-modern {
        width: 100%;
        min-height: auto;
        position: relative;
        border-radius: 0 0 22px 22px;
    }

    .main-content {
        padding: 18px;
    }
}

@media (max-width: 900px) {
    .form-grid,
    .details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .cards-grid,
    .academy-grid,
    .plan-grid,
    .portal-summary-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .portal-shell {
        padding: 16px;
    }

    .portal-topbar,
    .top-banner,
    .section-header,
    .academy-actions,
    .plan-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}