:root {
    --bg-main: #f5f7fb;
    --bg-card: #ffffff;
    --border-light: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: #718096;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --gradient-1: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --kpi-1: #3b82f6; /* Day 1 - Blue */
    --kpi-2: #8b5cf6; /* Weekly - Purple */
    --kpi-3: #10b981; /* Monthly - Green */
    --kpi-4: #f59e0b; /* Total - Orange */
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    --font-family: 'Inter', sans-serif;
    --border-radius: 12px; /* Sharper, more professional border radius */
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    transition: var(--transition);
}

.view {
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

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

/* Card Styles */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.text-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 600;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Forms & Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(79, 172, 254, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(79, 172, 254, 0.4);
}

/* Unique Refresh Button Style */
.btn-unic-refresh {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white !important;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-unic-refresh:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}

.btn-unic-refresh:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--accent);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 50%;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.text-danger { color: var(--danger); }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.text-center { text-align: center; }

/* Unified Dashboard Frame */
.dashboard-unified-frame {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem; /* Spacious gap between sections inside the frame */
}

/* Remove internal borders/shadows when inside the unified frame */
.dashboard-unified-frame .kpi-grid,
.dashboard-unified-frame .data-panel,
.dashboard-unified-frame .charts-section-frame {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.dashboard-unified-frame .kpi-card {
    background: #f8fafc; /* Subtle light background for internal sections */
    border: 1px solid var(--border-light);
}
.mx-auto { margin-left: auto; margin-right: auto; }
.justify-center { justify-content: center !important; }

/* Login View */
#login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.login-container h3 {
    margin: 1.5rem 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.input-group input, .form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: #fdfdfd;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}
.form-control, .form-select { padding-left: 1rem; }
.form-select option { background: white; }

.input-group input:focus, .form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* Dashboard Layout */
.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin: 1rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 300px;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    padding: 4rem 1.5rem;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.08);
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2050;
    gap: 0.5rem;
    align-items: stretch;
    display: flex;
}

.nav-links .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.8rem 1rem;
    gap: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    flex: none;
    width: 100%;
}

.nav-links .nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-links.active {
    right: 0;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 2040;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

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

.mobile-menu-btn {
    display: flex; /* Always flex now */
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    z-index: 2001;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.mobile-menu-btn:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .top-navbar {
        margin: 0;
        border-radius: 0;
        padding: 0.75rem 1rem;
        top: 0;
    }

    .nav-actions {
        display: none;
    }
}

.nav-extra-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    margin-right: 1.5rem;
}

.view-home-btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .nav-extra-actions {
        margin-right: 0.75rem;
    }
    .view-home-btn span {
        display: none;
    }
    .view-home-btn {
        padding: 0.5rem;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 1.1rem;
    }
}

.profile-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.dashboard-content {
    padding: 0 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 1.5rem;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--accent);
}

.kpi-icon.highlight {
    background: var(--gradient-1);
    color: white;
}

.kpi-title {
    font-size: 1.25rem;
    color: #000000;
    font-weight: 800;
}

.kpi-date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 24px; /* Fixed height for alignment */
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.kpi-date-display {
    font-weight: 500;
}

.kpi-calendar-btn {
    position: relative;
    cursor: pointer;
    color: var(--accent);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.kpi-calendar-btn:hover {
    color: var(--accent-hover);
}

.kpi-date-picker {
    position: absolute;
    top: 0; left: 0;
    width: 20px; height: 20px;
    opacity: 0;
    cursor: pointer;
}

.kpi-value-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 50px; /* Standardize value space */
    margin-top: 0.25rem;
}

.kpi-value {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.editable-value[contenteditable="true"], .editable-title[contenteditable="true"], .editable-trend[contenteditable="true"] {
    cursor: text;
    border-bottom: 1px dashed var(--border-light);
    min-width: 2ch;
    display: inline-block;
    padding: 0 4px;
}

.editable-value[contenteditable="true"]:hover, .editable-title[contenteditable="true"]:hover, .editable-trend[contenteditable="true"]:hover {
    background: rgba(0, 0, 0, 0.05);
}

.editable-value[contenteditable="true"]:focus, .editable-title[contenteditable="true"]:focus, .editable-trend[contenteditable="true"]:focus {
    outline: none;
    border-bottom-color: var(--accent);
    background: rgba(0, 0, 0, 0.05);
}

.edit-icon {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: var(--transition);
}

.editable-card:hover .edit-icon, .logo-area:hover .edit-icon {
    opacity: 1;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    height: 20px;
    margin-top: 0.4rem;
}

.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-secondary); }

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-1);
    transition: width 1s ease;
}

/* Charts Section */
.charts-section-frame {
    background: #ffffff;
    padding: 2.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--card-shadow);
}

.charts-grid {
    display: flex;
    flex-wrap: wrap; /* Still wrap for mobile/tablet */
    gap: 32px;
    justify-content: center;
    width: 100%;
}

@media (min-width: 1200px) {
    .charts-grid {
        flex-wrap: nowrap; /* Force 3-in-a-row on desktop */
    }
}

.chart-container {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    height: 340px;
    max-width: 460px;
    width: 100%;
    flex: 1 1 300px;
    margin: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

/* Specific overrides when inside a unified frame */
.charts-section-frame .chart-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.chart-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.canvas-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    max-height: 240px;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Data Panel / Table */
.data-panel {
    padding: 1.5rem;
}

/* WhatsApp Style Client Cards */
.whatsapp-list-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-top: 15px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.whatsapp-card {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f2f2f2;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    gap: 16px;
}

.whatsapp-card:last-child {
    border-bottom: none;
}

.whatsapp-card:hover {
    background-color: #f8fafc;
}

.whatsapp-card .avatar-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #064e3b; /* Deep forest green to match referral */
    color: #10b981; /* High-contrast light green icon */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(6, 78, 59, 0.15);
}

.whatsapp-card .card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.whatsapp-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.whatsapp-card .client-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whatsapp-card .card-date {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.whatsapp-card .card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.whatsapp-card .client-subtext {
    font-size: 0.88rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.whatsapp-card .status-indicator {
    margin-left: 8px;
    flex-shrink: 0;
}

.whatsapp-card .card-actions-overlay {
    opacity: 1;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px;
    background: #ffffff;
    padding: 5px 8px;
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    visibility: visible;
    border: 1px solid var(--border-light);
    z-index: 5;
}

.whatsapp-card {
    padding-right: 175px; /* Balanced space for 4 persistent buttons */
}

@media (max-width: 480px) {
    .whatsapp-card {
        padding-right: 160px;
    }
    .whatsapp-card .card-actions-overlay {
        gap: 4px;
        padding: 4px 6px;
    }
    .whatsapp-card .action-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
}

.whatsapp-card .action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-card .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.whatsapp-card .action-btn.call { color: var(--primary); }
.whatsapp-card .action-btn.wa { color: #22c55e; }
.whatsapp-card .action-btn.edit { color: var(--accent); }
.whatsapp-card .action-btn.delete { color: var(--danger); }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th, .table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}
.status-new { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.status-contacted { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.status-converted, .status-closed { background: rgba(16, 185, 129, 0.1); color: #059669; }

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .modal {
        align-items: flex-end;
    }
    .modal-content {
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 2rem);
        transform: translateY(100%);
    }
    .modal:not(.hidden) .modal-content {
        transform: translateY(0);
    }
}

.modal.hidden .modal-content {
    transform: translateY(-20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

.close-modal:hover { color: var(--text-primary); }

.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.chart-edit-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.chart-edit-row > div:first-child {
    flex: 1;
    font-weight: 500;
}
.chart-edit-row input {
    width: 100px;
    text-align: right;
}

/* Public Home Styles */
.public-nav { justify-content: space-between; }
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.display-title {
    font-size: 2.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}
.public-content { padding-top: 2rem; }

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}
.toast {
    background: #ffffff;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease forwards;
    opacity: 0;
    transform: translateX(100%);
}
.toast i { font-size: 1.25rem; }
.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--accent); }

.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* KPI Specific Color Utilities */
.text-kpi-1 { color: var(--kpi-1) !important; }
.text-kpi-2 { color: var(--kpi-2) !important; }
.text-kpi-3 { color: var(--kpi-3) !important; }
.text-kpi-4 { color: var(--kpi-4) !important; }

/* Visibility Utilities */
.hide-desktop { display: none !important; }

@media (max-width: 1024px) {
    .hide-desktop { display: inline-flex !important; }
}

@keyframes slideInRight {
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; }
}


@media (max-width: 768px) {
    .nav-links { display: none !important; }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: var(--transition);
    flex: 1;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid { 
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .chart-container { 
        min-height: 220px; 
        padding: 1.5rem;
    }
    .chart-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .chart-header h3 { font-size: 1rem; }
    .chart-span-2 { grid-column: span 1; }
}
@media (max-width: 768px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .header-actions { display: none; }
    .dashboard-header { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
    
    /* Flutter Style Sticky App Bar */
    .top-navbar { 
        flex-direction: column; 
        gap: 1rem; 
        position: sticky; 
        top: 0; 
        z-index: 100; 
        backdrop-filter: blur(10px); 
        background: rgba(255,255,255,0.9); 
        padding: 1rem; 
        margin: 0; 
        border-radius: 0; 
        box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    }
    .public-content { padding-top: 1rem; }
    
    /* WhatsApp content replaced with general styles above */
    .table-responsive { border: none; overflow: visible; background: transparent; padding: 0; }
    .table { display: block; border: none; background: transparent; width: 100%; }
    .table thead { display: none; }
    .table tbody { display: block; width: 100%; }
    
    .table tr {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        border-radius: 20px;
        margin-bottom: 1.25rem;
        padding: 1.25rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
        border: 1px solid var(--border-light);
        position: relative;
        gap: 0.4rem;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .table tr:active { transform: scale(0.98); box-shadow: 0 4px 10px rgba(0,0,0,0.03); }

    .table td { display: block; padding: 0; border: none; text-align: left; }
    .table td::before { display: none !important; }

    .name-cell { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.1rem; padding-right: 80px !important; }
    
    .contact-city-cell { display: flex; gap: 15px; color: var(--text-secondary); font-size: 0.85rem; }
    .phone-cell::before { content: "\f095"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 6px; opacity: 0.7; }
    .city-cell::before { content: "\f3c5"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 6px; opacity: 0.7; }

    .address-cell { color: var(--text-secondary); font-size: 0.85rem; margin-top: 2px; }
    .company-service-cell { margin-top: 8px; font-size: 0.9rem; }
    .company-cell { font-weight: 600; color: var(--text-primary); }
    .company-cell::after { content: " | "; margin: 0 5px; color: var(--border-light); }
    .service-cell { color: var(--accent); font-weight: 500; }

    .price-mode-cell {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f8fafc;
        padding: 10px 14px !important;
        border-radius: 12px;
        margin-top: 10px;
    }
    .price-cell { font-weight: 800; color: var(--success); font-size: 1.15rem; }
    .mode-cell { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

    .date-cell { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; opacity: 0.7; }
    
    .status-cell { position: absolute; top: 1.25rem; right: 1.25rem; }
    
    .actions-cell {
        border-top: 1px dashed var(--border-light);
        margin-top: 10px;
        padding-top: 12px !important;
    }
    .actions-wrapper { display: flex; gap: 8px; justify-content: flex-end; }
    .icon-btn.btn-sm { width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--border-light); display: flex; align-items: center; justify-content: center; font-size: 1rem; }
    
    .desktop-only { display: none !important; }

    /* Clean Mobile FAB */
    .floating-add-btn {
        position: fixed;
        bottom: 30px;
        right: 20px;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: var(--gradient-1);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
        border: none;
        z-index: 1000;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .floating-add-btn:active { transform: scale(0.9); }
    .floating-add-btn i { font-size: 1.5rem; margin: 0; padding: 0; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .kpi-card { padding: 1.25rem; min-height: 180px; }
    .kpi-icon { width: 45px; height: 45px; font-size: 1.25rem; }
    .kpi-value { font-size: 1.75rem; }
    .kpi-title { font-size: 0.9rem; }
    .kpi-date-row { font-size: 0.75rem; }
    .chart-container { min-height: 320px; padding: 15px; }
    .display-title { font-size: 1.5rem; }
}
