:root {
    --primary-red: #dc3545;
    --secondary-red: #a52734;
    --accent-blue: #1e88e5;
    --accent-green: #43a047;
    --accent-orange: #ff9800;
    --bg-base: linear-gradient(135deg, #f6f8fc 0%, #e2eaf8 100%);
    --surface: #f8faff;
    --surface-strong: #ffffff;
    --surface-soft: #eef3fb;
    --bg-overlay: rgba(22, 28, 36, 0.72);
    --text-primary: #172b4d;
    --text-secondary: #5f6f8b;
    --text-muted: #7e8aa3;
    --sidebar-bg: linear-gradient(180deg, #1f2c35 0%, #25343d 100%);
    --sidebar-text: #e5f2ff;
    --sidebar-accent: #92cbff;
    --surface-border: #d7dce7;
    --toggle-bg: rgba(255, 255, 255, 0.92);
    --toggle-color: var(--text-primary);
    --shadow: 0 20px 60px rgba(16, 41, 73, 0.08);
    --shadow-soft: 0 12px 30px rgba(16, 41, 73, 0.06);
    --border-radius: 18px;
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    background: var(--bg-base);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(220, 53, 69, 0.08), transparent 24%),
                radial-gradient(circle at 80% 15%, rgba(30, 136, 229, 0.08), transparent 24%);
    pointer-events: none;
    z-index: -1;
}

body.theme-light {
    --bg-base: linear-gradient(135deg, #f6f8fc 0%, #e2eaf8 100%);
    --surface: #f8faff;
    --surface-strong: #ffffff;
    --surface-soft: #eef3fb;
    --text-primary: #172b4d;
    --text-secondary: #5f6f8b;
    --text-muted: #7e8aa3;
    --sidebar-bg: linear-gradient(180deg, #1f2c35 0%, #25343d 100%);
    --sidebar-text: #e5f2ff;
    --sidebar-accent: #92cbff;
    --surface-border: #d7dce7;
    --toggle-bg: rgba(255, 255, 255, 0.92);
    --toggle-color: var(--text-primary);
}

body.theme-dark {
    --bg-base: linear-gradient(135deg, #2a0c10 0%, #3c0f14 100%);
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --text-primary: #f5e9e9;
    --text-secondary: #f3d2d2;
    --text-muted: #d7b8b8;
    --sidebar-bg: linear-gradient(180deg, #400a0f 0%, #5c0d16 100%);
    --sidebar-text: #ffe8e8;
    --sidebar-accent: #ff9a9a;
    --surface-border: rgba(255, 255, 255, 0.18);
    --toggle-bg: rgba(255, 255, 255, 0.14);
    --toggle-color: #f8f0f0;
}

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

button {
    border: none;
    background: none;
}

img {
    display: block;
    max-width: 100%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 45%, rgba(255,255,255,0.14) 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
    z-index: 999;
    backdrop-filter: blur(20px);
}

.theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 999px;
    background: var(--toggle-bg);
    color: var(--toggle-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 18px 32px rgba(16, 41, 73, 0.16);
    cursor: pointer;
    font-size: 0.95rem;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.24);
}

.theme-toggle i {
    width: 20px;
    text-align: center;
}

.auth-card {
    width: min(100%, 460px);
    max-width: 450px;
    background: var(--surface-strong);
    border-radius: var(--border-radius);
    padding: 3.5rem 3rem;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: visible;
    animation: fadeInUp 0.42s ease;
    backdrop-filter: blur(20px);
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
    transition: var(--transition);
}

.auth-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 90px rgba(0, 0, 0, 0.28);
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.06), transparent 35%, rgba(30, 136, 229, 0.05));
    pointer-events: none;
}

.auth-header {
    position: relative;
    z-index: 1;
    margin-bottom: 1.75rem;
}

.logo-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-blue));
    display: grid;
    place-items: center;
    box-shadow: 0 18px 42px rgba(16, 41, 73, 0.16);
}

.logo-container i {
    color: white;
    font-size: 2.3rem;
}

.auth-header h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(2rem, 3vw, 2.4rem);
    text-align: center;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary-red), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    margin: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--accent-blue);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: inset 0 1px 1px rgba(16, 41, 73, 0.04);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(220, 53, 69, 0.45);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.08);
    background: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9aa7c1;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 46px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px;
    color: var(--accent-blue);
    cursor: pointer;
    border-radius: 12px;
}

.toggle-password:hover {
    color: var(--primary-red);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.checkbox-container input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-red);
}

.error-message {
    color: var(--primary-red);
    font-size: 0.88rem;
    line-height: 1.3;
    min-height: 1.1rem;
}

button,
.btn,
.auth-btn,
.btn-forgot-password,
.btn-back-login,
.btn-save-notas,
.btn-clear-notas,
.btn-add-dietista {
    transition: var(--transition);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    box-shadow: 0 18px 32px rgba(220, 53, 69, 0.28);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(220, 53, 69, 0.32);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-forgot-password,
.btn-back-login {
    width: 100%;
    padding: 14px 16px;
    font-weight: 600;
}

.btn-forgot-password {
    border: 1px solid rgba(220, 53, 69, 0.18);
    color: var(--primary-red);
    background: rgba(220, 53, 69, 0.08);
}

.btn-forgot-password:hover {
    background: rgba(220, 53, 69, 0.16);
}

.btn-back-login {
    color: white;
    background: #546e7a;
}

.btn-back-login:hover {
    background: #455a64;
}

.auth-footer {
    margin-top: 2rem;
    padding-top: 1.8rem;
    border-top: 1px solid #e9edf5;
}

.auth-footer p {
    margin: 0 0 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.feature {
    padding: 1rem 0.95rem;
    background: var(--surface);
    border-radius: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.feature i {
    font-size: 1.35rem;
    color: var(--accent-blue);
}

.feature span {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.feature:hover {
    background: white;
    box-shadow: var(--shadow-soft);
}

.auth-links {
    margin-top: 1.5rem;
}

#main-app,
#main-app-nutricionista {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 280px;
    padding: 2rem 1.4rem;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 6px 0 32px rgba(16, 41, 73, 0.15);
}

.sidebar h2 {
    margin: 0;
    text-align: center;
    font-size: 1.45rem;
    color: var(--sidebar-accent);
    letter-spacing: 0.02em;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-grow: 1;
}

.sidebar li {
    padding: 1rem 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    cursor: pointer;
    color: var(--sidebar-text);
    transition: var(--transition);
}

.sidebar li:hover,
.sidebar li.active {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

.sidebar li i {
    width: 24px;
    display: inline-flex;
    justify-content: center;
    color: var(--sidebar-accent);
}

.logout-btn {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffb3b3;
}

.date-display {
    padding: 1rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ebf4ff;
    position: relative;
    text-align: center;
    font-size: 0.94rem;
}

.date-display::before {
    content: '📅';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

.content {
    flex-grow: 1;
    padding: 2.5rem 2.2rem;
    background: var(--bg-surface);
}

.app-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
}

.section-header h1 {
    margin: 0;
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h1 i {
    color: var(--primary-red);
    font-size: 1.4rem;
}

.section-header p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* Painel Nutricionista - Organização e Estilo */
.app-section {
    margin-bottom: 3rem;
}

.app-section:last-child {
    margin-bottom: 0;
}

/* Dashboard Nutricionista */
#dashboard-nutricionista .section-header {
    margin-bottom: 2rem;
}

/* Totais Nutricionista */
#totais-nutricionista .section-header {
    margin-bottom: 2rem;
}

/* Bloco de Notas */
#bloco-notas .section-header {
    margin-bottom: 2rem;
}

/* Dietistas */
#dietistas .section-header {
    margin-bottom: 2rem;
}

/* Salas SENAI */
#salas-senai .section-header {
    margin-bottom: 2rem;
}

/* Cards de Entrada de Alunos - Professor */
#class-container {
    margin: 2rem 0;
}

.class-group {
    margin-bottom: 2.5rem;
}

.class-group h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-note {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.class-group h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #c62828, #b71c1c);
    border-radius: 2px;
}

.grid-classes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.class-item {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.class-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #c62828, #e53935, #c62828);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.class-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(198, 40, 40, 0.15);
    border-color: rgba(198, 40, 40, 0.3);
}

.class-item:hover::before {
    opacity: 1;
}

.class-item label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.class-item label::before {
    content: '👥';
    font-size: 1.2rem;
}

.class-item input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--surface-border);
    border-radius: 16px;
    background: var(--surface-strong);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    outline: none;
}

.class-item input:focus {
    border-color: #c62828;
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
    background: var(--surface);
}

.class-item input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

.class-item input:not(:placeholder-shown) {
    background: rgba(198, 40, 40, 0.05);
    border-color: rgba(198, 40, 40, 0.4);
}

/* Responsividade para os cards */
@media (max-width: 768px) {
    .grid-classes {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .class-item {
        padding: 1.25rem;
    }

    .class-item input {
        font-size: 1.1rem;
        padding: 12px 16px;
    }
}

.total-card {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: white;
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(198, 40, 40, 0.25);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.total-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.total-card h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.02em;
    opacity: 0.9;
}

.total-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    margin-top: 1.5rem;
}

.total-display span {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
}

.sync-indicator {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.2rem;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.total-card h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.total-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    margin-top: 1.5rem;
}

.total-display span {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 800;
}

.sync-indicator {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    color: white;
}

.actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0 2rem;
}

.actions button {
    padding: 18px 24px;
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 8px 24px rgba(198, 40, 40, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.actions button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.actions button:hover::before {
    left: 100%;
}

.actions button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(198, 40, 40, 0.35);
    opacity: 0.95;
}

.actions button:active {
    transform: translateY(-1px);
}

.actions button.btn-save {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    box-shadow: 0 8px 24px rgba(46, 125, 50, 0.25);
}

.actions button.btn-save:hover {
    box-shadow: 0 12px 32px rgba(46, 125, 50, 0.35);
}

.output-box {
    background: var(--surface-strong);
    border-radius: 24px;
    padding: 1.75rem;
    border: 1px solid #dde4ef;
    box-shadow: var(--shadow-soft);
    color: var(--text-primary);
    min-height: 160px;
    white-space: pre-wrap;
}

.chart-container,
.quick-stats,
.history-section,
.profile-card,
.dashboard-overview,
.salas-senai-grid,
.totais-grid,
.bloco-notas-container,
.dietistas-container {
    background: var(--bg-surface-strong);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-container h3,
.quick-stats h3,
.history-header h3,
.dietistas-container h3,
.profile-card h3,
.sala-card h4,
.overview-card h3,
.total-card-nutri h3 {
    margin: 0;
    color: var(--text-primary);
}

.chart-wrapper {
    min-height: 320px;
    background: var(--surface);
    border-radius: 22px;
    border: 1px solid var(--surface-border);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend,
.quick-stats,
.history-controls,
.notas-actions,
.dietistas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-legend {
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.quick-stats {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 22px;
    padding: 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    min-height: 120px;
}

.stat-card i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(198, 40, 40, 0.14);
    color: var(--primary-red);
}

.stat-card h3 {
    margin: 0;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.stat-card p {
    margin: 0;
    font-size: 1.6rem;
    color: var(--text-primary);
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.history-table {
    margin-top: 1.5rem;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #e6ebf5;
}

.table-body {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 0;
    background: var(--surface-strong);
}

.history-item {
    display: grid;
    grid-template-columns: 1.2fr 0.9fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--surface-border);
}

.history-item .date,
.history-item .count {
    color: var(--text-primary);
    font-weight: 600;
}

.history-item .actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.btn-edit,
.btn-delete {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-edit {
    background: rgba(198, 40, 40, 0.12);
    color: var(--primary-red);
}

.btn-delete {
    background: rgba(33, 37, 41, 0.08);
    color: var(--text-primary);
}

.btn-edit:hover,
.btn-delete:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.stat-item {
    flex: 1 1 170px;
    background: var(--surface);
    border-radius: 20px;
    padding: 1rem 1.15rem;
    min-width: 160px;
}

.stat-item span {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 0.55rem;
}

.stat-item strong {
    display: block;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.history-section {
    margin-top: 2rem;
}

.history-header {
    align-items: center;
    justify-content: space-between;
}

.history-controls {
    align-items: flex-end;
    gap: 0.75rem;
}

.history-controls input,
.history-controls select {
    min-width: 220px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-primary);
}

.history-table {
    margin-top: 1.5rem;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #e6ebf5;
}

.table-header,
.table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.9fr;
    gap: 1rem;
    padding: 1rem 1.25rem;
    align-items: center;
}

.table-header {
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 700;
}

.table-row {
    background: var(--surface-strong);
    border-top: 1px solid #eef2f7;
}

.table-row:nth-child(even) {
    background: var(--surface);
}

.table-row button {
    padding: 0.75rem 1rem;
    border-radius: 14px;
    background: #1976d2;
    color: white;
    font-size: 0.92rem;
}

.table-row button:hover {
    opacity: 0.95;
}

.profile-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.75rem;
}

.profile-picture-section {
    padding: 1.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 100%);
    border-radius: 24px;
    text-align: center;
}

.profile-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.9);
    margin: 0 auto 1.25rem;
}

.profile-picture-controls button {
    width: 100%;
    padding: 12px 14px;
    background: #1976d2;
    color: white;
    border-radius: 14px;
}

.profile-info {
    display: grid;
    gap: 1rem;
}

.profile-info p {
    margin: 0;
    color: var(--text-secondary);
}

.profile-info strong {
    color: var(--text-primary);
}

.dashboard-overview,
.totais-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.overview-card,
.total-card-nutri {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 1.75rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: center;
    min-height: 140px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.overview-card:hover,
.total-card-nutri:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(198, 40, 40, 0.15);
}

.overview-card i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(198, 40, 40, 0.14);
    color: var(--primary-red);
    font-size: 1.4rem;
}

.overview-card h3 {
    margin: 0;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.overview-card p {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-primary);
    font-weight: 700;
}

.total-card-nutri {
    text-align: center;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.total-card-nutri h3 {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
}

.total-value {
    font-size: 2.2rem;
    color: var(--primary-red);
    font-weight: 700;
}

.salas-senai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.sala-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sala-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(198, 40, 40, 0.15);
}

.sala-card i {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(198, 40, 40, 0.14);
    color: var(--primary-red);
    font-size: 1.6rem;
    margin: 0 auto 1rem;
}

.sala-card h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-weight: 700;
}

.sala-card .alunos-count {
    font-size: 1.8rem;
    color: var(--primary-red);
    font-weight: 700;
    margin: 0;
}

.bloco-notas-container {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.notas-editor,
.notas-history {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 1.75rem;
    box-shadow: var(--shadow-soft);
}

.notas-history {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notas-history-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.notas-history-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.notas-history-header p {
    margin: 0.5rem 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.notas-history-list {
    display: grid;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.nota-entry {
    background: var(--bg-surface-strong);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 1rem 1.15rem;
    display: grid;
    gap: 0.75rem;
}

.nota-entry-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.nota-entry-header span {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.nota-entry-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nota-entry-actions button {
    border: none;
    border-radius: 14px;
    padding: 0.55rem 0.85rem;
    background: rgba(198, 40, 40, 0.1);
    color: var(--primary-red);
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.nota-entry-actions button:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.nota-preview {
    white-space: pre-wrap;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 160px;
    overflow: hidden;
}

.history-empty {
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.6;
    padding: 1rem;
}

#notas-textarea {
    width: 100%;
    min-height: 400px;
    padding: 1.5rem;
    border-radius: 22px;
    border: 1px solid var(--surface-border);
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#notas-textarea:focus {
    outline: none;
    border-color: rgba(198, 40, 40, 0.4);
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
}

#notas-textarea::placeholder {
    color: var(--text-secondary);
}

.notas-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-save-notas,
.btn-clear-notas {
    padding: 14px 20px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-save-notas {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.btn-clear-notas {
    background: linear-gradient(135deg, #f44336, #c62828);
}

.btn-save-notas:hover,
.btn-clear-notas:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.btn-add-dietista {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-green));
}

.dietistas-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

.dietista-form,
.dietistas-list {
    background: var(--surface);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-soft);
}

.dietista-form h3,
.dietistas-list h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dietista-form h3 i,
.dietistas-list h3 i {
    color: var(--primary-red);
}

.dietista-form form {
    display: grid;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group label i {
    color: var(--primary-red);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--surface-strong);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(198, 40, 40, 0.4);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-add-dietista {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, #c62828, #b71c1c);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-dietista:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.dietistas-list {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.dietistas-list #dietistas-list-container {
    flex: 1;
    display: grid;
    gap: 1rem;
}

.foto-preview {
    min-height: 140px;
    border: 2px dashed var(--surface-border);
    border-radius: 18px;
    padding: 1rem;
    background: var(--surface-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .dietistas-container,
    .profile-card,
    .section-header,
    .history-controls,
    .chart-legend,
    .quick-stats,
    .bloco-notas-container {
        grid-template-columns: 1fr;
    }

    .dietistas-container,
    .profile-card,
    .bloco-notas-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 940px) {
    .content {
        padding: 1.8rem 1.2rem;
    }

    .sidebar {
        width: 100%;
        position: relative;
        box-shadow: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 1rem;
        gap: 0.9rem;
    }

    .sidebar ul {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.65rem;
    }

    .sidebar li {
        flex: 1 1 150px;
        justify-content: center;
        text-align: center;
    }

    .date-display {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .auth-card {
        padding: 1.8rem 1.4rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        flex-direction: column;
    }

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