/* ===================================
   ERP BRISAS - MODERN DESIGN SYSTEM
   Professional Real Estate CRM Interface
   =================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===================================
   CSS RESET & BASE STYLES
   =================================== */

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

:root {
    /* Brand Colors */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Success Colors */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-200: #a7f3d0;
    --success-300: #6ee7b7;
    --success-400: #34d399;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;
    --success-800: #065f46;
    --success-900: #064e3b;
    
    /* Warning Colors */
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    /* Error Colors */
    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-200: #fecaca;
    --error-300: #fca5a5;
    --error-400: #f87171;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;
    --error-800: #991b1b;
    --error-900: #7f1d1d;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000000;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    
    /* Border Radius */
    --radius-sm: 0.125rem;
    --radius-base: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-3xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-all: all 0.15s ease-in-out;
    --transition-colors: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
    --transition-transform: transform 0.15s ease-in-out;
    
    /* Layout */
    --sidebar-width: 220px;
    --header-height: 70px;
    --mobile-breakpoint: 768px;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
}

/* ===================================
   BASE STYLES
   =================================== */

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
    padding: var(--space-4);
}

.login-container {
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    margin-bottom: var(--space-8);
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary-600);
    margin-bottom: var(--space-4);
}

.login-logo h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.login-logo p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-label i {
    margin-right: var(--space-2);
    color: var(--primary-600);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    transition: var(--transition-colors);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
    width: 100%;
    background: var(--primary-600);
    color: var(--white);
    border: none;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.login-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.login-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.error {
    background: var(--error-50);
    color: var(--error-700);
    border: 1px solid var(--error-200);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.875rem;
}

/* ===================================
   LAYOUT STRUCTURE
   =================================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
    display: flex;
    flex-direction: column;
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-2xl);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    margin-bottom: var(--space-4);
}

.sidebar-logo i {
    font-size: 2rem;
    color: var(--primary-400);
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-400), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-welcome {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500), #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--white);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--white);
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0 !important;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 18px !important;  /* Antes era var(--space-8), pode ser 18px */
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px !important;   /* Antes era var(--space-4), pode ser 8px */
    padding: 0 10px !important;      /* Ajuste se necessário */
}

.nav-section ul {
    list-style: none;
}

.nav-section li {
    margin-bottom: 2px !important;   /* Antes era var(--space-1), pode ser 2px */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 7px 10px !important;    /* Antes era var(--space-4) var(--space-6), pode ser 7px 24px */
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.93rem !important;   /* Ajuste o tamanho da fonte se quiser menor */
    transition: var(--transition-all);
    position: relative;
    border-radius: 0 var(--radius-2xl) var(--radius-2xl) 0;
    margin-right: 0 !important;      /* Remove espaço extra */
    min-height: 34px !important;     /* Altura mínima, opcional */
}

.nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: linear-gradient(135deg, var(--primary-400), #60a5fa);
    border-radius: 0 var(--radius-base) var(--radius-base) 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(59, 130, 246, 0.15);
    color: var(--white);
    transform: translateX(8px);
}

.nav-link:hover::before,
.nav-link.active::before {
    height: 100%;
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

.nav-text {
    flex: 1;
}

.nav-indicator {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--primary-400);
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
    margin-right: 18px !important; /* aumenta a distância para a direita */
}

.nav-link.active .nav-indicator {
    opacity: 1;
}

.sidebar-footer {
    padding: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    transition: var(--transition-all);
}

.logout-btn:hover {
    color: var(--error-400);
    background: rgba(239, 68, 68, 0.1);
    transform: translateX(4px);
}

.logout-icon {
    font-size: 1.125rem;
}

/* Mobile Toggle Button */
.mobile-toggle {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: calc(var(--z-fixed) + 1);
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-all);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.mobile-toggle:hover {
    background: var(--gray-50);
    box-shadow: var(--shadow-xl);
    transform: translateY(-1px);
}

.mobile-toggle i {
    font-size: 1rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-fixed) - 1);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-all);
    backdrop-filter: blur(4px);
}

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

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

.content {
    margin-left: 0;
    padding: var(--space-8);
    min-height: 100vh;
    width: 100%;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-header {
    margin-bottom: var(--space-8);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.page-header h1 i {
    font-size: 2rem;
    color: var(--primary-600);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin: var(--space-2) 0 0 0;
    font-weight: 400;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.date-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--white);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    font-weight: 500;
    color: var(--gray-700);
}

.date-info i {
    color: var(--primary-600);
}

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

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.metric-card {
    background: var(--white);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: var(--transition-all);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), #60a5fa);
}

.metric-card.primary::before {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.metric-card.success::before {
    background: linear-gradient(90deg, var(--success-500), var(--success-600));
}

.metric-card.warning::before {
    background: linear-gradient(90deg, var(--warning-500), var(--warning-600));
}

.metric-card.info::before {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
}

.metric-card.primary .metric-icon {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

.metric-card.success .metric-icon {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
}

.metric-card.warning .metric-icon {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
}

.metric-card.info .metric-icon {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-1);
}

.metric-sublabel {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
}

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

@media (max-width: 768px) {
    .content {
        padding: var(--space-4);
        margin-left: 0;
    }
    
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .metric-card {
        padding: var(--space-4);
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .mobile-toggle {
        padding: var(--space-2) var(--space-3);
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: var(--space-3);
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }
    
    .metric-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
}

/* ===================================
   DESKTOP STYLES
   =================================== */

@media (min-width: 1000px) {
    .sidebar {
        transform: translateX(0);
        position: fixed;
    }
    
    .content {
        margin-left: var(--sidebar-width);
    }
    
    .mobile-toggle {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: var(--space-4);
}

.text-center {
    text-align: center;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

//scroll da :horizontal
.sidebar {
    overflow-x: hidden !important;
}

.sidebar-nav {
    overflow-x: hidden !important;
}

::-webkit-scrollbar {
    height: 0px;
}
.card-stat {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-top: 4px solid #059669;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.card-stat .card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.card-stat .card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
