:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --background-color: #f4f7f6;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);

    --status-new: #3498db;
    --status-follow_up: #8e44ad;
    --status-contacted: #f1c40f;
    --status-site_visit: #9b59b6;
    --status-negotiation: #e67e22;
    --status-closed: #2ecc71;
    --status-lost: #e74c3c;

    --priority-very_hot: #dc2626;
    --priority-hot: #e74c3c;
    --priority-warm: #f39c12;
    --priority-cold: #95a5a6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar .brand {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--primary-color);
    margin-right: 20px;
    text-decoration: none !important;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px;
    margin-left: 10px;
    z-index: 1001;
}

.navbar-content {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a, .nav-group-label {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-links a:hover, .nav-group-label:hover {
    background: rgba(74, 144, 226, 0.05);
    color: var(--primary-color);
}

.nav-links a.active, .nav-group-label.active {
    background: rgba(74, 144, 226, 0.08);
    color: var(--primary-color);
}

/* Nav Dropdown Logic */
.nav-group {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-group:hover .nav-dropdown {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1000;
    padding: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    display: none; /* Hide by default */
}

.nav-dropdown a {
    display: block;
    padding: 10px 14px !important;
    font-size: 0.88rem;
    color: #444 !important;
    margin-left: 0 !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-dropdown a:hover {
    background: #f1f5f9;
    color: var(--primary-color) !important;
    padding-left: 18px !important;
}

.nav-dropdown a.sub-active {
    background: rgba(74, 144, 226, 0.05);
    color: var(--primary-color) !important;
    font-weight: 700;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid #eee;
}

.nav-user span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.nav-user .btn-logout {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-user .btn-logout:hover {
    background: #e2e8f0;
    color: #1e293b;
}

@media (max-width: 1024px) {
    .navbar-content { gap: 15px; }
    .nav-links { gap: 2px; }
    .nav-links a { padding: 8px 10px; }
}

@media (max-width: 768px) {
    .navbar {
        padding: 12px 20px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .hamburger {
        display: block !important;
    }

    .navbar-content {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 12px;
        border-top: 1px solid rgba(0,0,0,0.05);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .navbar-content.show-nav {
        display: flex !important;
    }

    .nav-links {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .nav-links a, .nav-group-label {
        width: 100%;
        padding: 12px 15px;
        border-radius: 10px;
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        justify-content: flex-start;
        font-size: 1rem;
    }

    .nav-links a.active, .nav-group-label.active {
        background: rgba(74, 144, 226, 0.1);
        border-color: rgba(74, 144, 226, 0.2);
    }

    /* Mobile Dropdown adjustment */
    .nav-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 5px;
    }

    .nav-dropdown {
        position: static;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding: 5px 0 5px 20px;
        margin-top: 5px;
        background: transparent;
        min-width: 0;
        width: 100%;
    }

    .nav-group:hover .nav-dropdown {
        display: none !important;
    }

    .nav-group.mobile-open .nav-dropdown {
        display: block !important;
    }


    .nav-dropdown a {
        background: transparent;
        border: none;
        border-left: 2px solid #e2e8f0;
        border-radius: 0;
        margin-bottom: 2px;
    }

    .nav-user {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #eee;
        padding-top: 15px;
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
} /* END OF MOBILE MEDIA QUERY */

.d-flex.justify-between {
    display: flex;
    justify-content: space-between;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #444;
}

/* Dashboard Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.stat-card {
    text-align: center;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-card .label {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Forms & Inputs */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.col {
    flex: 1;
    padding: 10px;
    min-width: 250px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: var(--status-closed);
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.very_hot {
    background: var(--priority-very_hot);
}

.badge.hot {
    background: var(--priority-hot);
}

.badge.warm {
    background: var(--priority-warm);
}

.badge.cold {
    background: var(--priority-cold);
}

.badge.new {
    background: var(--status-new);
}

.badge.contacted {
    background: var(--status-contacted);
}

.badge.site_visit {
    background: var(--status-site_visit);
    color: white;
}

.badge.negotiation {
    background: var(--status-negotiation);
}

.badge.closed {
    background: var(--status-closed);
}

.badge.follow_up {
    background: var(--status-follow_up);
    color: white;
}

.badge.lost {
    background: var(--status-lost);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    border: 1px solid #eee;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: #fcfcfc;
}

/* Timeline for activities */
.timeline {
    border-left: 2px solid #eee;
    padding-left: 20px;
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
}

.timeline-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
}

.timeline-content {
    background: #f9f9f9;
    padding: 12px;
    border-radius: var(--border-radius-sm);
}

/* Utility */
.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-2 {
    gap: 10px;
}

.gap-3 {
    gap: 15px;
}

.text-muted {
    color: #888;
}

.text-danger {
    color: #e74c3c;
}