/* 
 * assets/css/styles.css
 * Hoja de estilos principal (Desktop First)
 */

:root {
    --primary-color: #0f172a; /* Slate 900 */
    --secondary-color: #3b82f6; /* Blue 500 */
    --bg-color: #f8fafc; /* Slate 50 */
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    
    /* Heatmap Colors for Lead Score */
    --score-cold: #cbd5e1; /* Slate 300 */
    --score-warm: #fef08a; /* Yellow 200 */
    --score-hot:  #fca5a5; /* Red 300 */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: var(--primary-color);
    color: white;
    padding-top: 0;
    transition: width 0.3s ease;
    overflow: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 60px;
}

.sidebar-header .sidebar-brand {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    transition: background 0.2s, color 0.2s, padding 0.3s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar a i {
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar a .sidebar-text {
    margin-left: 10px;
    transition: opacity 0.2s;
}

.sidebar a:hover, .sidebar a.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-brand .sidebar-text {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed a .sidebar-text {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed a {
    padding: 12px 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 15px 8px;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

.sidebar.collapsed .sidebar-logout .sidebar-text {
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .sidebar-logout {
    justify-content: center;
    padding: 12px 0;
}

/* Tooltip for collapsed sidebar */
.sidebar.collapsed a[title] {
    position: relative;
}

/* HTML class based collapsed state for early load flicker prevention */
.sidebar-collapsed .sidebar {
    width: 60px;
}
.sidebar-collapsed .main-content {
    margin-left: 60px;
}
.sidebar-collapsed .sidebar-text {
    display: none;
}

/* No transition utility to prevent flash/sliding on load */
.no-transition, .no-transition * {
    transition: none !important;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    padding: 0 30px 30px 30px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 60px;
}

/* Sticky Page Header */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-color);
    padding: 20px 0 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

/* Sticky Table Headers (global) */
.main-content .table-responsive {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.main-content thead th {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Responsive (Since it's Desktop First) */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        margin-left: 0;
    }
}

/* Kanban specific styles */
.kanban-board {
    display: flex;
    overflow-x: auto;
    padding-bottom: 20px;
    gap: 15px;
}

.kanban-col {
    min-width: 300px;
    background-color: #f1f5f9;
    border-radius: 6px;
    padding: 10px;
}

.kanban-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
}

/* Auth Cards */
.login-card {
    max-width: 400px;
    margin: 10vh auto;
    padding: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Inline Editable Component */
.inline-editable {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-main);
    resize: none;
    overflow: hidden;
    transition: border-color 0.2s, background-color 0.3s, box-shadow 0.2s;
    line-height: 1.4;
}

.inline-editable:hover {
    border-color: var(--border-color);
    background: #f8fafc;
}

.inline-editable:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.inline-editable.ie-saving {
    opacity: 0.6;
}

.inline-editable.ie-success {
    background-color: #d1fae5 !important;
    border-color: #10b981 !important;
    transition: background-color 0.15s;
}

.inline-editable.ie-error {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
}
