:root {
    --primary-color: #000000;
    --primary-light: #1a1a1a;
    --primary-lighter: #333333;
    --background: #f5f5f7;
    --white: #ffffff;
    --light-gray: #e8e8ea;
    --gray: #b5b5b5;
    --dark-gray: #787878;
    --darker-gray: #464646;
    --black: #090909;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--background) 0%, #eaeaee 100%);
    color: var(--black);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

.wrap {
    min-height: 100vh;
    padding: 20px;
    background: url('../assets/fundo.png') repeat;
}

.wrap.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Typography & Links */
.title {
    font-size: 24px;
    font-weight: bold;
    color: var(--black);
    margin-bottom: 20px;
}

.page-title {
    font-size: 28px;
    text-align: center;
    margin: 24px 0;
    color: var(--darker-gray);
    font-weight: 600;
    animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend {
    font-size: 14px;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    margin: 10px 0;
    display: block;
    text-align: center;
    transition: var(--transition);
    font-weight: 500;
}

.link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.error-msg {
    color: #c80000;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin: 14px 0;
    background: linear-gradient(135deg, rgba(200, 0, 0, 0.08) 0%, rgba(200, 0, 0, 0.04) 100%);
    padding: 12px 16px;
    border-radius: 10px;
    border-left: 4px solid #c80000;
    animation: slideDown 0.3s ease;
}

/* Modifiers */
.mb-10 {
    margin-bottom: 10px;
}

.mt-auto {
    margin-top: auto;
}

.text-danger {
    color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Forms & Inputs */
.form-container {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin: 20px auto;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    border: 2px solid var(--light-gray);
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--white);
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.input-group i {
    color: var(--primary-color);
    font-size: 16px;
    width: 24px;
    text-align: center;
    margin-right: 8px;
}

.input-group input,
.form-select {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    padding: 6px;
    background: transparent;
    font-family: var(--font-family);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 16px;
    width: 100%;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-back {
    align-self: flex-start;
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-back:hover {
    background: rgba(0, 0, 0, 0.05);
}

.btn-text {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
}

.btn-text:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Lists Components */
.list-container {
    background: var(--white);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
    background: var(--white);
    border: none;
    width: 100%;
    text-align: left;
    transition: var(--transition);
    border-radius: 12px;
    margin-bottom: 4px;
}

.list-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--dark-gray);
    font-size: 16px;
    animation: fadeIn 0.5s ease-in;
}

.list-item:hover {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.04) 100%);
    transform: translateX(4px);
}

.list-item h3 {
    font-size: 18px;
    color: var(--darker-gray);
}

.list-item p {
    font-size: 14px;
    color: var(--dark-gray);
}

.header-item {
    font-size: 18px;
    font-weight: bold;
    justify-content: center;
    gap: 10px;
}

.btn-remove {
    background: rgba(200, 0, 0, 0.1);
    border: none;
    color: #c80000;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    background: rgba(200, 0, 0, 0.25);
    transform: scale(1.1);
}

.btn-edit {
    background: rgba(0, 100, 200, 0.1);
    border: none;
    color: #0064c8;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.btn-edit:hover {
    background: rgba(0, 100, 200, 0.25);
    transform: scale(1.1);
}

/* Navbar & Sidebar */
.navbar {
    background: linear-gradient(135deg, var(--white) 0%, #fafafa 100%);
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.nav-logo {
    height: 40px;
}

.btn-menu,
.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--darker-gray);
    transition: var(--transition);
    padding: 8px;
    border-radius: 8px;
}

.btn-menu:hover,
.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 250px;
    height: calc(100vh - 60px);
    background: linear-gradient(180deg, var(--white) 0%, #fafafa 100%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
    transition: var(--transition);
    z-index: 9;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar a {
    text-decoration: none;
    font-size: 15px;
    color: var(--darker-gray);
    padding: 12px 16px;
    margin-bottom: 8px;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    transition: var(--transition);
}

.sidebar a:hover,
.sidebar a.text-primary {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.03) 100%);
    padding-left: 20px;
}

.main-content {
    transition: var(--transition);
    padding-top: 30px;
    margin-left: 250px;
    width: calc(100% - 250px);
}

.main-content.shifted {
    margin-left: 250px;
    width: calc(100% - 250px);
}

/* Utilities */
.footer-by {
    margin-top: 40px;
    font-size: 12px;
    color: var(--gray);
}

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: linear-gradient(135deg, var(--darker-gray) 0%, #5a5a5a 100%);
    color: var(--white);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1), fadeOut 0.4s cubic-bezier(0.4, 0, 0.2, 1) 2.6s;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .main-content.shifted {
        margin-left: 0;
        width: 100%;
    }

    .sidebar {
        width: 100%;
        left: -100%;
    }

    .sidebar.open {
        left: 0;
    }

    .page-title {
        font-size: 24px;
    }

    .container {
        padding: 10px;
    }
}

/* Class Screen Styles */
.class-header {
    background: var(--white);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.class-top-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.class-date {
    font-size: 12px;
    color: var(--dark-gray);
    font-weight: bold;
}

.class-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.class-name-input {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--light-gray);
    width: 100%;
    margin-bottom: 10px;
    padding: 5px 0;
}

.class-name-input i {
    color: var(--primary-color);
    font-size: 18px;
    width: 30px;
    margin-right: 10px;
}

.class-name-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 10px;
    background: transparent;
    font-weight: bold;
}

.class-hint {
    font-size: 12px;
    color: var(--dark-gray);
    margin-bottom: 10px;
    text-align: center;
}

.class-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.class-option {
    flex: 1;
    min-width: 100px;
    padding: 10px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    background: var(--white);
    color: var(--darker-gray);
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.class-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.class-option.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.class-option i {
    font-size: 18px;
}

.class-option span {
    font-weight: 500;
}

.class-list-container {
    background: var(--white);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
    .class-options {
        gap: 8px;
    }

    .class-option {
        min-width: 80px;
        padding: 8px;
        font-size: 11px;
    }

    .class-option i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .class-options {
        gap: 5px;
    }

    .class-option {
        min-width: 70px;
        padding: 6px;
        font-size: 10px;
    }

    .class-option i {
        font-size: 14px;
    }

    .class-header {
        padding: 10px;
    }

    .class-name-input input {
        font-size: 14px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--light-gray);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.04) 100%);
    border-radius: 16px 16px 0 0;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    color: var(--black);
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
    padding: 4px 8px;
    width: auto;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--black);
    background: rgba(0, 0, 0, 0.05);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--light-gray);
    justify-content: flex-end;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    margin: 0;
    color: var(--dark-gray);
    font-size: 14px;
}

/* Attendance Checkbox */
.attendance-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.attendance-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

.attendance-checkbox:checked {
    accent-color: var(--primary-color);
}

/* Member Modal Styles */
.member-role-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.role-btn {
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: var(--transition);
    color: var(--darker-gray);
    font-weight: 500;
}

.role-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.02);
}

.role-btn.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-color: var(--primary-color);
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--light-gray);
    border-radius: 10px;
    font-size: 15px;
    transition: var(--transition);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* tooltip rules removed; browser defaults will show title text */
