/* ============================================
   CAMILA CERQUEIRA STUDIO DE PILATES
   Design System & Global Styles
   ============================================ */

:root {
    /* Color Palette - V6 Refresh (Verde & Bege priority) */
    --primary: #999a85;
    /* Verde Principal */
    --primary-light: #b4b5a4;
    --primary-dark: #7d7e6a;
    --primary-bg: rgba(153, 154, 133, 0.08);

    --accent: #257ea9;
    /* Azul Accent */
    --accent-light: #5ba1c4;
    --accent-dark: #1b5e7e;

    --success: #5CB85C;
    --success-bg: rgba(92, 184, 92, 0.1);
    --success-light: #e8f5e9;
    --warning: #F0AD4E;
    --warning-bg: rgba(240, 173, 78, 0.1);
    --danger: #D9534F;
    --danger-bg: rgba(217, 83, 79, 0.1);

    --bg: #f5f5f5;
    /* Bege Background */
    --bg-card: #FFFFFF;
    --bg-sidebar: var(--primary);
    /* Verde Sidebar - V6 Refinement */
    --bg-sidebar-hover: #5d544c;
    --bg-input: #FFFFFF;

    --text: #4d443d;
    /* Darker Marrom for readability */
    --text-secondary: #766b61;
    /* Marrom for secondary text */
    --text-light: #B3A9AD;
    --text-sidebar: #ffffff;
    /* Pure white for maximum contrast */
    --text-sidebar-muted: rgba(255, 255, 255, 0.8);

    --border: #EDE8E5;
    --border-focus: var(--primary);

    --shadow-sm: 0 1px 3px rgba(118, 107, 97, 0.06);
    --shadow-md: 0 4px 12px rgba(118, 107, 97, 0.08);
    --shadow-lg: 0 8px 32px rgba(118, 107, 97, 0.12);
    --shadow-xl: 0 16px 48px rgba(118, 107, 97, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', 'Georgia', serif;
    line-height: 1.3;
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #766b61 0%, #999a85 40%, #257ea9 100%);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(183, 110, 121, 0.3), transparent 70%);
    top: -200px;
    right: -200px;
    animation: floatBubble 8s ease-in-out infinite;
}

.login-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201, 169, 110, 0.2), transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: floatBubble 10s ease-in-out infinite reverse;
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.05);
    }
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 180px;
    /* Much larger as requested */
    height: 180px;
    background: transparent;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: none;
}

.login-brand h1 {
    font-size: 1.6rem;
    color: var(--text);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    width: 24px;
    /* Fixed width */
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
    pointer-events: none;
    /* Icon shouldn't block clicks */
}

.input-wrapper input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 3.5rem !important;
    /* Forces 56px space for icons on left */
    background: var(--bg-input);
    border: 2px solid #ede8e5;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.input-wrapper input:focus+i,
.input-wrapper input:focus~i {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    right: 14px;
    left: auto !important;
    /* Ensures it stays on the right side */
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    z-index: 10;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all !important;
    /* Must be clickable */
}

.password-toggle:hover {
    color: var(--primary);
}

/* Tasks Page Enhancements */
.task-add-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.task-form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.task-form-row .input-wrapper {
    flex: 1;
}

.task-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.task-item.completed {
    border-left-color: var(--text-light);
    opacity: 0.7;
}

.task-content {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.task-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.task-title {
    font-weight: 600;
    color: var(--text);
}

.completed .task-title {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.task-date-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
}

.task-tag {
    font-size: 0.7rem;
    color: #fff;
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Page Layout Refinements */
#page-staff,
#page-reports {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    display: none;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
}

#page-staff.active,
#page-reports.active {
    display: flex;
}

#page-staff .page-header,
#page-reports .page-header {
    width: 100%;
    max-width: 800px;
}

#staff-list {
    width: 100%;
    max-width: 800px;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.staff-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    border: 1px solid var(--border);
}

.staff-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.staff-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.staff-info h4 {
    margin-bottom: 0.25rem;
    color: var(--primary-dark);
}

/* Modal Checkbox List */
.permission-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* Recovery Modal Specifics */
#recovery-overlay {
    z-index: 2000;
}

#recovery-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 400px;
}

/* Redesigned Staff Page */
.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.staff-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

/* ============================================
   REPORTS PAGE
   ============================================ */

.report-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.date-range-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-input);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.date-range-group input {
    border: none;
    background: transparent;
    padding: 0.25rem;
}

.report-selector-bar {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    align-items: flex-end;
}

.report-container {
    animation: fadeIn 0.3s ease;
}

.conversion-funnel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}

.funnel-step {
    display: grid;
    grid-template-columns: 120px 1fr 60px;
    align-items: center;
    gap: 1rem;
}

.funnel-step label {
    font-weight: 600;
    color: var(--text-secondary);
}

.funnel-bar {
    height: 12px;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.funnel-step span {
    font-weight: 800;
    text-align: right;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   CARDS
   ============================================ */
.staff-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.staff-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.staff-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.staff-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.staff-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.staff-badge.admin {
    background: var(--accent-light);
    color: #fff;
}

.staff-badge.colaborador {
    background: var(--primary-light);
    color: #fff;
}

.staff-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.staff-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

/* Redesigned Reports Page */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.report-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.report-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.report-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(183, 110, 121, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(183, 110, 121, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-input);
    color: var(--text);
}

.btn-ghost.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #1da851;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
}

.login-error {
    color: var(--danger);
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.login-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.78rem;
    margin-top: 1.5rem;
}

/* ============================================
   APP LAYOUT
   ============================================ */

.app {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand i {
    font-size: 1.4rem;
    color: var(--primary-light);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    width: 100%;
    text-align: left;
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar);
}

.nav-item.text-danger {
    color: var(--text-sidebar-muted) !important;
    font-weight: 500;
}

.nav-item.text-danger i {
    color: #ff8e8e !important;
}

.nav-item.text-danger:hover {
    background: #d9534f !important;
    color: white !important;
}

.nav-item.text-danger:hover i {
    color: white !important;
}

.nav-item.active {
    background: #5d544c !important; /* Marrom profundo */
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.nav-item.active i {
    color: white;
}

.nav-toggle {
    justify-content: space-between;
}

.nav-toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nav-group {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 0.75rem;
}

.nav-group.is-open {
    display: flex;
}

.nav-group .nav-item {
    font-size: 0.86rem;
}

.nav-group .nav-item i:first-child {
    font-size: 1rem;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
    transform: rotate(180deg);
}

.subtitle {
    color: var(--text-light);
    padding-top: 8px;
}
.badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.logout-btn {
    color: var(--text-sidebar-muted) !important;
}

.logout-btn:hover {
    background: rgba(217, 83, 79, 0.2) !important;
    color: #ff6b6b !important;
}

/* MOBILE HEADER */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-sidebar);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.mobile-brand i {
    color: var(--primary-light);
}

.menu-toggle {
    color: white;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg-sidebar-hover);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.8rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.header-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   METRICS / DASHBOARD
   ============================================ */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid transparent;
    cursor: pointer;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-students {
    border-left-color: var(--primary);
}

.metric-classes {
    border-left-color: var(--accent);
}

.metric-payments {
    border-left-color: var(--warning);
}

.metric-alerts {
    border-left-color: var(--danger);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.metric-students .metric-icon {
    background: var(--primary-bg);
    color: var(--primary);
}

.metric-classes .metric-icon {
    background: rgba(201, 169, 110, 0.1);
    color: var(--accent);
}

.metric-payments .metric-icon {
    background: var(--warning-bg);
    color: var(--warning);
}

.metric-alerts .metric-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.dashboard-grid-3,
.dashboard-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dashboard-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary);
    font-size: 0.9rem;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

/* ============================================
   SEARCH BAR
   ============================================ */

.search-bar {
    margin-bottom: 1.5rem;
}

.search-bar .input-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.search-bar .input-wrapper input {
    background: transparent;
    padding: 1rem 1rem 1rem 2.8rem;
    border: 2px solid transparent;
    font-size: 0.95rem;
}

.search-bar .input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.filter-tag {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--primary-bg);
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   STUDENTS GRID
   ============================================ */

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.student-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px solid transparent;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.student-card-photo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.4rem;
    overflow: hidden;
}

.student-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-card-info {
    flex: 1;
    min-width: 0;
}

.student-card-info h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-card-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.student-card-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.tag {
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--primary);
    color: #ffffff;
}

.student-card-status {
    flex-shrink: 0;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.warning {
    background: var(--warning);
}

.status-dot.overdue {
    background: var(--danger);
}

/* ============================================
   STUDENT DETAIL
   ============================================ */

.student-management-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.student-action-tools {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.student-action-panel[hidden] {
    display: none !important;
}

.table-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    min-width: 124px;
}

.table-action-button {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.table-action-button:hover {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.table-action-button.danger {
    color: var(--danger);
    border-color: rgba(217, 83, 79, 0.25);
}

.table-action-button.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

.student-detail-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.student-profile-card {
    padding: 2rem 1.5rem;
    text-align: center;
    position: sticky;
    top: 2rem;
}

.profile-photo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.profile-photo {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-input);
    border: 4px solid var(--primary-light);
}

.photo-upload-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 34px;
    height: 34px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.photo-upload-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.student-name-display {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.student-tags {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.student-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* TABS */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    background: transparent;
}

.tab:hover {
    color: var(--primary);
    background: var(--bg-input);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(183, 110, 121, 0.3);
}

.tab-content {
    display: none;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* FORMS */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ============================================
   EVOLUTION TIMELINE
   ============================================ */

.evolution-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.evolution-form-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px dashed var(--primary-light);
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.timeline-item:hover {
    background: var(--primary-bg);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
}

.timeline-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.timeline-note {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.timeline-actions button {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.timeline-actions button:hover {
    background: var(--bg-card);
    color: var(--primary);
}

/* ============================================
   TASKS KANBAN
   ============================================ */
.tasks-kanban-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

.task-column {
    min-height: 400px;
    background: var(--bg-card);
}

.task-column .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-item {
    background: var(--bg-body);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border);
    transition: var(--transition);
}

.task-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.task-item[draggable="true"] {
    cursor: grab;
}

.task-item.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.task-dropzone.is-drop-target {
    background: rgba(153, 154, 133, 0.08);
    border-radius: var(--radius-md);
}

.task-item.high-priority {
    border-left-color: var(--danger);
}

.task-item.upcoming {
    border-left-color: var(--primary);
}

.task-item.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

/* ============================================
   TIMELINE & ATTENDANCE
   ============================================ */

.attendance-checklist {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.attendance-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.attendance-item:hover {
    background: var(--primary-bg);
}

.attendance-item img,
.attendance-item .attendance-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.attendance-item label {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.attendance-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    flex-shrink: 0;
}

.attendance-toggle::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.attendance-toggle:checked {
    background: var(--success);
}

.attendance-toggle:checked::after {
    left: 25px;
}

.sessions-history {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-history-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.session-history-card:hover {
    box-shadow: var(--shadow-md);
}

.session-history-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    cursor: pointer;
}

.session-history-header h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.session-history-header span {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.session-history-body {
    padding: 1rem 1.25rem;
    display: none;
}

.session-history-body.open {
    display: block;
    animation: fadeIn 0.3s ease;
}

.session-detail-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

.session-detail-row strong {
    color: var(--primary);
    min-width: 100px;
}

.session-attendees {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.attendee-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
}

.attendee-badge.present {
    background: var(--success-bg);
    color: var(--success);
}

.attendee-badge.absent {
    background: var(--danger-bg);
    color: var(--danger);
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.session-mini-card {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-mini-card .session-mini-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
}

.session-mini-card .session-mini-status {
    font-size: 0.78rem;
}

/* ============================================
   PAYMENTS
   ============================================ */

.payments-summary {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 160px;
}

.summary-item i {
    font-size: 1.3rem;
}

.summary-item span {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

.summary-item label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.summary-active i {
    color: var(--success);
}

.summary-warning i {
    color: var(--warning);
}

.summary-overdue i {
    color: var(--danger);
}

.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table thead {
    background: var(--bg-input);
}

.payments-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payments-table td {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.payments-table tbody tr {
    transition: var(--transition);
}

.payments-table tbody tr:hover {
    background: var(--primary-bg);
}

.payment-status {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
}

.payment-status.active {
    background: var(--success-bg);
    color: var(--success);
}

.payment-status.warning {
    background: var(--warning-bg);
    color: #b8860b;
}

.payment-status.overdue {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ============================================
   ALERTS PAGE
   ============================================ */

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-left: 4px solid var(--warning);
    transition: var(--transition);
}

.alert-card:hover {
    box-shadow: var(--shadow-md);
}

.alert-card.urgent {
    border-left-color: var(--danger);
}

.alert-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-card.urgent .alert-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-info {
    flex: 1;
}

.alert-info h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

.alert-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.alert-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-size: 0.9rem;
}

.empty-state i {
    margin-left: 0.35rem;
}
/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 35, 40, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

/* ============================================
   TOAST
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-sidebar);
    color: white;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
    min-width: 280px;
    font-size: 0.88rem;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   DATA BACKUP SECTION
   ============================================ */

.backup-section {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============================================
   DASHBOARD ALERT ITEM
   ============================================ */

.dash-alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.dash-alert-item:last-child {
    border-bottom: none;
}

.dash-alert-item .alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-alert-item .alert-dot.warning {
    background: var(--warning);
}

.dash-alert-item .alert-dot.danger {
    background: var(--danger);
}

.dash-alert-item span {
    font-size: 0.88rem;
    flex: 1;
}

.dash-alert-item small {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Dashboard recent student mini */
.recent-student-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.recent-student-item:last-child {
    border-bottom: none;
}

.recent-student-item .mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.85rem;
    flex-shrink: 0;
    overflow: hidden;
}

.recent-student-item .mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-student-item span {
    font-size: 0.88rem;
    font-weight: 500;
}

/* Media queries moved to end of file for consolidation */


/* ============================================
   ADMIN ACCESS CONTROL
   ============================================ */
.admin-only {
    display: none !important;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

body.is-admin .admin-only {
    display: inline-flex !important;
    opacity: 1;
}

body.is-admin button.admin-only, 
body.is-admin div.admin-only,
body.is-admin a.admin-only {
    display: block !important;
    opacity: 1;
}

body.is-admin .btn.admin-only {
    display: inline-flex !important;
    opacity: 1;
}

/* Status Badges Colors for Turmas & List */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge-presente {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
}

.status-badge-falta {
    background: #ffebee !important;
    color: #c62828 !important;
}

.status-badge.overdue {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca !important;
}

.status-badge.warning {
    background: #fef3c7 !important;
    color: #d97706 !important;
    border: 1px solid #fde68a !important;
}

.status-badge.active {
    background: #dcfce7 !important;
    color: #16a34a !important;
    border: 1px solid #bbfcce !important;
}

.status-badge.reposition {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border: 1px solid #bae6fd !important;
}

.makeup-count-badge {
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.25rem;
}

/* Mandatory Fields UI */
label.required::after {
    content: " *";
    color: #dc2626;
    font-weight: bold;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   CLASSES / TURMAS
   ============================================ */

.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.class-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border-top: 4px solid var(--primary);
}

.class-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.class-card.morning {
    border-top-color: var(--accent);
}

.class-card.evening {
    border-top-color: var(--primary);
}

.class-card-header {
    padding: 1.25rem 1.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.class-card-header h3 {
    font-size: 1.4rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.class-card-header h3 i {
    font-size: 1rem;
    color: var(--text-secondary);
}

.class-card-count {
    background: var(--primary-bg);
    color: var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.class-card.morning .class-card-count {
    background: rgba(201, 169, 110, 0.12);
    color: var(--accent);
}

.class-card-period {
    padding: 0 1.5rem 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.class-card-students {
    padding: 0.5rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.class-student-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
}

.class-student-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.class-student-item .mini-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.class-empty {
    padding: 1rem 1.5rem 1.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* ============================================
   ATTENDANCE JUSTIFIED
   ============================================ */

.attendance-item-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-wrap: wrap;
}

.attendance-item-wrapper:hover {
    background: var(--primary-bg);
}

.attendance-item-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.attendance-item-main label {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.justified-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-left: auto;
    padding: 0.25rem 0.65rem;
    background: rgba(201, 169, 110, 0.1);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.justified-toggle.visible {
    display: flex;
}

.justified-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.justified-toggle:hover {
    background: rgba(201, 169, 110, 0.2);
}

/* ============================================
   MAKEUP CLASSES
   ============================================ */

.makeup-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.makeup-item:last-child {
    border-bottom: none;
}

.makeup-info {
    flex: 1;
}

.makeup-info h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
}

.makeup-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.status-badge.warning,
.status-badge.pending {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.overdue,
.status-badge.danger {
    background: rgba(217, 83, 79, 0.1);
    color: var(--danger);
}

/* Status Tags for Attendance Reconstruction */
.status-tag {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.status-tag-presente {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-tag-presente:hover {
    background: #c8e6c9;
}

.status-tag-presente.active {
    background: #2e7d32;
    color: #ffffff;
}

.status-tag-falta {
    background: #ffebee;
    color: #c62828;
}

.status-tag-falta:hover {
    background: #ffcdd2;
}

.status-tag-falta.active {
    background: #c62828;
    color: #ffffff;
}

.status-tag-makeup {
    background: #fff3e0;
    color: #ef6c00;
}

.status-tag-makeup:hover {
    background: #ffe0b2;
}

.status-tag-makeup.active {
    background: #ef6c00;
    color: #ffffff;
}

.attendance-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.attendance-card-student {
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.attendance-status-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.attendance-status-stack .form-group {
    margin-bottom: 0.75rem;
}

.attendance-card-student:last-child {
    border-bottom: none;
}

.attendance-wide-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.attendance-entry-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.attendance-entry-card.is-present {
    border-color: rgba(92, 184, 92, 0.35);
}

.attendance-wide-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.8fr) minmax(180px, 1fr) minmax(110px, 0.5fr);
    gap: 1rem;
    align-items: center;
}

.attendance-wide-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.attendance-student-cell small,
.attendance-wide-cell small {
    color: var(--text-secondary);
}

.attendance-inline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.attendance-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    font-weight: 500;
}

.attendance-choice-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem;
    border: 1px solid #d9d4cf;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.attendance-choice-option {
    position: relative;
}

.attendance-choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.attendance-choice-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 36px;
    padding: 0 0.9rem;
    border-radius: 999px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.attendance-choice-option input:checked + span {
    background: var(--primary-bg);
    color: var(--primary-dark);
    box-shadow: inset 0 0 0 1px var(--primary-light);
}

.attendance-date-cell {
    justify-self: start;
}

.attendance-details-grid .attendance-wide-cell select,
.attendance-details-grid .attendance-wide-cell textarea {
    border: 1px solid #d9d4cf;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.attendance-details-grid .attendance-wide-cell select {
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 600;
    padding-right: 2.5rem;
}

.attendance-notes-cell textarea {
    width: 100%;
    min-height: 116px;
    padding: 0.9rem 1rem;
    line-height: 1.5;
    resize: vertical;
}

.attendance-wide-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    align-self: center;
}

.attendance-wide-actions .table-action-button.is-active {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.attendance-quick-present.is-active {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(92, 184, 92, 0.35);
}

.attendance-details-panel[hidden] {
    display: none !important;
}

.attendance-details-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.attendance-details-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(170px, 0.8fr) minmax(260px, 1.4fr);
    gap: 1rem;
}

.attendance-save-footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.attendance-save-summary {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.attendance-save-summary strong {
    font-size: 1.2rem;
    color: var(--text);
}

.attendance-footer-controls {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-size-select {
    min-width: 140px;
    min-height: 44px;
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    border: 1px solid #d9d4cf;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    color: var(--text);
}

.student-profile-edit-form {
    display: block;
}

.student-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.student-info-display {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.student-info-display label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    font-weight: 700;
}

.student-info-display > div {
    min-height: 48px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text);
    display: flex;
    align-items: center;
}

.student-rich-display {
    min-height: 96px !important;
    align-items: flex-start !important;
    white-space: pre-wrap;
    line-height: 1.5;
}

.student-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.student-checkbox-pill {
    position: relative;
}

.student-checkbox-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.student-checkbox-pill span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 1rem;
    border-radius: 999px;
    border: 1px solid #d9d4cf;
    background: #fff;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.student-checkbox-pill input:checked + span {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

.btn-schedule-makeup {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.btn-schedule-makeup:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.makeup-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.makeup-table th,
.makeup-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.makeup-table th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
}

.makeup-status-scheduled {
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.makeup-status-pending {
    background: #fff3e0;
    color: #ef6c00;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.tag-reposicao {
    background: #fff3e0;
    color: #ef6c00;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

/* ============================================
   FINANCE STYLES
   ============================================ */

.finance-mini-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.finance-item label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.finance-item span {
    font-weight: 700;
    font-size: 0.95rem;
}

.finance-item.income span {
    color: var(--success);
}

.finance-item.expense span {
    color: var(--danger);
}

.finance-item.balance {
    background: var(--primary-bg);
    color: var(--primary);
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
}

.finance-table th,
.finance-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.finance-table th {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.finance-table td {
    font-size: 0.9rem;
}

.finance-type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.finance-type-badge.income {
    background: rgba(90, 170, 105, 0.1);
    color: var(--success);
}

.finance-type-badge.expense {
    background: rgba(217, 83, 79, 0.1);
    color: var(--danger);
}

.metric-card.income {
    border-left-color: var(--success);
}

.metric-card.expense {
    border-left-color: var(--danger);
}

.metric-card.balance {
    border-left-color: var(--primary);
}

.metric-card.income .metric-icon {
    background: rgba(90, 170, 105, 0.1);
    color: var(--success);
}

.metric-card.expense .metric-icon {
    background: rgba(217, 83, 79, 0.1);
    color: var(--danger);
}

.metric-card.balance .metric-icon {
    background: var(--primary-bg);
    color: var(--primary);
}

/* ============================================
   TASK STYLES
   ============================================ */

.tasks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    font-size: 0.92rem;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-light);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--danger);
}

/* V6: Messaging & Recovery */
.btn-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    padding: 0;
}

.btn-icon-sm:hover {
    background: var(--bg-hover);
    transform: scale(1.1);
    border-color: #25d366;
}

.login-recovery-links a:hover {
    text-decoration: underline !important;
}

#recovery-modal .modal-content {
    border-top: 5px solid var(--primary);
}

/* Header Dashboard Filter Refinement (V6) */
.header-date-filter {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
}

.header-date-filter:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.header-date-filter input {
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.extra-student {
    border-left: 4px solid #257ea9 !important;
    background: rgba(37, 126, 169, 0.05);
}

.extra-student-option {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.extra-student-option:hover {
    background: var(--bg);
}

.evo-photo-preview {
    position: relative;
    display: inline-block;
}

.btn-remove-photo {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    font-size: 12px;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
}

/* Sidebar Brand Adjustment */
.sidebar-brand img {
    width: 44px !important;
    height: 44px !important;
}

.sidebar-brand span {
    font-size: 0.95rem !important;
    line-height: 1.1;
    white-space: normal !important;
    max-width: 140px;
}

/* Payment Filters */
.payments-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ============================================
   STATUS INATIVO
   ============================================ */
.status-dot.inactive { background: #9e9e9e; }
.status-badge.inactive { background: #f5f5f5 !important; color: #9e9e9e !important; border: 1px solid #e0e0e0 !important; }
.student-card.is-inactive { opacity: 0.6; }

/* ============================================
   CORREÇÃO CRÍTICA DE CLIQUES E LOGO MOBILE
   ============================================ */
/* Media query block removed here, consolidated at the end */


/* ============================================
   SISTEMA DE TAGS INTERATIVAS
   ============================================ */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid #ccc;
    border-radius: var(--radius-sm);
    min-height: 46px;
    align-items: center;
    transition: var(--transition);
}
.tag-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}
.tag-pill {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}
.tag-pill .remove-tag {
    cursor: pointer;
    font-weight: bold;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.tag-pill .remove-tag:hover {
    background: var(--danger);
}
.tag-input-container input {
    border: none !important;
    background: transparent !important;
    outline: none !important;
    padding: 0.4rem !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 180px;
}

/* Tabelas responsivas (permite rolagem horizontal no celular) */
.table-container, .table-responsive, .payment-history, .makeup-table {
    max-width: 100vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

/* ============================================
   FIX: CHECKBOXES NO MOBILE (CONSOLIDADO)
   ============================================ */
input[name="class-days"] {
    min-width: 18px;
    min-height: 18px;
    margin-right: 4px;
    appearance: auto;
    -webkit-appearance: checkbox;
}

.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    -webkit-appearance: checkbox;
    appearance: auto;
    cursor: pointer;
}

#student-experimental,
#student-inactive-checkbox {
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: inline-block;
    -webkit-appearance: checkbox;
    appearance: auto;
    flex-shrink: 0;
    position: relative;
    visibility: visible;
    opacity: 1;
}

/* ============================================
   UTILITY CLASSES (DRY & Render Optimization)
   ============================================ */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { display: flex; align-items: center; justify-content: space-between; }
.align-center { display: flex; align-items: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: #f57c00; }
.font-weight-600 { font-weight: 600; }
.font-weight-700 { font-weight: 700; }

.dash-alert-item {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}
.dash-alert-item.clickable { cursor: pointer; }
.dash-alert-item.clickable:hover { transform: translateY(-2px); box-shadow: 0 3px 6px rgba(0,0,0,0.1); }
.dash-alert-left { display: flex; align-items: center; flex: 1; }
.dash-alert-right { display: flex; align-items: center; gap: 8px; }
.dash-alert-icon { margin-right: 0.75rem; font-size: 1.2rem; }
.dash-alert-title { font-weight: 600; color: var(--text-dark); }
.badge-rounded { color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; }
.badge-small { padding: 2px 6px; border-radius: 4px; font-size: 0.65rem; margin-left: 0.5rem; color: white; }

/* ============================================
   RESPONSIVIDADE CONSOLIDADA (REFATORADA)
   ============================================ */

@media screen and (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .student-detail-layout { grid-template-columns: 1fr; }
    .student-profile-card { position: static; }
}

@media screen and (max-width: 850px) {
    img { max-width: 100%; height: auto; }
    
    .sidebar-brand img, .mobile-brand img, .login-container img, [class*="brand"] img, [class*="logo"] img {
        max-width: 120px !important;
        max-height: 50px !important;
        object-fit: contain !important;
        margin: 0 auto !important;
    }

    .login-screen .login-logo img {
        max-height: 180px;
        max-width: 180px;
        width: 100%;
    }

    .sidebar:not(.open) {
        pointer-events: none !important;
        opacity: 0 !important;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        pointer-events: auto !important;
        opacity: 1 !important;
        transform: translateX(0);
    }

    .main-content, .app {
        pointer-events: auto !important;
        z-index: 1;
    }
}

@media screen and (max-width: 768px) {
    /* Base e Fundos */
    html, body {
        background-color: var(--bg);
        overflow-x: hidden;
    }

    /* O App ajusta para coluna */
    .app {
        flex-direction: column;
        width: 100%;
    }

    /* Oculta o botão de sync desktop */
    body > button[title="Sincronizar Dados"] { 
        display: none !important; 
    }

    /* Cabeçalho Mobile */
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 70px;
        background-color: var(--bg-sidebar);
        align-items: center;
        justify-content: space-between;
        padding: 0 1.5rem;
        z-index: 999;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .mobile-header * { color: #ffffff !important; }

    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        top: 0; bottom: 0; left: -320px;
        width: 280px; height: 100vh;
        background-color: var(--bg-sidebar);
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: none !important;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    }

    .sidebar-brand span { 
        font-size: 1.05rem; 
        line-height: 1.2; 
        white-space: pre-wrap; 
    }

    /* Conteúdo Principal */
    .main-content {
        margin-left: 0;
        margin-top: 70px; 
        padding: 1.5rem 1rem;
        width: 100%;
    }

    /* Grids e Elementos Internos */
    .metrics-grid { grid-template-columns: 1fr; gap: 15px; }
    .students-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .payments-table { font-size: 0.82rem; }
    .payments-table th, .payments-table td { padding: 0.65rem 0.5rem; }
    .alert-card { flex-direction: column; align-items: flex-start; }
    .alert-actions { width: 100%; }
    .tabs { 
        overflow-x: auto; 
        flex-wrap: nowrap; 
        justify-content: flex-start; 
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }
    .tab { padding: 0.65rem 0.85rem; font-size: 0.8rem; }
    .payments-summary { flex-direction: column; }
    
    .toast-container { pointer-events: none; }
    .toast { pointer-events: auto; }

    #student-counters-display {
        flex-wrap: wrap;
        font-size: 0.95rem;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions, .filter-actions, .payments-filter-bar, .report-filters, .bulk-actions-bar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }

    .header-actions button, .header-actions select, .header-actions input, .bulk-actions-bar button {
        width: 100%;
        margin: 0;
    }

    .student-detail-layout { display: flex; flex-direction: column; }
    .student-profile-card { position: relative; top: 0; width: 100%; }
    .modal { max-height: 90vh; width: 95%; margin: auto; }
    .staff-grid, .dashboard-grid, .dashboard-grid-3, .dashboard-grid-4 { grid-template-columns: 1fr; }
    
    .table-container, .table-responsive, .payment-history {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: block;
        width: 100%;
    }

    .form-group div[style*="flex-wrap:wrap"],
    .form-group div[style*="flex-wrap: wrap"] {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding-top: 10px;
    }

    .form-group div[style*="gap:0.5rem"] {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

    #staff-form-modal .form-group div[style*="display: flex"] {
        flex-direction: column;
        align-items: flex-start;
    }

    input, select, textarea { max-width: 100%; }

    .form-group[style*="display:flex"],
    .form-group[style*="display: flex"],
    .form-group div[style*="display:flex"],
    .form-group div[style*="display: flex"] {
        flex-wrap: wrap;
        max-width: 100%;
    }

    .attendance-wide-row {
        grid-template-columns: 1fr;
    }

    .attendance-details-grid {
        grid-template-columns: 1fr;
    }

    .attendance-wide-actions {
        justify-content: flex-start;
    }
}

@media screen and (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .login-container { margin: 1rem; padding: 2rem 1.5rem; }
}


