:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
}

/* =========================================
   LOGIN PAGE
   ========================================= */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, #1e1b4b, var(--bg-dark));
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    width: 400px;
    box-shadow: var(--shadow);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

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

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 16px;
    margin: 0 auto 16px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.logo-icon.small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin: 0;
    margin-right: 12px;
}

.logo-area h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-area p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* =========================================
   DASHBOARD LAYOUT
   ========================================= */
.dashboard-body {
    display: flex;
    min-height: 100vh;
}
/* Removendo a barra lateral fixa da direita e voltando ao full width */
.right-sidebar {
    display: none;
}

.right-sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 0.4s ease-out;
}

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

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

/* SUBMENUS */
.nav-group {
    display: flex;
    flex-direction: column;
}

.submenu {
    padding-left: 44px;
    display: none; /* Escondido por padrão, aberto via JS ou classe active */
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.submenu.active {
    display: flex;
}

.submenu-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
}

.submenu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.submenu-item.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-item .arrow {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.3s;
}

.nav-group.open .arrow {
    transform: rotate(180deg);
}

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

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
}

.info strong { display: block; font-size: 14px; }
.info span { font-size: 12px; color: var(--text-muted); }

.logout-btn {
    display: block;
    text-align: center;
    color: var(--danger);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 32px 48px;
    background: radial-gradient(circle at top left, #1e1b4b, var(--bg-dark) 50%);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 600;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }

.stat-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.trend { font-size: 12px; font-weight: 500; }
.trend.positive { color: var(--success); }
.trend.negative { color: var(--danger); }
.trend.neutral { color: var(--text-muted); }

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

.btn-primary.small {
    padding: 10px 20px;
    font-size: 14px;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

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

.premium-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.premium-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.premium-table td strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.premium-table td span {
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.blue { background: rgba(59, 130, 246, 0.15); color: var(--primary); }
.badge.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge.purple { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.badge.gray { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}
.btn-text:hover { text-decoration: underline; }

/* MODAL PREMIUM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s;
}
.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}
.modal-content .input-group label {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 10px;
}
.modal-content .input-group input, 
.modal-content .input-group select {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 16px !important;
}
/* Custom Select for Sidebar Form */
.right-sidebar .input-group select {
    width: 100%;
    padding: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}
