/* assets/css/style.css - Estilos Globais do Sistema Legis na Nuvem */

:root {
    --primary-color: #5a57d9;
    --secondary-color: #64748b;
    --dark-sidebar: #1e1e2d;
    --active-item: #4338ca;
    --bg-body: #f3f6f9;
    --text-main: #3f4254;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --hover-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --text-main: #e2e8f0;
    --card-bg: #1e293b;
    --dark-sidebar: #0f1014;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: #1e293b;
    --secondary-color: #94a3b8;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    margin: 0;
}

/* Bootstrap Overrides para Modo Escuro */
[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .bg-light {
    background-color: #334155 !important;
}

[data-theme="dark"] .table {
    color: var(--text-main);
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .table-light {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    --bs-table-bg: #1e293b;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-main);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--input-bg);
    color: var(--text-main);
    border-color: var(--primary-color);
}

[data-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    color: var(--text-main);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-main);
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Sidebar do Sistema */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--dark-sidebar);
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-link-text,
.sidebar.collapsed .nav-header,
.sidebar.collapsed .nav-link span:not(.nav-link-text) {
    display: none;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    min-height: 73px;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 1.5rem 0;
}

.nav-item {
    margin: 0.25rem 0.75rem;
    transition: margin 0.3s;
}

.sidebar.collapsed .nav-item {
    margin: 0.25rem 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.nav-link i {
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.9rem 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
}

.sidebar .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .nav-header {
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 700 !important;
}

.sidebar .logo-text,
.sidebar .sidebar-brand i {
    color: #ffffff !important;
}

/* Conteúdo Principal */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-body);
}

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

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--card-bg);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--card-bg);
    padding: 5px 15px 5px 5px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.user-profile span {
    color: var(--text-main);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.premium-card {
    background: var(--card-bg);
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Modais e z-index */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* Inputs */
.form-control,
.form-select {
    z-index: 1;
    position: relative;
}

/* Navegação por Tabs */
.nav-pills .nav-link {
    color: #64748b !important;
    font-weight: 600 !important;
}

.nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05) !important;
}
