* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    margin: 0;
    color: #1f2933;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 24px;
}

.card h1,
.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.grid-2 {
    grid-column: span 2;
}

.grid-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.divider {
    width: 100%;
    height: 1px;
    border: none;
    background: #e2e8f0;
    grid-column: 1 / -1;
    margin: 8px 0;
}

.field-tip {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.checkbox-line input {
    width: auto;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.input-with-icon .icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: #64748b;
}

.input-with-icon input {
    width: 100%;
    padding-left: 34px;
}

.exercises-container {
    margin: 16px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    background: #f8fafc;
}

.exercises-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.exercises-header label {
    margin: 0;
    font-weight: 600;
}

.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exercise-row {
    display: flex;
    gap: 8px;
}

.exercise-row input,
.exercise-row textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.exercise-row textarea {
    min-height: 60px;
    line-height: 1.5;
}

.exercise-row button {
    background: #dc2626;
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
}

.exercise-row button:hover {
    background: #b91c1c;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-neutral {
    background: #e2e8f0;
    color: #1f2937;
}

.mini-alert {
    margin-top: 6px;
    font-size: 12px;
    color: #b91c1c;
}

.lista-exercicios {
    list-style: disc;
    margin: 0;
    padding-left: 18px;
}

.checklist {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.body-landing {
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
}

.landing-header {
    background: transparent;
    padding: 20px 0;
}

.landing-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand small {
    color: #64748b;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

.landing-main {
    padding: 32px 0 64px;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.landing-hero {
    background: linear-gradient(160deg, #1d4ed8 0%, #2563eb 80%);
    color: #fff;
}

.landing-hero p,
.landing-hero li,
.landing-hero span {
    color: rgba(255, 255, 255, 0.88);
}

.benefits {
    list-style: none;
    padding: 0;
    margin: 16px 0 24px;
}

.benefits li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
}

.benefits li::before {
    content: '✔';
    position: absolute;
    left: 0;
    top: 0;
    color: #22c55e;
    font-weight: bold;
}

.highlight-box {
    background: rgba(15, 23, 42, 0.25);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.highlight-box strong {
    font-size: 18px;
}

.landing-form {
    background: #fff;
}

.landing-form .subtitle {
    margin-top: -8px;
    color: #64748b;
}

.landing-footer {
    padding: 24px 0;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.login-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.login-card {
    background: #fff;
}

.login-aside {
    background: #0f172a;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.login-aside p,
.login-aside li {
    color: rgba(255, 255, 255, 0.85);
}

.login-aside .btn {
    align-self: flex-start;
    background: #22c55e;
}

.login-aside .btn:hover {
    background: #16a34a;
}

.landing-footer .container {
    display: flex;
    justify-content: center;
}
form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    margin-bottom: 12px;
    background: #f8fafc;
}

form textarea {
    min-height: 100px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s linear;
}

.btn.secondary {
    background: #475569;
}

.btn:hover {
    background: #1d4ed8;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}

table th {
    background: #f1f5f9;
    font-weight: 600;
}

table td:last-child {
    white-space: normal;
    width: auto;
}

table td.actions-cell {
    white-space: normal !important;
    width: auto !important;
    min-width: 400px !important;
    padding: 12px !important;
    vertical-align: middle !important;
}

/* Alinhamento dos botões como no sistema que funciona (d-flex gap-2) */
table td .actions-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
    /* justify-content removido - será controlado pelo seletor específico */
    width: 100% !important;
}

table td .action-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

table td .actions-buttons .btn,
table td .actions-buttons button,
table td .actions-buttons a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

table td .actions-buttons .btn-primary {
    background: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(59,130,246,0.3) !important;
}

table td .actions-buttons .btn-secondary {
    background: #1e293b !important;
    color: white !important;
}

table td .actions-buttons .btn-danger {
    background: #dc2626 !important;
    color: white !important;
}

table td .actions-buttons .btn:hover {
    opacity: 0.9;
    text-decoration: none !important;
}

table td .btn {
    white-space: nowrap;
    margin: 0;
    display: inline-block;
}

table td form {
    display: inline-block;
    margin: 0;
}

.header {
    background: #111827;
    color: #ffffff;
    padding: 16px;
}

.header nav a {
    margin-right: 16px;
    color: #94a3b8;
    font-weight: 600;
}

.header nav a.active,
.header nav a:hover {
    color: #ffffff;
}

.day-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.day-selector button {
    flex: 1 0 120px;
}

@media (max-width: 640px) {
    .card {
        padding: 16px;
    }

    table th,
    table td {
        padding: 8px;
    }

    .grid-2 {
        grid-column: span 1;
    }

    .exercise-row {
        flex-direction: column;
    }

    .exercise-row button {
        width: 100%;
    }
    
    table td.actions-cell {
        min-width: 100% !important;
    }
    
    table td.actions-cell .actions-buttons {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    table td.actions-cell .actions-buttons .btn,
    table td.actions-cell .actions-buttons button,
    table td.actions-cell .actions-buttons a {
        width: 100% !important;
    }
}

/* CORREÇÃO ESPECÍFICA PARA BOTÕES DE AÇÃO - Máxima prioridade */
table td.actions-cell {
    white-space: normal !important;
    width: auto !important;
    min-width: 450px !important;
    max-width: none !important;
    padding: 12px !important;
    vertical-align: middle !important;
    text-align: right !important;
}

table td.actions-cell > .actions-buttons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

table td.actions-cell .action-form {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

table td.actions-cell .actions-buttons button,
table td.actions-cell .actions-buttons .btn,
table td.actions-cell .actions-buttons a,
table td.actions-cell .actions-buttons form button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    height: auto !important;
}

table td.actions-cell .actions-buttons .btn-primary,
table td.actions-cell .actions-buttons button.btn-primary {
    background: #3b82f6 !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(59,130,246,0.3) !important;
}

table td.actions-cell .actions-buttons .btn-secondary,
table td.actions-cell .actions-buttons button.btn-secondary,
table td.actions-cell .actions-buttons a.btn-secondary:not(.btn-danger) {
    background: #1e293b !important;
    color: white !important;
}

table td.actions-cell .actions-buttons .btn-danger,
table td.actions-cell .actions-buttons a.btn-danger {
    background: #dc2626 !important;
    color: white !important;
}

/* Melhorias para páginas do painel admin */
table {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

table thead th {
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 16px 12px;
}

table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:hover {
    background-color: #f8fafc;
}

table tbody tr:last-child td {
    border-bottom: none;
}

table tbody td {
    color: #334155;
    font-size: 14px;
}

/* Melhorias no header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.header nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header nav a {
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 14px;
}

.header nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.header nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Melhorias nos cards */
.card {
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.card h2 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* Melhorias nos formulários */
label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: block;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Melhorias nos botões */
.btn {
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn.secondary {
    background: #64748b;
}

.btn.secondary:hover {
    background: #475569;
}

/* Melhorias nas mensagens de alerta */
.alert {
    border-left: 4px solid;
    font-weight: 500;
}

.alert.success {
    border-left-color: #10b981;
}

.alert.error {
    border-left-color: #ef4444;
}

/* Espaçamento melhorado */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.page-header p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

/* Melhorias na tabela de alunos */
table tbody tr.empty-row td {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-style: italic;
}

/* Badge de status */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Melhorias adicionais */
.page-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.page-header p {
    color: #64748b;
    margin: 0;
    font-size: 14px;
}

/* Melhorias nos formulários em grid */
.grid label {
    margin-bottom: 8px;
}

.grid input[type="text"],
.grid input[type="email"],
.grid input[type="password"],
.grid input[type="date"],
.grid input[type="time"],
.grid input[type="number"],
.grid select,
.grid textarea {
    margin-bottom: 0;
}

/* Melhorias na lista de exercícios */
.lista-exercicios {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.lista-exercicios li {
    margin-bottom: 4px;
}

/* Melhorias no header - logo e nome */
.header .container > div:first-child {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header .container > div:first-child img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header .container > div:first-child > div strong {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.header .container > div:first-child > div > div {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* Melhorias nos cards com grid */
.card .grid {
    margin-top: 20px;
}

/* Melhorias nos botões de ação inline */
.actions-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Melhorias no campo de busca */
input[type="text"][name="search"],
input[type="text"][placeholder*="Buscar"] {
    flex: 1;
    max-width: 400px;
}

/* Melhorias nas seções de preview */
.card[style*="margin-top"] {
    border-top: 3px solid #667eea;
}

/* Melhorias nas mensagens de status */
.status-info {
    padding: 12px;
    border-radius: 6px;
    background: #f1f5f9;
    border-left: 4px solid #64748b;
    margin-bottom: 16px;
}

.status-info strong {
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
}

.status-info span {
    color: #64748b;
    font-size: 13px;
}

