/* assets/css/main.css */
:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --bg-main: #f1f5f9;
    --bg-sidebar: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-on-dark: #f8fafc;
    --white: #ffffff;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-on-dark);
}

.nav-item i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Main Content Wrapper */
.main-wrapper {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cash-badge {
    background: #ecfdf5;
    color: #065f46;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Content Area */
.content {
    padding: 2rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
    outline: none;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.btn:active { transform: scale(0.98); }

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

.card, .stat-card {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.badge {
    font-weight: 600;
    text-transform: uppercase;
}

/* CRM Persistent Widget */
.crm-widget { position: fixed; bottom: 2rem; right: 2rem; z-index: 1000; transition: all 0.3s ease; }
.crm-bubble { width: 60px; height: 60px; background: var(--primary); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white; transition: transform 0.3s ease; border: 2px solid white; }
.crm-bubble:hover { transform: scale(1.1); background: var(--accent); }

.crm-panel { position: fixed; bottom: 6rem; right: 2rem; width: 380px; height: 500px; background: white; border-radius: var(--radius); box-shadow: 0 10px 25px rgba(0,0,0,0.2); display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--border); }
.crm-panel.active { display: flex; animation: slideUp 0.3s ease; }
.crm-panel.fullscreen { width: 100vw; height: calc(100vh - 4rem); bottom: 2rem; right: 2rem; left: 2rem; top: 2rem; width: auto; height: auto; border-radius: var(--radius); z-index: 1100; }

.crm-header { background: var(--primary); color: white; padding: 1rem; display: flex; justify-content: space-between; align-items: center; }
.chat-container { flex: 1; padding: 1.5rem; overflow-y: auto; background: #f8fafc; display: flex; flex-direction: column; }
.chat-msg { margin-bottom: 1rem; padding: 0.75rem 1rem; border-radius: 12px; max-width: 85%; font-size: 0.95rem; line-height: 1.5; }
.chat-msg.client { background: white; align-self: flex-start; border: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.chat-msg.ai { background: var(--primary); color: white; align-self: flex-end; margin-left: auto; }

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