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

:root {
    --bg-color: #f7f7f9;
    --card-bg: #ffffff;
    --border-color: #e5e5ea;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --primary-color: #0066cc;
    --hover-bg: #f5f5f7;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 64px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden; /* Evita rolagem dupla */
    margin: 0;
}

/* Layout Estrutura */
#app-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Overlay para Mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

/* Sidebar Estilo Apple/Notion */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1050;
    transition: width 0.3s ease, transform 0.3s ease;
    flex-shrink: 0;
}

#sidebar .brand {
    height: var(--topbar-height); /* 64px */
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza horizontalmente */
    padding: 0 1rem;
    border-bottom: 1px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.brand-logo-full {
    max-height: 52px; /* Aumentado de 42px para 52px */
    width: auto;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform-origin: center;
}

.brand-logo-icon {
    max-height: 42px; /* Aumentado para garantir que fique bem visível quando recolhido */
    width: auto;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 0) scale(0.5);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

#sidebar .nav-item {
    margin: 0.15rem 0.75rem;
}

#sidebar .nav-link {
    color: var(--text-muted);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    background-color: var(--hover-bg);
    color: var(--text-main);
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s;
}

/* Sidebar Recolhida (Desktop) */
body.sidebar-collapsed #sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed #sidebar .nav-link span,
body.sidebar-collapsed #sidebar .sidebar-heading {
    display: none;
    opacity: 0;
}

body.sidebar-collapsed #sidebar .brand .brand-logo-full {
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
}

body.sidebar-collapsed #sidebar .brand .brand-logo-icon {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

body.sidebar-collapsed #sidebar .brand {
    padding: 0;
    justify-content: center;
}

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

body.sidebar-collapsed #sidebar .nav-link i {
    margin: 0;
    font-size: 1.2rem;
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0; /* importate para evitar que flex item transborde */
}

/* Topbar */
#topbar {
    height: var(--topbar-height);
    background-color: var(--bg-color); /* Fundo da topbar acompanhando o fundo geral fica mais moderno, ou card-bg */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Search Bar (Pill) */
.search-wrapper {
    position: relative;
    width: 280px;
}

.search-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrapper input {
    width: 100%;
    border-radius: 50rem;
    border: 1px solid var(--border-color);
    padding: 0.4rem 1rem 0.4rem 2.2rem;
    font-size: 0.85rem;
    background-color: var(--card-bg);
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.search-wrapper input:focus {
    outline: none !important;
    border-color: #4F46E5 !important;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08) !important;
}

/* Utilities Topbar */
.topbar-utils {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    background: transparent;
}

.icon-btn:hover {
    background-color: #e5e5ea;
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50rem;
    transition: background 0.2s;
}

.user-profile:hover {
    background-color: var(--hover-bg);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Content Area */
#content-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 2rem 2rem 2rem;
}

/* Card Moderno (Notion/Apple style) */
.modern-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    padding: 1.5rem;
}

.property-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    padding: 0;
}

.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.property-img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background-color: #f3f4f6;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

/* Tipografia Utilitária */
.text-xs {
    font-size: 0.75rem;
}

/* Responsividade Mobile */
@media (max-width: 992px) {
    #sidebar {
        position: fixed;
        height: 100vh;
        transform: translateX(-100%);
    }
    
    body.sidebar-mobile-show #sidebar {
        transform: translateX(0);
    }
    
    body.sidebar-mobile-show #sidebar-overlay {
        display: block;
    }
    
    body.sidebar-collapsed #sidebar {
        /* no mobile o collapsed não se aplica da mesma forma, ele deve sumir ou aparecer inteiro */
        width: var(--sidebar-width);
    }
    body.sidebar-collapsed #sidebar .brand span.brand-text,
    body.sidebar-collapsed #sidebar .nav-link span,
    body.sidebar-collapsed #sidebar .sidebar-heading {
        display: block;
        opacity: 1;
    }
    body.sidebar-collapsed #sidebar .brand {
        padding: 0 1.5rem;
        justify-content: flex-start;
    }
    body.sidebar-collapsed #sidebar .nav-link {
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
    }
    body.sidebar-collapsed #sidebar .nav-link i {
        margin: 0;
        font-size: 1.1rem;
    }

    #topbar {
        padding: 0 1rem;
    }
    
    #content-area {
        padding: 0 1rem 1rem 1rem;
    }
    
    .search-wrapper {
        display: none; /* Esconde busca no mobile p/ simplificar */
    }
}

 
 / *   K a n b a n   B o a r d   S t y l e s   * / 
 . k a n b a n - w r a p p e r   { 
         d i s p l a y :   f l e x ; 
         g a p :   1 . 2 5 r e m ; 
         o v e r f l o w - x :   a u t o ; 
         p a d d i n g - b o t t o m :   1 r e m ; 
         m i n - h e i g h t :   c a l c ( 1 0 0 v h   -   2 0 0 p x ) ; 
 } 
 . k a n b a n - c o l u m n   { 
         m i n - w i d t h :   3 2 0 p x ; 
         m a x - w i d t h :   3 2 0 p x ; 
         b a c k g r o u n d - c o l o r :   t r a n s p a r e n t ; 
         d i s p l a y :   f l e x ; 
         f l e x - d i r e c t i o n :   c o l u m n ; 
 } 
 . k a n b a n - h e a d e r   { 
         m a r g i n - b o t t o m :   1 r e m ; 
         p a d d i n g - b o t t o m :   0 . 7 5 r e m ; 
         b o r d e r - b o t t o m :   2 p x   s o l i d   # e 5 e 5 e a ; 
         d i s p l a y :   f l e x ; 
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
         a l i g n - i t e m s :   c e n t e r ; 
 } 
 . k a n b a n - c a r d s   { 
         f l e x - g r o w :   1 ; 
         o v e r f l o w - y :   a u t o ; 
         p a d d i n g - r i g h t :   0 . 5 r e m ; 
 } 
 . k a n b a n - c a r d   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - c a r d - b g ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
         b o r d e r - r a d i u s :   0 . 7 5 r e m ; 
         p a d d i n g :   1 . 2 5 r e m ; 
         m a r g i n - b o t t o m :   1 r e m ; 
         b o x - s h a d o w :   0   1 p x   3 p x   r g b a ( 0 , 0 , 0 , 0 . 0 2 ) ; 
         c u r s o r :   g r a b ; 
         t r a n s i t i o n :   t r a n s f o r m   0 . 2 s ,   b o x - s h a d o w   0 . 2 s ; 
 } 
 . k a n b a n - c a r d : h o v e r   { 
         t r a n s f o r m :   t r a n s l a t e Y ( - 2 p x ) ; 
         b o x - s h a d o w :   0   4 p x   6 p x   r g b a ( 0 , 0 , 0 , 0 . 0 5 ) ; 
 } 
 
 / *   S t e p p e r   P i p e l i n e   C R M   * / 
 . p i p e l i n e - s t e p p e r   { 
         d i s p l a y :   f l e x ; 
         w i d t h :   1 0 0 % ; 
         m a r g i n - b o t t o m :   2 r e m ; 
         b a c k g r o u n d :   v a r ( - - c a r d - b g ) ; 
         b o r d e r - r a d i u s :   5 0 r e m ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
         o v e r f l o w :   h i d d e n ; 
 } 
 . p i p e l i n e - s t e p   { 
         f l e x - g r o w :   1 ; 
         t e x t - a l i g n :   c e n t e r ; 
         p a d d i n g :   0 . 7 5 r e m   0 ; 
         f o n t - s i z e :   0 . 8 r e m ; 
         f o n t - w e i g h t :   5 0 0 ; 
         p o s i t i o n :   r e l a t i v e ; 
         c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
 } 
 . p i p e l i n e - s t e p : n o t ( : l a s t - c h i l d ) : : a f t e r   { 
         c o n t e n t :   ' ' ; 
         p o s i t i o n :   a b s o l u t e ; 
         r i g h t :   0 ; 
         t o p :   1 5 % ; 
         h e i g h t :   7 0 % ; 
         w i d t h :   1 p x ; 
         b a c k g r o u n d - c o l o r :   v a r ( - - b o r d e r - c o l o r ) ; 
 } 
 . p i p e l i n e - s t e p . a c t i v e   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - p r i m a r y - c o l o r ) ; 
         c o l o r :   # f f f ; 
 } 
 . p i p e l i n e - s t e p . a c t i v e   ~   . p i p e l i n e - s t e p   { 
         c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
 } 
 . p i p e l i n e - s t e p . c o m p l e t e d   { 
         b a c k g r o u n d - c o l o r :   r g b a ( 0 ,   1 0 2 ,   2 0 4 ,   0 . 1 ) ; 
         c o l o r :   v a r ( - - p r i m a r y - c o l o r ) ; 
 } 
  
 
/* Custom Form Controls (Premium Focus) */
.form-control, .form-select, .form-check-input {
    border-color: #E5E7EB;
    background-color: #ffffff;
    box-shadow: none;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-control:hover, .form-select:hover, .form-check-input:hover {
    border-color: #D1D5DB;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #4F46E5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08) !important;
    outline: none !important;
}

/* Fix para Bootstrap Input Groups */
.input-group:focus-within .input-group-text {
    border-color: #4F46E5 !important;
    box-shadow: none !important;
}

.input-group:focus-within .form-control {
    border-color: #4F46E5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08) !important;
}
