/**
 * Sistema com Estilo Refreshing Summer Fun
 * Paleta: Coolors - https://coolors.co/palette/8ecae6-219ebc-023047-ffb703-fb8500
 */

/* ========== Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Refreshing Summer Fun Colors */
    --google-blue: #219EBC;      /* Teal - cor principal */
    --google-red: #FB8500;       /* Laranja vibrante */
    --google-yellow: #FFB703;    /* Amarelo dourado */
    --google-green: #8ECAE6;     /* Azul claro (céu) */
    
    /* Extended Palette */
    --blue-light: #D4EEF6;       /* Teal claro */
    --blue-dark: #023047;        /* Azul marinho */
    --red-light: #FFE8D4;        /* Laranja claro */
    --red-dark: #C96A00;         /* Laranja escuro */
    --yellow-light: #FFF4D6;     /* Amarelo claro */
    --yellow-dark: #CC9200;      /* Amarelo escuro */
    --green-light: #E8F6FA;      /* Azul céu claro */
    --green-dark: #5BA8C6;       /* Azul céu escuro */
    
    /* Neutrals */
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F4;
    --gray-200: #E8EAED;
    --gray-300: #DADCE0;
    --gray-400: #BDC1C6;
    --gray-500: #9AA0A6;
    --gray-600: #80868B;
    --gray-700: #5F6368;
    --gray-800: #3C4043;
    --gray-900: #202124;
    
    /* Functional */
    --text-primary: #202124;
    --text-secondary: #5F6368;
    --text-disabled: #9AA0A6;
    --border-color: #DADCE0;
    --background: #FFFFFF;
    --surface: #FFFFFF;
    --surface-variant: #F8F9FA;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(60,64,67,0.1);
    --shadow-md: 0 1px 3px rgba(60,64,67,0.15), 0 1px 2px rgba(60,64,67,0.1);
    --shadow-lg: 0 4px 8px rgba(60,64,67,0.15), 0 1px 3px rgba(60,64,67,0.1);
    --shadow-xl: 0 8px 16px rgba(60,64,67,0.15), 0 4px 8px rgba(60,64,67,0.1);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Sizing */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --border-radius: 8px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface-variant);
    min-height: 100vh;
}

a {
    color: var(--google-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== Google Dots Logo ========== */
.google-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}

.google-dots.small {
    gap: 4px;
    margin-bottom: 0;
}

.google-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.google-dots.small .dot {
    width: 8px;
    height: 8px;
}

.dot.blue { background: #219EBC; animation-delay: 0s; }
.dot.red { background: #FB8500; animation-delay: 0.2s; }
.dot.yellow { background: #FFB703; animation-delay: 0.4s; }
.dot.green { background: #8ECAE6; animation-delay: 0.6s; }

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

/* ========== Auth Pages ========== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-primary);
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--google-blue);
}

/* ========== Form Elements ========== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 16px 48px 16px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
}

.input-wrapper.filled input,
.input-wrapper.filled select,
.input-wrapper.filled textarea {
    padding: 20px 16px 12px 16px;
}

.input-wrapper textarea {
    width: 100%;
    min-height: 80px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition-fast);
    outline: none;
    resize: vertical;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.input-wrapper textarea:focus {
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px var(--blue-light);
}

.input-wrapper label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: var(--transition-fast);
    background: var(--surface);
    padding: 0 4px;
}

.input-wrapper:has(textarea) label {
    top: 20px;
    transform: none;
}

.input-wrapper:has(textarea).filled label {
    top: 0;
}

.input-wrapper input:focus + label,
.input-wrapper input:not(:placeholder-shown) + label,
.input-wrapper textarea:focus + label,
.input-wrapper textarea:not(:placeholder-shown) + label,
.input-wrapper.filled label {
    top: 0;
    font-size: 0.75rem;
    color: var(--google-blue);
}

.input-wrapper input:not(:focus):not(:placeholder-shown) + label,
.input-wrapper textarea:not(:focus):not(:placeholder-shown) + label {
    color: var(--text-secondary);
}

.input-wrapper .input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.input-wrapper .input-icon i {
    font-size: 20px;
}

.toggle-password {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Form Messages */
.form-message {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    display: none;
}

.form-message:not(:empty) {
    display: block;
}

.form-message.success {
    background: var(--green-light);
    color: var(--green-dark);
    border: 1px solid var(--google-green);
}

.form-message.error {
    background: var(--red-light);
    color: var(--red-dark);
    border: 1px solid var(--google-red);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.form-actions.right {
    justify-content: flex-end;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn i {
    font-size: 18px;
}

.btn-primary {
    background: var(--google-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-dark);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--google-red);
    color: white;
}

.btn-danger:hover {
    background: var(--red-dark);
}

.btn-text {
    background: transparent;
    color: var(--google-blue);
    padding: 10px 16px;
}

.btn-text:hover {
    background: var(--blue-light);
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background: var(--red-light);
    color: var(--google-red);
}

/* Button Loading State */
.btn .btn-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn .btn-label {
    display: inline;
}

.btn.loading .btn-label {
    display: none;
}

.btn.loading .btn-loader {
    display: block;
}

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

/* ========== Dashboard Layout ========== */
.dashboard-page {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .logout-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 12px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item i {
    margin: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 8px;
}

.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 12px;
}

/* Collapse Toggle Button */
.sidebar-collapse-btn {
    position: absolute;
    top: 50%;
    right: -12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.sidebar-collapse-btn:hover {
    background: var(--gray-100);
}

.sidebar-collapse-btn i {
    font-size: 16px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Tooltips for collapsed sidebar */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-900);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-left: 8px;
    z-index: 1000;
    pointer-events: none;
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    text-align: left;
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--blue-light);
    color: var(--google-blue);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.logout-btn:hover {
    background: var(--red-light) !important;
    color: var(--google-red) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal), width var(--transition-normal);
    width: calc(100% - var(--sidebar-width));
}

body.sidebar-collapsed .main-content {
    margin-left: 72px;
    width: calc(100% - 72px);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    box-sizing: border-box;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
}

.menu-toggle:hover {
    background: var(--gray-100);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--google-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.875rem;
}

.user-avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.user-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ========== Cards ========== */
.content-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.card-header h3 i {
    color: var(--text-secondary);
    font-size: 20px;
}

.card-header-left,
.card-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-body {
    padding: 24px;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, #219EBC 0%, #023047 100%);
    color: white;
    border-radius: 12px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.welcome-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon i {
    font-size: 32px;
}

.welcome-text h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 4px;
}

.welcome-text p {
    opacity: 0.9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 24px;
    color: white;
}

/* Cores Refreshing Summer Fun */
.stat-card.blue .stat-icon { background: #8ECAE6; }
.stat-card.blue { border-left: 4px solid #8ECAE6; }
.stat-card.red .stat-icon { background: #FB8500; }
.stat-card.red { border-left: 4px solid #FB8500; }
.stat-card.yellow .stat-icon { background: #FFB703; }
.stat-card.yellow { border-left: 4px solid #FFB703; }
.stat-card.green .stat-icon { background: #219EBC; }
.stat-card.green { border-left: 4px solid #219EBC; }
.stat-card.purple .stat-icon { background: #023047; }
.stat-card.purple { border-left: 4px solid #023047; }

.stat-card.blue .stat-icon i { color: #023047; }
.stat-card.red .stat-icon i { color: #fff; }
.stat-card.yellow .stat-icon i { color: #023047; }
.stat-card.green .stat-icon i { color: #fff; }
.stat-card.purple .stat-icon i { color: #8ECAE6; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-icon i {
    font-size: 18px;
    color: white;
}

.activity-icon.blue { background: #219EBC; }
.activity-icon.red { background: #FB8500; }
.activity-icon.yellow { background: #FFB703; }
.activity-icon.green { background: #8ECAE6; }

.activity-info {
    display: flex;
    flex-direction: column;
}

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

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ========== Tables ========== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface-variant);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-green { background: var(--green-light); color: var(--blue-dark); }
.badge-red { background: var(--red-light); color: var(--red-dark); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow-dark); }
.badge-gray { background: var(--gray-100); color: var(--text-secondary); }
.badge-purple { background: #E8F6FA; color: #023047; }
.badge-orange { background: #FFE8D4; color: #FB8500; }

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    width: 250px;
    transition: var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px var(--blue-light);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.page-btn:hover {
    background: var(--gray-100);
}

.page-btn.active {
    background: var(--google-blue);
    border-color: var(--google-blue);
    color: white;
}

/* ========== Modals ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
}

.modal-close:hover {
    background: var(--gray-100);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-of-type {
    margin-bottom: 0;
}

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

.text-danger {
    color: var(--google-red);
    font-size: 0.875rem;
}

/* ========== Profile Page ========== */
.profile-grid {
    display: grid;
    gap: 24px;
    max-width: 800px;
}

.profile-card {
    padding: 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 4px;
}

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

/* ========== Loading States ========== */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 32px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--google-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px !important;
}

.empty-message,
.error-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
}

/* ========== Toast Notifications ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--gray-900);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--google-green);
}

.toast.error {
    background: var(--google-red);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== Sidebar Overlay ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: var(--sidebar-width) !important;
    }
    
    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    
    .sidebar-collapse-btn {
        display: none;
    }
    
    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .topbar,
    body.sidebar-collapsed .topbar {
        left: 0;
        width: 100%;
    }
    
    /* Reset collapsed styles on mobile */
    .sidebar.collapsed .sidebar-title,
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .logout-btn span {
        opacity: 1;
        width: auto;
    }
    
    .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    
    .sidebar.collapsed .sidebar-header {
        justify-content: flex-start;
        padding: 16px 20px;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .card-header-right {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .card-header-right .btn {
        width: 100%;
    }
    
    .welcome-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 8px;
    }
    
    .user-name {
        display: none;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 16px;
    }
    
    .topbar {
        padding: 0 16px;
    }
    
    .modal {
        margin: 10px;
    }
    
    .modal-body,
    .modal-header,
    .modal-footer {
        padding: 16px;
    }
}

/* ========== Alert Card ========== */
.alert-card {
    background: var(--yellow-light);
    border: 1px solid var(--google-yellow);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.alert-icon {
    width: 48px;
    height: 48px;
    background: var(--google-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon i {
    color: white;
    font-size: 24px;
}

.alert-content {
    flex: 1;
}

.alert-content strong {
    color: var(--yellow-dark);
    display: block;
    margin-bottom: 4px;
}

.alert-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

/* ========== Filter Tabs ========== */
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--border-radius);
}

.filter-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    font-family: inherit;
}

.filter-tab i {
    font-size: 18px;
}

.filter-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--surface);
    color: var(--google-blue);
    box-shadow: var(--shadow-sm);
}

.filter-tab.pending.active {
    color: var(--yellow-dark);
}

.filter-badge {
    background: var(--google-red);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* ========== Button Variants ========== */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-icon.success {
    color: var(--google-green);
}

.btn-icon.success:hover {
    background: var(--green-light);
}

.btn-icon.warning {
    color: var(--yellow-dark);
}

.btn-icon.warning:hover {
    background: var(--yellow-light);
}

/* ========== User Table Enhancements ========== */
.row-pending {
    background: var(--yellow-light) !important;
}

.row-pending:hover {
    background: #fef3c7 !important;
}

.user-avatar.pending {
    background: var(--google-yellow);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell > div {
    display: flex;
    flex-direction: column;
}

.text-pending {
    font-size: 0.7rem;
    color: var(--yellow-dark);
    margin-top: 2px;
}

/* ========== Responsive Filter ========== */
@media (max-width: 1024px) {
    .filter-tabs {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .filter-tab span {
        display: none;
    }
}

@media (max-width: 768px) {
    .alert-card {
        flex-direction: column;
        text-align: center;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
}

/* ========== Avatar Upload ========== */
.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.profile-avatar.large {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    overflow: hidden;
}

.profile-avatar.large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--google-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.avatar-upload-btn:hover {
    background: var(--blue-dark);
    transform: scale(1.1);
}

.avatar-upload-btn i {
    color: white;
    font-size: 18px;
}

.avatar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

.avatar-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.avatar-actions .btn-text {
    color: var(--google-red);
}

.avatar-actions .btn-text:hover {
    background: var(--red-light);
}

/* Avatar no Topbar */
.user-avatar {
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-avatar.small {
    overflow: hidden;
}

/* Profile Links */
.profile-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.profile-link:hover {
    color: var(--google-blue);
}

.email-link {
    color: var(--google-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}

.email-link:hover {
    text-decoration: underline;
}

/* User Menu Link */
a.user-menu {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

a.user-menu:hover {
    opacity: 0.8;
}

a.user-menu:hover .user-name {
    color: var(--google-blue);
}

/* Topbar Date */
.topbar-date {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.topbar-date i {
    font-size: 18px;
    color: var(--google-blue);
}

@media (max-width: 768px) {
    .topbar-date span {
        display: none;
    }
    
    .topbar-date {
        padding: 8px;
    }
}

/* ========== Activity List ========== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border-color);
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--surface);
    transition: var(--transition-fast);
}

.activity-item:hover {
    background: var(--gray-50);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon i {
    font-size: 20px;
}

.activity-icon.green {
    background: var(--green-light);
    color: var(--google-green);
}

.activity-icon.red {
    background: var(--red-light);
    color: var(--google-red);
}

.activity-icon.blue {
    background: var(--blue-light);
    color: var(--google-blue);
}

.activity-icon.gray {
    background: var(--gray-100);
    color: var(--text-secondary);
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.activity-header strong {
    color: var(--text-primary);
}

.activity-action {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.activity-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 4px 0;
}

.activity-meta {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-meta i {
    font-size: 14px;
}

/* Empty & Error States */
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state i,
.error-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.error-state {
    color: var(--google-red);
}

/* Form Select */
.form-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface);
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--google-blue);
}

/* ========== Pesquisas ========== */
.pesquisas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.pesquisa-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition-fast);
}

.pesquisa-card:hover {
    box-shadow: var(--shadow-md);
}

.pesquisa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.pesquisa-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.pesquisa-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pesquisa-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.pesquisa-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pesquisa-stats i {
    font-size: 16px;
}

.pesquisa-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Perguntas Section */
.perguntas-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.pergunta-item {
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.pergunta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--gray-100);
}

.pergunta-num {
    background: var(--google-blue);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.pergunta-body {
    padding: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    margin-bottom: 12px;
}

.form-row .flex-2 {
    flex: 2;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--google-blue);
}

.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
}

.opcoes-container {
    margin-top: 12px;
}

.opcoes-container label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: block;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 8px;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
}

/* Share Link Box */
.share-link-box {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.share-link-box input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    background: var(--gray-50);
}

.share-hint {
    color: var(--google-green);
    font-size: 0.875rem;
    text-align: center;
}

/* Results */
.results-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h3 {
    margin: 0 0 8px 0;
}

.result-question {
    margin-bottom: 24px;
}

.result-question h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.result-bar {
    margin-bottom: 8px;
}

.result-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 4px;
}

.result-bar-track {
    height: 24px;
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--google-blue), var(--google-green));
    border-radius: 12px;
    transition: width 0.5s ease;
}

.result-text {
    background: var(--gray-50);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Modal Large */
.modal-large {
    max-width: 700px;
}
