/* ========================================
   INVESTIMÓVEL CRM - SISTEMA ADMINISTRATIVO
   Cores: Laranja (#ff6600) + Preto (#000000)
   ======================================== */

:root {
    /* Cores principais */
    --primary-color: #ff6600;
    --primary-dark: #e65c00;
    --primary-light: #ff8533;
    --secondary-color: #000000;
    --secondary-dark: #1a1a1a;
    --secondary-light: #333333;
    
    /* Cores de estado */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Cores neutras */
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --gray-100: #f8f9fc;
    --gray-200: #e3e6f0;
    --gray-300: #d1d3e2;
    --gray-400: #b7b9cc;
    --gray-500: #858796;
    --gray-600: #5a5c69;
    --gray-700: #3a3b45;
    --gray-800: #2c2c34;
    
    /* Layout */
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    overflow-x: hidden;
}

/* ========================================
   ADMIN HEADER (CRM)
   ======================================== */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-header .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.admin-header .header-logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.admin-site-logo {
    display: block;
    width: 180px;
    max-width: 42vw;
    height: auto;
}

.admin-header .user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.admin-header .user-info:hover {
    background-color: rgba(255, 102, 0, 0.1);
}

.admin-header .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

.user-avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.admin-header .user-info > div {
    color: white;
}

.admin-header .btn-icon {
    background: transparent;
    border: 1px solid rgba(255, 102, 0, 0.3);
    color: var(--primary-color);
}

.admin-header .btn-icon:hover {
    background: rgba(255, 102, 0, 0.1);
    border-color: var(--primary-color);
}

/* ========================================
   SIDEBAR (CRM)
   ======================================== */
.admin-sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    overflow: hidden;
    transition: width 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.admin-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   SIDEBAR FOOTER
   ======================================== */
.sidebar-footer {
    flex-shrink: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0.375rem 0.5rem;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    white-space: nowrap;
}

.sidebar-footer-btn:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.sidebar-footer-btn i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-footer-btn span {
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.admin-sidebar.collapsed .sidebar-footer-btn span {
    display: none;
}

.admin-sidebar.collapsed .sidebar-footer-btn {
    justify-content: center;
    width: 100%;
}

/* ========================================
   SIDEBAR TOGGLE BUTTON (position: fixed independente)
   ======================================== */

/* Estado expandido: botão DENTRO do aside, flush à margem direita */
.sidebar-toggle-btn {
    position: fixed;
    left: var(--sidebar-width);
    bottom: .1rem;
    transform: translate(-100%, -50%);
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 0 2px 0 0;
    margin: 0;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: left 0.3s ease, transform 0.3s ease, background 0.2s,
                color 0.2s, border-radius 0.3s ease, box-shadow 0.3s ease;
    line-height: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

/* Estado recolhido: botão FORA do aside, como aba colada à margem direita */
.sidebar-toggle-btn.sidebar-collapsed {
    left: var(--sidebar-collapsed-width);
    transform: translate(0, -50%);
    background: white;
    border: 1px solid var(--gray-200);
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-toggle-btn.sidebar-collapsed:hover {
    background: var(--gray-100);
}

/* Ícones inline SVG — herdam color via currentColor */
.sidebar-toggle-btn svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

/* Controle de visibilidade */
.sidebar-toggle-btn .sidebar-icon-collapse { display: block; }
.sidebar-toggle-btn .sidebar-icon-expand   { display: none;  }

.sidebar-toggle-btn.sidebar-collapsed .sidebar-icon-collapse { display: none;  }
.sidebar-toggle-btn.sidebar-collapsed .sidebar-icon-expand   { display: block; }

/* Ocultar no mobile */
@media (max-width: 767.98px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
    position: relative;
}

.sidebar-menu a:hover {
    background-color: var(--gray-100);
    color: var(--primary-color);
}

.sidebar-menu a.active {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    font-weight: 600;
}

.sidebar-menu a i {
    font-size: 1.1rem;
    width: 20px;
    flex-shrink: 0;
}

.sidebar-menu a span:not(.badge) {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-menu .badge {
    margin-left: auto;
    transition: all 0.2s ease;
}

/* Sidebar collapsed - Desktop */
.admin-sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 1rem;
}

.admin-sidebar.collapsed .sidebar-menu a span:not(.badge) {
    display: none;
}

.admin-sidebar.collapsed .sidebar-menu a i {
    font-size: 1.25rem;
    width: auto;
}

.admin-sidebar.collapsed .sidebar-menu .badge {
    position: absolute;
    top: 5px;
    right: 10px;
    margin-left: 0;
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    min-width: 18px;
}

.admin-sidebar.collapsed .sidebar-menu a.active {
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
}

/* Tooltip flutuante quando sidebar está collapsed */
.admin-sidebar.collapsed .sidebar-menu a::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    margin-left: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Seta do tooltip */
.admin-sidebar.collapsed .sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--secondary-color);
    opacity: 0;
    visibility: hidden;
    z-index: 1001;
    margin-left: -2px;
    pointer-events: none;
}

.admin-sidebar.collapsed .sidebar-menu a:hover::after,
.admin-sidebar.collapsed .sidebar-menu a:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MAIN CONTENT (CRM)
   ======================================== */
.admin-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

.admin-content.full-width {
    margin-left: var(--sidebar-collapsed-width);
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #2c3e50;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0.5rem 0 0 0;
    font-size: 0.875rem;
}

/* ========================================
   STAT CARDS (CRM)
   ======================================== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card.primary .stat-icon {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
}

.stat-card.success .stat-icon {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

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

.stat-card.info .stat-icon {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card .stat-change.positive {
    color: var(--success-color);
}

.stat-card .stat-change.negative {
    color: var(--danger-color);
}

/* ========================================
   DATA TABLES (CRM)
   ======================================== */
.data-table-wrapper {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

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

.table-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

h2.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.dashboard-chart-wrap {
    position: relative;
    height: 280px;
    min-height: 280px;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.875rem;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
}

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

.custom-table thead {
    background-color: var(--gray-100);
}

.custom-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.custom-table tbody tr {
    transition: background-color 0.2s;
}

.custom-table tbody tr:hover {
    background-color: var(--gray-100);
}

/* ========================================
   BADGES (CRM)
   ======================================== */
.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.novo {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--primary-color);
}

.status-badge.contatado {
    background-color: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.status-badge.convertido {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.perdido {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.status-badge.publicado {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.status-badge.rascunho {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
}

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

/* ========================================
   FORMS (CRM)
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: block;
}

.form-control,
/* Ajuste específico para o select */
.form-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    width: 100%;


.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    outline: none;
}

/* ========================================
   BUTTONS (CRM)
   ======================================== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

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

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: white;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline-danger {
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    background: white;
}

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Botões de ação com hover outline */
.btn-icon.btn-primary:hover {
    background-color: transparent !important;
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

.btn-icon.btn-warning:hover {
    background-color: transparent !important;
    color: var(--bs-warning) !important;
    border-color: var(--bs-warning) !important;
}

.btn-icon.btn-danger:hover {
    background-color: transparent !important;
    color: var(--bs-danger) !important;
    border-color: var(--bs-danger) !important;
}

.btn-icon.btn-success:hover {
    background-color: transparent !important;
    color: var(--bs-success) !important;
    border-color: var(--bs-success) !important;
}

/* ========================================
   MODALS (CRM)
   ======================================== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

/* ========================================
   UTILITIES (CRM)
   ======================================== */
.view-switcher {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.view-switcher button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.view-switcher button.active {
    background: var(--primary-color);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-200);
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    white-space: normal;
    word-wrap: break-word;
}

.empty-state p {
    color: var(--gray-500);
    white-space: normal;
    word-wrap: break-word;
}

/* Quando a tabela só tem empty-state, ajustar */
.custom-table:has(.empty-state) {
    min-width: 0 !important;
}

.table-responsive:has(.empty-state) {
    overflow-x: visible;
}

.post-editor {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.post-editor .preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.post-editor textarea {
    min-height: 300px;
    font-family: monospace;
}

/* ========================================
   PAGE CONTENT ANIMATION (CRM)
   ======================================== */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* ========================================
   LOADING (CRM)
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */
body.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    position: relative;
    width: 100%;
    background:
        linear-gradient(160deg, rgba(8,8,8,.80) 0%, rgba(15,15,15,.70) 55%, rgba(20,10,0,.80) 100%),
        url('../img/vista-poa.jpg') center center / cover no-repeat fixed;
}

body.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 15% 50%, rgba(255,102,0,.18) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 80%, rgba(255,102,0,.14) 0%, transparent 40%);
    pointer-events: none;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(160deg, #0d0d0d 0%, #1a1a1a 60%, #111 100%);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
    color: white;
    border-bottom: 3px solid #ff6600;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255,102,0,.18) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(255,102,0,.12) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand {
    margin-bottom: 0.6rem;
    position: relative;
    display: flex;
    justify-content: center;
}

.login-site-logo {
    display: block;
    width: 260px;
    max-width: 100%;
    height: auto;
}

.login-tagline {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255,255,255,.45);
    margin: 0;
    position: relative;
}

.login-body {
    padding: 2.5rem 2rem;
}

.input-group-custom {
    position: relative;
}

.input-group-custom .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #858796;
    font-size: 1.1rem;
    z-index: 2;
}

.login-page .form-control {
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: var(--gray-100);
}

.login-page .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.1);
    background-color: white;
}

.login-page .form-control::placeholder {
    color: #a8b2c1;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #858796;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 2;
    user-select: none;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-left: 0.5rem;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
    letter-spacing: 0.5px;
    margin-top: 20px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.5);
    background: linear-gradient(135deg, #ff8533 0%, #ff9d5c 100%);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    margin-left: 0.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-danger i {
    font-size: 1.2rem;
}

.login-footer {
    padding: 1.5rem 2rem;
    background-color: var(--gray-100);
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.back-to-site {
    position: absolute;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.back-to-site a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 102, 0, 0.3);
}

.back-to-site a:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.3);
    background: rgba(0, 0, 0, 1);
    border-color: var(--primary-color);
}

.back-to-site a i {
    color: var(--primary-color);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #858796;
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.divider span {
    padding: 0 1rem;
}

.demo-credentials {
    background: linear-gradient(135deg, #fff3e6 0%, #ffe6cc 100%);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 2px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.demo-credentials strong {
    display: block;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.demo-credentials strong i {
    font-size: 1rem;
    color: var(--primary-color);
}

.demo-credentials p {
    margin: 0.25rem 0;
    color: var(--secondary-color);
    font-size: 0.8125rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

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

.btn-login.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-login.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 0.75rem;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   SIDEBAR OVERLAY (Mobile)
   ======================================== */
.sidebar-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

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

/* Tablet e abaixo */
@media (max-width: 992px) {
    .admin-content {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile landscape e abaixo */
@media (max-width: 768px) {
    /* Header centralizado */
    .admin-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
    }
    
    .admin-header .header-logo {
        position: static;
        transform: none;
        text-align: center;
        justify-self: center;
    }

    .admin-site-logo {
        width: 160px;
    }

    .admin-sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .admin-sidebar.collapsed {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    /* No mobile, mostrar texto completo mesmo se estava collapsed no desktop */
    .admin-sidebar.show .sidebar-menu a {
        justify-content: flex-start;
        padding: 0.875rem 1.5rem;
    }
    
    .admin-sidebar.show .sidebar-menu a span:not(.badge) {
        display: inline;
    }
    
    .admin-sidebar.show .sidebar-menu .badge {
        position: static;
        margin-left: auto;
        font-size: 0.75rem;
        padding: 0.25em 0.5em;
    }
    
    .admin-sidebar.show .sidebar-menu a.active {
        border-left: 3px solid var(--primary-color);
        border-bottom: none;
    }

    .admin-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .admin-content.full-width {
        margin-left: 0;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }

    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    /* Filtros em coluna no mobile com 100% largura */
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .table-actions .search-box {
        width: 100%;
        min-width: 0;
    }
    
    .table-actions .form-select {
        min-width: 0 !important;
        width: 100% !important;
    }
    
    .table-actions .btn {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.8rem;
        justify-content: center;
    }

    .search-box input {
        width: 100%;
        min-width: 0;
    }
    
    /* Tabelas responsivas - scroll horizontal */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }
    
    .custom-table {
        min-width: 500px;
    }
    
    .custom-table th,
    .custom-table td {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Empty state visível - sem scroll horizontal quando vazio */
    .custom-table:has(.empty-state) {
        min-width: 0 !important;
    }
    
    .table-responsive:has(.empty-state) {
        overflow-x: visible !important;
    }
    
    .custom-table .empty-state {
        min-width: auto;
        padding: 2rem 1rem;
    }
    
    .custom-table td[colspan] {
        text-align: center;
        white-space: normal;
    }
    
    /* Cards responsivos */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
    
    /* Stats cards */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    /* Botões e ações */
    .btn-group-sm > .btn,
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Modal responsivo */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Form responsivo */
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    /* Paginação */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.875rem;
    }
}

/* Mobile portrait */
@media (max-width: 576px) {
    .admin-header {
        padding: 0 0.5rem;
    }
    
    .admin-header .header-logo {
        max-width: 55vw;
    }

    .admin-site-logo {
        width: 140px;
    }
    
    .admin-header .btn-icon {
        padding: 0.375rem 0.5rem;
    }
    
    .admin-content {
        padding: 0.5rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    /* Filtros em coluna única com 100% largura */
    .table-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .table-actions .search-box,
    .table-actions .form-select,
    .table-actions .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
    
    .table-actions .btn {
        justify-content: center;
    }
    
    /* Stats em coluna única em telas muito pequenas */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tabela com menos largura mínima */
    .custom-table {
        min-width: 400px;
    }
    
    /* Empty state ajustado */
    .empty-state {
        padding: 1.5rem 0.5rem;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state h3 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.875rem;
    }
    
    /* Botões de ação em linha */
    .table .btn-group,
    .table td:last-child {
        display: flex;
        flex-direction: row;
        gap: 0.25rem;
    }
    
    /* Login responsivo */
    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .login-site-logo {
        width: 210px;
    }

    .login-body {
        padding: 2rem 1.5rem;
    }

    .login-footer {
        padding: 1.25rem 1.5rem;
    }

    .back-to-site {
        top: 1rem;
        left: 1rem;
    }

    .back-to-site a {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    /* Sidebar em tela cheia no mobile */
    .admin-sidebar {
        width: 80vw;
        max-width: 280px;
    }
    
    /* Select e inputs menores */
    .form-select {
        padding: 0.625rem 1rem;
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        font-size: 1rem;
        transition: border-color 0.2s;
        width: 100%;
    }
    }
    
    /* Data table wrapper */
    .data-table-wrapper {
        padding: 0.75rem;
    }
    
    .data-table-wrapper h2 {
        font-size: 1.1rem;
    }
}

/* ========================================
   MODAL EDITOR DE POST — LAYOUT LARGO
   ======================================== */
.modal-post-editor {
    max-width: 95vw;
    width: 95vw;
    margin: 2.5vh auto;
}

.modal-post-editor .modal-content {
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-post-editor .modal-body {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0;
}

.modal-post-editor #postForm {
    height: 100%;
}

.modal-post-editor .row.g-0.h-100 {
    height: 100%;
}

#postFormFields::-webkit-scrollbar {
    width: 6px;
}
#postFormFields::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

/* Editor Monaco: garante fill correto */
#monaco-editor-container .overflow-guard,
#monaco-editor-container .monaco-editor {
    border-radius: 6px;
}
