/* Admin Panel Styles - Modern Design */
:root {
    --primary-color: #3B82F6;
    --primary-dark: #2563EB;
    --secondary-color: #1F2937;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #6366F1;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
    --header-height: 80px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, var(--gray-50) 0%, #E0E7FF 100%);
    display: flex;
    min-height: 100vh;
}

/* ========================================
   MOBILE MENU TOGGLE - CONTROLE ABSOLUTO
   ======================================== */

/* REGRA GLOBAL: ESCONDER SEMPRE POR PADRÃO */
.mobile-menu-toggle {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    z-index: -1 !important;
}

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

.mobile-menu-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    transition: var(--transition);
}

.mobile-menu-overlay.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo::before {
    content: '⚡';
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    gap: 1rem;
    font-weight: 500;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-right: 1rem;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 0 2px 2px 0;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    color: var(--primary-color);
    transform: translateX(4px);
}

.nav-link:hover::before,
.nav-link.active::before {
    height: 24px;
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    transition: var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    transform: scale(1.1);
}

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

/* Header - CORRIGIDO PARA DESKTOP */
.admin-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* DESKTOP: Alinhado à esquerda */
    flex: 0 0 auto;
}

.header-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* DESKTOP: Alinhado à direita */
    flex: 0 0 auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-600);
    font-weight: 500;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Content */
.content {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
}

.page-header {
    margin-bottom: 2.5rem;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--gray-800), var(--gray-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card.span-2 {
    grid-column: span 2;
}

.stat-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius);
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.stat-icon.primary { 
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    color: var(--primary-color);
}
.stat-icon.success { 
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    color: var(--success-color);
}
.stat-icon.warning { 
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    color: var(--warning-color);
}
.stat-icon.info { 
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.05));
    color: var(--info-color);
}

.stat-details h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-details p {
    color: var(--gray-600);
    font-size: 1rem;
    font-weight: 500;
}

/* Section */
.section {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-50), var(--white));
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header h2::before {
    content: '';
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.section-content {
    padding: 2rem;
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--white);
}

.table th,
.table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
    font-weight: 700;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, var(--gray-50), rgba(59, 130, 246, 0.02));
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-image-small {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--white);
    box-shadow: var(--shadow);
}

.product-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Status */
.status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status.active::before {
    background: var(--success-color);
}

.status.inactive {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(75, 85, 99, 0.05));
    color: #374151;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.status.inactive::before {
    background: var(--gray-500);
}

.status.pending {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status.pending::before {
    background: var(--warning-color);
}

.status.approved {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status.approved::before {
    background: var(--success-color);
}

.status.rejected {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status.rejected::before {
    background: var(--error-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    gap: 0.5rem;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray-300), var(--gray-400));
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #D97706);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-error {
    background: linear-gradient(135deg, var(--error-color), #DC2626);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

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

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

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 3rem;
}

.textarea {
    min-height: 120px;
    resize: vertical;
}

.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: linear-gradient(135deg, var(--gray-50), var(--white));
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), var(--white));
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-text {
    color: var(--gray-600);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert::before {
    font-size: 1.25rem;
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
    color: #065F46;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-success::before {
    content: '✅';
}

.alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    color: #991B1B;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-error::before {
    content: '❌';
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.05));
    color: #92400E;
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-warning::before {
    content: '⚠️';
}

.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.05));
    color: #1E40AF;
    border-color: rgba(99, 102, 241, 0.2);
}

.alert-info::before {
    content: 'ℹ️';
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
    background: linear-gradient(135deg, var(--gray-50), var(--white));
    border-radius: var(--border-radius);
    border: 2px dashed var(--gray-300);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gray-600);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-50), var(--white));
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-body {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 1.5rem;
}

/* ========================================
   RESPONSIVE - MOBILE FIRST APPROACH
   ======================================== */

/* DESKTOP GRANDE (1440px+): Garantir que botão NUNCA apareça */
@media (min-width: 1440px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }

    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }
}

/* DESKTOP PADRÃO (1200px+): Garantir que botão NUNCA apareça */
@media (min-width: 1200px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }

    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }

    .sidebar {
        transform: translateX(0) !important;
        position: fixed;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }
}

/* DESKTOP MÉDIO (1025px+): Garantir que botão NUNCA apareça */
@media (min-width: 1025px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }

    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        z-index: -999 !important;
        pointer-events: none !important;
    }

    .sidebar {
        transform: translateX(0) !important;
        position: fixed;
    }

    .main-content {
        margin-left: var(--sidebar-width);
    }

    /* DESKTOP: Header com título alinhado à esquerda */
    .admin-header {
        justify-content: space-between;
    }

    .header-title {
        /* Título alinhado à esquerda no desktop */
        justify-self: flex-start;
        text-align: left;
    }

    .header-actions {
        /* Ações alinhadas à direita no desktop */
        justify-self: flex-end;
    }
}

/* TABLET E MOBILE (1024px e abaixo): Mostrar botão menu */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        left: auto !important;
        z-index: 102 !important;
        pointer-events: auto !important;
    }

    .mobile-menu-overlay {
        display: none;
        visibility: hidden;
        opacity: 0;
        z-index: 99;
        pointer-events: auto;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 101;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .admin-header {
        padding: 1rem 1.5rem;
        /* MOBILE/TABLET: Centralizar título */
        justify-content: center;
        position: relative;
    }

    .header-title {
        font-size: 1.25rem;
        /* MOBILE/TABLET: Título centralizado */
        text-align: center;
        flex: 1;
        justify-content: center;
    }

    .header-title::before {
        display: none;
    }

    .header-actions {
        /* MOBILE/TABLET: Ações à direita */
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.span-2 {
        grid-column: span 1;
    }

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

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        padding: 1.5rem;
    }

    .section-content {
        padding: 1.5rem;
    }

    .user-menu span {
        display: none;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }

    .page-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .stat-details h3 {
        font-size: 2rem;
    }

    .sidebar {
        width: 280px;
    }

    .sidebar-header {
        padding: 1.5rem;
    }

    .sidebar-logo {
        font-size: 1.25rem;
    }

    .nav-link {
        padding: 0.875rem 1.25rem;
        margin-right: 0.75rem;
    }

    .nav-icon {
        font-size: 1.125rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table th,
    .table td {
        padding: 1rem 0.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .modal {
        padding: 1rem;
    }

    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 1rem;
    }

    .header-title {
        font-size: 1.125rem;
    }

    .content {
        padding: 0.75rem;
    }

    .page-header {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .section-header {
        padding: 1rem;
    }

    .section-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-details h3 {
        font-size: 1.5rem;
    }

    .form-control {
        padding: 0.875rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .modal-content {
        margin: 0;
        border-radius: var(--border-radius);
    }

    .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* Print styles */
@media print {
    .sidebar,
    .admin-header,
    .btn,
    .action-buttons,
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .content {
        padding: 0 !important;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--gray-600); }
.text-success { color: var(--success-color); }
.text-error { color: var(--error-color); }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary-color));
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced hover effects */
.hover-lift {
    transition: var(--transition);
}

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

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}