/* ============================================================
   CUSTOM — Estilos globais do sistema | cadernopessoas
   ============================================================ */

:root {
    --font-base: 'Inter', system-ui, -apple-system, sans-serif;
    --sidebar-width: 280px;
    --color-primary-dark: #0f172a;
    --color-primary: #1e293b;
    --color-accent: #3b82f6;
    --color-bg-light: #f8fafc;
}

body {
    font-family: var(--font-base);
    background-color: var(--color-bg-light);
}

/* ── Utilities e Cores Frias ── */
.bg-light-blue {
    background-color: var(--color-bg-light) !important;
}

.text-primary {
    color: var(--color-accent) !important;
}

.bg-primary {
    background-color: var(--color-accent) !important;
}

.btn-primary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* ── Sidebar ── */
.sidebar-custom {
    background-color: var(--color-primary-dark);
}

#sidebar-wrapper {
    width: var(--sidebar-width);
    min-height: 100vh;
    flex-shrink: 0;
    transition: margin 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

#sidebar-wrapper.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

#page-content-wrapper {
    min-width: 0;
    flex: 1;
    transition: all 0.3s ease;
}

/* ── Sidebar nav items ── */
#sidebar-wrapper .list-group-item {
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7) !important;
    border-left: 3px solid transparent;
}

#sidebar-wrapper .list-group-item i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    transition: transform 0.2s ease;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    border-left-color: rgba(59, 130, 246, 0.5);
}

#sidebar-wrapper .list-group-item:hover i {
    transform: scale(1.1);
}

#sidebar-wrapper .list-group-item.active {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: var(--color-accent) !important;
    border-left-color: var(--color-accent);
    font-weight: 600;
}

#sidebar-wrapper .list-group-item[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

#sidebar-wrapper .list-group-item .bi-chevron-down {
    transition: transform 0.3s ease;
}

/* ── Sidebar Sections ── */
.sidebar-section-header {
    padding: 1.5rem 1.25rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ── Custom Scrollbar for Sidebar ── */
#sidebar-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar-wrapper::-webkit-scrollbar {
    width: 4px;
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Navbar ── */
.navbar-custom {
    background-color: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* ── Components ── */
.card {
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
}

/* ── Badges de permissão ── */
.badge-admin {
    background-color: #ef4444;
    color: white;
    padding: 0.35em 0.65em;
}

.badge-editor {
    background-color: var(--color-accent);
    color: white;
    padding: 0.35em 0.65em;
}

.badge-visualizador {
    background-color: #64748b;
    color: white;
    padding: 0.35em 0.65em;
}

/* ── Form Inputs ── */
.form-control,
.form-select,
.input-group-text {
    border-color: #e2e8f0;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.smooth-hover {
    transition: all 0.2s ease;
}

.smooth-hover:hover {
    transform: translateY(-2px);
}

/* ── Select2 Bootstrap 5 Standardized ── */
.select2-container--default .select2-selection--single {
    height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal;
    padding-left: 0;
    color: #1e293b;
    width: 100%;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 10px;
    top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent;
    border-width: 5px 4px 0 4px;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #93c5fd;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* Dropdown */
.select2-dropdown {
    border-color: #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 1060;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.5rem;
    margin-bottom: 4px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--color-accent);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #f1f5f9;
    color: var(--color-primary);
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    min-height: 38px;
    padding: 2px 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 2px 8px;
    color: var(--color-primary);
    margin-top: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    margin-right: 5px;
    color: #ef4444;
}
