/* ========================================
   D21 Platform - Custom Styles
   Paleta de Cores D21:
   - Laranja: #e34616
   - Lilás: #5f49e4
   - Verde: #16d1a0
   - Azul: #3464c4
   - Preto: #1E1E2E
   ======================================== */

:root {
    --d21-orange: #e34616;
    --d21-purple: #5f49e4;
    --d21-green: #16d1a0;
    --d21-blue: #3464c4;
    --d21-black: #1E1E2E;
    --sidebar-width: 280px;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* ========================================
   LOGIN PAGE
   ======================================== */

.login-page {
    height: 100vh;
    overflow: hidden;
}

.login-container {
    height: 100vh;
}

.d21-gradient {
    background: linear-gradient(135deg, var(--d21-orange) 0%, var(--d21-purple) 50%, var(--d21-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: white;
}

.gradient-content {
    max-width: 500px;
    text-align: center;
}

.gradient-content h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.gradient-content .lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

.features {
    display: grid;
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.feature-item i {
    margin-bottom: 1rem;
}

.feature-item h5 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    margin: 0;
    opacity: 0.9;
}

.login-form-container {
    max-width: 450px;
    padding: 2rem;
    width: 100%;
}

.login-form-container h2 {
    color: var(--d21-black);
    font-weight: bold;
}

.login-form-container .form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.login-form-container .form-control:focus {
    border-color: var(--d21-purple);
    box-shadow: 0 0 0 0.2rem rgba(95, 73, 228, 0.25);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--d21-black) 0%, #2a2a3e 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-container {
    justify-content: center;
}

.sidebar.collapsed .logo-container h4,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .user-info .ms-2 {
    display: none;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container h4 {
    color: white;
    font-weight: bold;
}

.sidebar-nav {
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

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

.sidebar-link.active {
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(95, 73, 228, 0.4);
}

.sidebar-link i {
    width: 24px;
    text-align: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

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

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

.user-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s;
}

.main-content.expanded {
    margin-left: 80px;
}

.top-bar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    color: var(--d21-black);
    font-size: 1.5rem;
}

/* ========================================
   PAGE HEADER
   ======================================== */

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

.page-header h1 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--d21-black);
    margin: 0;
}

.page-header h1 i {
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-d21 {
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-d21:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(95, 73, 228, 0.4);
    color: white;
}

/* ========================================
   CARDS
   ======================================== */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-header h5 {
    margin: 0;
    color: var(--d21-black);
    font-weight: 600;
}

/* ========================================
   STAT CARDS
   ======================================== */

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 1rem;
}

.stat-card-orange .stat-icon {
    background: linear-gradient(135deg, var(--d21-orange), #ff6b3d);
}

.stat-card-purple .stat-icon {
    background: linear-gradient(135deg, var(--d21-purple), #8b7aed);
}

.stat-card-green .stat-icon {
    background: linear-gradient(135deg, var(--d21-green), #3de8bb);
}

.stat-card-blue .stat-icon {
    background: linear-gradient(135deg, var(--d21-blue), #5c8ae8);
}

.stat-details h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
    color: var(--d21-black);
}

.stat-details p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* ========================================
   ACTION CARDS
   ======================================== */

.action-card {
    display: block;
    text-align: center;
    padding: 2rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.action-card:hover {
    border-color: var(--d21-purple);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(95, 73, 228, 0.2);
}

.action-card i {
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.action-card h5 {
    color: var(--d21-black);
    font-weight: bold;
    margin: 0;
}

.action-card p {
    margin: 0;
}

/* ========================================
   TABLES
   ======================================== */

.table {
    background: white;
}

.table thead {
    background: linear-gradient(135deg, var(--d21-purple), var(--d21-blue));
    color: white;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem;
}

/* ========================================
   AVATAR
   ======================================== */

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ========================================
   UTILITIES
   ======================================== */

.text-d21 {
    background: linear-gradient(135deg, var(--d21-orange), var(--d21-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   ALERTS
   ======================================== */

.alert {
    border-radius: 8px;
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* ========================================
   FORMS
   ======================================== */

.form-label {
    font-weight: 500;
    color: var(--d21-black);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 0.75rem 1rem;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--d21-purple);
    box-shadow: 0 0 0 0.2rem rgba(95, 73, 228, 0.25);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card {
        margin-bottom: 1rem;
    }
}
