/* Estilos do Painel Administrativo - Fernandes & Ribeiro Advogados */

:root {
    --primary-color: #212529;
    --accent-color: #c0a062;
    --sidebar-width: 250px;
    --header-height: 60px;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* Layout Principal */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    max-width: 80%;
    height: auto;
}

.sidebar-menu {
    padding: 0;
    list-style: none;
    margin-top: 20px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-color);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-submenu {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.sidebar-submenu.show {
    max-height: 500px;
}

.sidebar-menu .has-submenu > a::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    float: right;
    transition: transform 0.3s;
}

.sidebar-menu .has-submenu.open > a::after {
    transform: rotate(180deg);
}

/* Conteúdo Principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: all 0.3s;
}

/* Cabeçalho */
.admin-header {
    height: var(--header-height);
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.admin-header-right {
    display: flex;
    align-items: center;
}

.admin-user-dropdown {
    margin-left: 15px;
    position: relative;
}

.admin-user-dropdown .dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.admin-user-dropdown .dropdown-toggle img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
}

.admin-user-dropdown .dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #fff;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    min-width: 200px;
    display: none;
}

.admin-user-dropdown .dropdown-menu.show {
    display: block;
}

.admin-user-dropdown .dropdown-item {
    padding: 10px 15px;
    display: block;
    color: var(--primary-color);
    text-decoration: none;
}

.admin-user-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.admin-user-dropdown .dropdown-divider {
    height: 1px;
    background-color: #e9ecef;
    margin: 5px 0;
}

/* Conteúdo da Página */
.page-content {
    padding: 20px;
}

.page-title {
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 1.8rem;
    margin: 0;
}

/* Cards */
.admin-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.admin-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.admin-card-body {
    padding: 20px;
}

.admin-card-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Estatísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.stat-icon.success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.stat-icon.danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.stat-info h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.stat-info p {
    margin: 5px 0 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Tabelas */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 500;
}

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

.admin-table .status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-table .status.active {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.admin-table .status.pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.admin-table .status.completed {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.admin-table .actions {
    display: flex;
    gap: 5px;
}

.admin-table .btn-action {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: none;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s;
}

.admin-table .btn-action:hover {
    background-color: #e9ecef;
}

.admin-table .btn-action.edit:hover {
    color: #0d6efd;
}

.admin-table .btn-action.delete:hover {
    color: var(--danger-color);
}

.admin-table .btn-action.view:hover {
    color: var(--success-color);
}

/* Paginação */
.admin-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.admin-pagination .page-item {
    margin: 0 5px;
}

.admin-pagination .page-link {
    display: block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 5px;
    background-color: #fff;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

.admin-pagination .page-link:hover {
    background-color: #f8f9fa;
}

.admin-pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    color: #fff;
}

.admin-pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
}

/* Formulários */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.admin-form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.admin-form-control:focus {
    border-color: var(--accent-color);
    outline: none;
}

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

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 5px;
}

/* Botões */
.admin-btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-btn-primary {
    background-color: var(--accent-color);
    color: #fff;
}

.admin-btn-primary:hover {
    background-color: #a88c55;
}

.admin-btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.admin-btn-secondary:hover {
    background-color: #5a6268;
}

.admin-btn-success {
    background-color: var(--success-color);
    color: #fff;
}

.admin-btn-success:hover {
    background-color: #157347;
}

.admin-btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}

.admin-btn-danger:hover {
    background-color: #bb2d3b;
}

.admin-btn-sm {
    padding: 5px 10px;
    font-size: 0.875rem;
}

.admin-btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
}

/* Alertas */
.admin-alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.admin-alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.admin-alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.admin-alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.admin-alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.admin-alert i {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Modais */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.admin-modal.show {
    opacity: 1;
    visibility: visible;
}

.admin-modal-dialog {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.admin-modal.show .admin-modal-dialog {
    transform: translateY(0);
}

.admin-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Timeline */
.admin-timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 20px;
}

.admin-timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.admin-timeline-item:before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--accent-color);
    z-index: 1;
}

.admin-timeline-item:after {
    content: '';
    position: absolute;
    left: -23px;
    top: 15px;
    width: 2px;
    height: calc(100% + 10px);
    background-color: #e0e0e0;
}

.admin-timeline-item:last-child:after {
    display: none;
}

.admin-timeline-date {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.admin-timeline-content {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
}

/* Responsividade */
@media (max-width: 992px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.show {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.sidebar-show {
        margin-left: var(--sidebar-width);
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    .main-content.sidebar-show {
        margin-left: 0;
    }
    
    .sidebar.show {
        width: 100%;
    }
}

/* Tema Escuro */
.dark-mode {
    --primary-color: #121212;
    --accent-color: #d4af37;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .sidebar {
    background-color: #121212;
}

.dark-mode .admin-header,
.dark-mode .admin-card,
.dark-mode .stat-card {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .admin-card-header,
.dark-mode .admin-card-footer {
    border-color: #3d3d3d;
}

.dark-mode .admin-card-footer {
    background-color: #252525;
}

.dark-mode .admin-table th {
    background-color: #252525;
}

.dark-mode .admin-table td,
.dark-mode .admin-table th {
    border-color: #3d3d3d;
}

.dark-mode .admin-table tbody tr:hover {
    background-color: #333;
}

.dark-mode .admin-form-control {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: #e0e0e0;
}

.dark-mode .admin-form-control:focus {
    border-color: var(--accent-color);
}

.dark-mode .toggle-sidebar,
.dark-mode .admin-user-dropdown .dropdown-toggle {
    color: #e0e0e0;
}

.dark-mode .admin-user-dropdown .dropdown-menu {
    background-color: #2d2d2d;
}

.dark-mode .admin-user-dropdown .dropdown-item {
    color: #e0e0e0;
}

.dark-mode .admin-user-dropdown .dropdown-item:hover {
    background-color: #3d3d3d;
}

.dark-mode .admin-user-dropdown .dropdown-divider {
    background-color: #3d3d3d;
}

.dark-mode .admin-pagination .page-link {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .admin-pagination .page-link:hover {
    background-color: #3d3d3d;
}

.dark-mode .admin-timeline-content {
    background-color: #2d2d2d;
}
