/* MiniERP - Sistema ERP para Franquias de Games */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --sidebar-width: 320px;
    --topbar-height: 70px;
}

/* Tema Super Admin - Cores Azuis/Roxas (Autoridade e Controle) */
body.theme-superadmin {
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent-color: #8b5cf6;
    --accent-dark: #7c3aed;
    --accent-light: #ede9fe;
    --sidebar-bg: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.8);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --topbar-bg: #ffffff;
    --topbar-border: #e5e7eb;
}

/* Tema Franquia - Cores Verdes/Laranjas (Crescimento e Energia) */
body.theme-franchise {
    --primary-color: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --accent-color: #f59e0b;
    --accent-dark: #d97706;
    --accent-light: #fef3c7;
    --sidebar-bg: linear-gradient(135deg, #059669 0%, #f59e0b 100%);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.9);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --topbar-bg: #ffffff;
    --topbar-border: #e5e7eb;
}

/* Tema Cliente - Cores Vermelhas (Energia e Destaque) */
body.theme-cliente {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fee2e2;
    --accent-color: #f97316;
    --accent-dark: #ea580c;
    --accent-light: #ffedd5;
    --sidebar-bg: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    --sidebar-text: #ffffff;
    --sidebar-text-muted: rgba(255, 255, 255, 0.9);
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(255, 255, 255, 0.2);
    --topbar-bg: #ffffff;
    --topbar-border: #e5e7eb;
}

/* Estilos específicos para o topbar da área do cliente */
body.theme-cliente .topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-logout-topbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
    border-radius: 50px;
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
}

.btn-logout-topbar i {
    font-size: 1.1rem;
}

.btn-logout-topbar:hover {
    background: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
    border-color: rgba(220, 38, 38, 0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Utilitários */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.text-center { text-align: center; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--text-secondary); }
.fw-bold { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 30%, #334155 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(120, 119, 198, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 75% 75%, rgba(99, 102, 241, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 25% 75%, rgba(168, 85, 247, 0.08) 0%, transparent 25%);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.login-logo h1 {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.login-logo p {
    color: #64748b;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

/* Quick Login Section */
.quick-login-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.quick-login-title {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.quick-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quick-login-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.quick-login-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.25);
    border-color: var(--primary-color);
}

.quick-login-btn:hover .quick-login-info strong,
.quick-login-btn:hover .quick-login-info span {
    color: white;
}

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

.quick-login-icon {
    font-size: 1.75rem;
    line-height: 1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-login-btn:hover .quick-login-icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.quick-login-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quick-login-info strong {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    transition: color 0.3s ease;
}

.quick-login-info span {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
    transition: color 0.3s ease;
}

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

.modal-body .form-group {
    margin-bottom: 0.75rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-primary);
    font-weight: 400;
}

.form-control::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:invalid {
    border-color: var(--danger-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

/* Tema Super Admin - Sombras azuis/roxas */
body.theme-superadmin .btn-primary:hover {
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

body.theme-superadmin .card {
    border-left: 4px solid var(--accent-color);
}

/* Tema Franquia - Sombras verdes/laranjas */
body.theme-franchise .btn-primary:hover {
    box-shadow: 0 10px 25px rgba(5, 150, 105, 0.4);
}

body.theme-franchise .card {
    border-left: 4px solid var(--accent-color);
}

/* Indicador de tema no topo */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 9999;
    background: var(--primary-color);
}

body.theme-superadmin::before {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

body.theme-franchise::before {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

/* Main Layout */
.main-wrapper {
    display: block;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg, linear-gradient(180deg, var(--dark-color) 0%, #374151 100%));
    color: var(--sidebar-text, white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    min-height: 100%;
    overflow-y: auto;
    z-index: 1000;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Overlay para fechar sidebar - não usado mais */
.sidebar-overlay {
    display: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.05);
}

/* Headers específicos por tema */
body.theme-superadmin .sidebar-header {
    background: rgba(0, 0, 0, 0.08);
}

body.theme-franchise .sidebar-header {
    background: rgba(0, 0, 0, 0.08);
}

.sidebar-logo h2 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.2rem;
    line-height: 1.1;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo p {
    font-size: 0.95rem;
    color: var(--sidebar-text-muted, rgba(255, 255, 255, 0.8));
    margin: 0;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Engrenagem da logo */
.logo-gear {
    color: var(--sidebar-text-muted, rgba(255, 255, 255, 0.8));
    animation: randomSpin 12s infinite linear;
    transform-origin: center;
    flex-shrink: 0;
}

/* Animação de rotação aleatória */
@keyframes randomSpin {
    0% { transform: rotate(0deg); }
    15% { transform: rotate(45deg); }
    30% { transform: rotate(90deg); }
    45% { transform: rotate(180deg); }
    60% { transform: rotate(225deg); }
    75% { transform: rotate(270deg); }
    90% { transform: rotate(315deg); }
    100% { transform: rotate(360deg); }
}

.sidebar-user {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-color, var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Avatares específicos por tema */
body.theme-superadmin .user-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

body.theme-franchise .user-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

.user-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.user-details p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Navigation */
.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--sidebar-text-muted, rgba(255, 255, 255, 0.8));
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    background: var(--sidebar-hover, rgba(255, 255, 255, 0.1));
    color: var(--sidebar-text, white);
}

.nav-link.active {
    background: var(--sidebar-active, rgba(255, 255, 255, 0.2));
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color, var(--primary-color));
}

.nav-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.nav-icon:not(svg) {
    font-size: 16px;
    display: inline-block;
    width: 20px;
    text-align: center;
}

.nav-icon.fas, .nav-icon.far, .nav-icon.fab {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Submenu Styles */
.nav-parent {
    position: relative;
}

.nav-parent > .nav-link {
    cursor: pointer;
}

.nav-parent > .nav-link .nav-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    width: 16px;
    height: 16px;
    font-size: 12px;
    display: inline-block;
    text-align: center;
}

.nav-parent.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.nav-parent.open .nav-submenu {
    max-height: 500px;
}

.nav-submenu .nav-link {
    padding-left: 3.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.nav-submenu .nav-link:hover {
    opacity: 1;
}

/* Special Buttons */
.btn-frente-caixa {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #f97316 100%);
    color: white;
    margin: 1rem 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-frente-caixa svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.btn-frente-caixa strong {
    line-height: 1;
    margin: 0;
    font-size: 0.875rem;
}

.btn-frente-caixa:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    color: white;
}

.btn-switch-account {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-switch-account:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

.btn-switch-account i {
    font-size: 1rem;
}

.btn-return-admin {
    background: var(--info-color);
    color: white;
    margin: 1rem 1.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.btn-return-admin:hover {
    background: #2563eb;
    color: white;
}

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

.topbar {
    height: var(--topbar-height);
    background: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.hamburger-btn:hover {
    background: var(--light-color);
}

.hamburger-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Area */
.content {
    padding: 2rem;
    padding-bottom: 15rem;
    flex: 1;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

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

.stat-card.success::before { background: var(--success-color); }
.stat-card.warning::before { background: var(--warning-color); }
.stat-card.danger::before { background: var(--danger-color); }
.stat-card.info::before { background: var(--info-color); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

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

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-badge.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-badge.secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #64748b;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

/* Para modais com form, o form precisa herdar o flex */
.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: white;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.95);
    border-color: #10b981;
    color: #ffffff;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.95);
    border-color: #ef4444;
    color: #ffffff;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.95);
    border-color: #f59e0b;
    color: #ffffff;
}

.alert-info {
    background: rgba(59, 130, 246, 0.95);
    border-color: #3b82f6;
    color: #ffffff;
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #374151 100%);
    color: #ffffff;
    margin-top: 3rem;
    border-top: 3px solid var(--primary-color);
}

.footer-content {
    padding: 1.5rem 2rem;
    width: 100%;
}

.footer-brand h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.footer-brand p {
    color: #d1d5db;
    font-size: 0.95rem;
    margin: 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.85rem;
    color: #9ca3af;
}

.footer-version {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-version span {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Sidebar Bottom */
.sidebar-bottom {
    padding: 1.5rem 1.5rem 1.5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.btn-return-admin {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--info-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-return-admin:hover {
    background: #2563eb;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

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

    .content {
        padding: 1rem;
    }

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

    .modal-content {
        margin: 1rem;
        width: auto;
    }

    .topbar {
        padding: 0 1rem;
    }

    .page-title h1 {
        font-size: 1.25rem;
    }

    .hamburger-btn {
        padding: 0.25rem;
    }

    /* Footer responsivo */
    .footer-content {
        padding: 1.5rem 1rem;
        gap: 1rem;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
    }

    /* Login Page Responsivo */
    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 2rem;
        max-width: 100%;
    }

    .login-logo h1 {
        font-size: 2.5rem;
    }

    .quick-login-buttons {
        gap: 0.75rem;
    }

    .quick-login-btn {
        padding: 0.875rem 1rem;
    }

    .quick-login-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .quick-login-info strong {
        font-size: 0.95rem;
    }

    .quick-login-info span {
        font-size: 0.8rem;
    }
}

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

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

/* Transitions */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Notification Button */
.btn-notification {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--light-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-notification:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

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

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

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Validação de formulários */
.form-control.is-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%2328a745' d='m6.564.75-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3E%3Ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

/* Animação de loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading state global - garante que só o ícone gire */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary, #64748b);
}

.loading > i,
.loading > .spinner {
    display: block;
    font-size: 1.5rem;
    margin: 0 auto 0.75rem auto;
    width: fit-content;
}

.loading > p,
.loading > span {
    display: block;
    margin: 0;
    animation: none !important;
    transform: none !important;
}

/* Corrige fa-spin aplicado incorretamente */
.fa-spin {
    animation: spin 1s linear infinite;
}

i.fa-spin,
span.fa-spin {
    display: inline-block;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 32px;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary-color);
    background-color: #f9fafb;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 400;
}
