/* Custom CSS for the Dashboard */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-color: #f4f7f9;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 70px;
    --sidebar-bg: #1e1e2d;
    --sidebar-color: #d1d1d1;
    --active-link-bg: #353549;
    --active-link-border: #667eea;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    /* FIX: Reduced base font size for a more compact feel */
    font-size: 0.95rem;
}

/* Login Page Styling */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-box {
    width: 100%;
    max-width: 450px;
    background-color: white;
    border-radius: 1.5rem;
}

/* Main Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation - Refactored for a modern look */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
}

.sidebar-collapsed {
    width: var(--sidebar-width-collapsed);
}

/* UPDATED: Changed to a vertical layout */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    padding: 0 1rem;
    transition: all 0.3s ease-in-out;
}
.sidebar-header h5 {
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 0.5rem; /* Reduced margin */
    white-space: nowrap;
    transition: opacity 0.1s ease-in-out;
}
.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.5rem 0.25rem;
}
.sidebar-collapsed .sidebar-header h5 {
    opacity: 0;
    width: 0;
.card .form-label {
    white-space: normal;
    word-break: break-word;
}

    overflow: hidden;
.card .form-select {
    min-width: 140px;
}
    margin: 0;
}
.sidebar-toggle-button {
    color: var(--sidebar-color);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.sidebar-collapsed .sidebar-toggle-button {
    margin-left: 0;
}

.sidebar-logo {
    width: 80px;
    height: auto;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px;
    transition: all 0.3s ease-in-out;
}
.sidebar-collapsed .sidebar-logo {
    width: 40px;
}

.sidebar-user-info {
    font-size: 0.8rem;
    opacity: 0.8;
    padding: 0 1rem;
    margin-bottom: 5px;
    line-height: 1.2;
    transition: all 0.3s ease-in-out;
}
.sidebar-collapsed .sidebar-user-info {
    display: none;
}
.sidebar-user-info p {
    margin: 0;
}
.sidebar-user-info strong {
    font-weight: 500;
    display: block;
    color: #e2e8f0;
}

.sidebar-nav-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
}
.sidebar-nav-container::-webkit-scrollbar {
    width: 8px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}


/* FIX: New navigation link styling */
.nav-link {
    color: var(--sidebar-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease-in-out;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    margin: 0.25rem 0;
}
.nav-link i {
    font-size: 1.2rem;
    margin-right: 1rem;
    transition: all 0.3s ease-in-out;
}
.sidebar-collapsed .nav-link i {
    margin-right: 0;
}
.nav-link span {
    transition: opacity 0.1s ease-in-out;
}
.sidebar-collapsed .nav-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Hover and Active states */
.nav-link:hover {
    color: #fff;
    background-color: var(--active-link-bg);
}
.nav-link.active {
    color: #fff;
    background-color: var(--active-link-bg);
    border-left: 4px solid var(--active-link-border);
    padding-left: calc(1rem - 4px);
}
.sidebar-collapsed .nav-link.active {
    border-left: none;
    padding-left: 0.75rem;
    border-bottom: 4px solid var(--active-link-border);
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Submenu styling */
.submenu {
    list-style: none;
    padding-left: 2.5rem; /* Indent sub-items */
    margin: 0;
    transition: all 0.3s ease-in-out;
}
.submenu .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
.submenu .nav-link.active {
    border-left: 2px solid var(--active-link-border);
    padding-left: calc(1rem - 2px);
}
.sidebar-collapsed .submenu {
    display: none;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
}
.sidebar-collapsed .sidebar-footer {
    padding: 0.5rem;
}

.sidebar-toggle-button {
    color: white;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease-in-out;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

#page-content {
    flex-grow: 1;
    padding: 1.5rem;
}

/* Other global styles */
.page-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem; /* FIX: Reduced margin-bottom */
    font-size: 1.75rem;
}
.card {
    border: none;
    border-radius: 0.75rem;
}
.table {
    font-size: 0.9rem;
}

/* NEW: Password toggle styling */
.password-container {
    position: relative;
}

.toggle-password-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
    z-index: 10; /* Ensures the button is clickable */
}

.toggle-password-btn:hover {
    color: #333;
}

/* WhatsApp UI Specific Styles */

/* Main chat container to hold both panels side-by-side */
.whatsapp-ui-container {
    display: flex;
    height: calc(100vh - 120px); /* Adjust based on header/footer */
    border-radius: 1rem;
    overflow: hidden;
}

/* Left panel for chat list */
.chat-list-panel {
    width: 35%;
    min-width: 300px;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
}

/* Right panel for active chat */
.chat-messages-panel {
    flex-grow: 1;
    width: 65%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom right, #f8f9fa, #e9ecef);
}

/* Chat List Item Styling */
.chat-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9edef;
    cursor: pointer;
    transition: background-color 0.2s;
}
.chat-list-item:hover, .chat-list-item.active {
    background-color: #e6e9ed;
}

.chat-list-item .chat-info {
    flex-grow: 1;
    margin-left: 10px;
    overflow: hidden;
}

.chat-list-item h6 {
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #212529;
}
.chat-list-item p {
    margin: 0;
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-list-item small {
    font-size: 0.7rem;
    color: #aeb4b9;
}

/* Chat Header Styling */
.chat-header {
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.chat-header h5 {
    margin: 0;
    font-weight: 500;
}
.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    color: #fff;
    margin-right: 10px;
}

/* Message Container & Bubbles */
.message-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity=".07" ><path fill="#000" d="M36 29c-6.6 0-12 5.4-12 12s5.4 12 12 12 12-5.4 12-12-5.4-12-12-12zm28-4c-6.6 0-12 5.4-12 12s5.4 12 12 12 12-5.4 12-12-5.4-12-12-12zM24 71c-6.6 0-12 5.4-12 12s5.4 12 12 12 12-5.4 12-12-5.4-12-12-12zM60 67c-6.6 0-12 5.4-12 12s5.4 12 12 12 12-5.4 12-12-5.4-12-12-12z"/></svg>');
    background-size: 100px;
}
.message-bubble {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    max-width: 75%;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.message-bubble.sent {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    text-align: right;
}

.message-bubble.received {
    background-color: #fff;
    color: #212529;
    align-self: flex-start;
    margin-right: auto;
    text-align: left;
}

.message-bubble .message-text {
    margin: 0;
}
.message-bubble .message-time {
    display: block;
    font-size: 0.7rem;
    color: #a0a0a0;
    margin-top: 5px;
}
.message-bubble.sent .message-time {
    color: #e9d5ff;
}

.message-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: none;
}
.message-bubble:hover .message-actions {
    display: block;
}

/* Chat Input Area */
.chat-input-footer {
    padding: 10px 20px;
    background-color: #f0f2f5;
    border-top: 1px solid #e2e8f0;
}
.chat-input-footer .form-control {
    border-radius: 20px;
    background-color: #fff;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    box-shadow: none;
    transition: all 0.2s ease-in-out;
}
.chat-input-footer .form-control:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 0.25rem rgba(106, 17, 203, 0.25);
}

/* ===== ANALYTICS & VISIT DASHBOARD STYLING ===== */

/* Card Component Styling */
.ojas-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}
.ojas-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Card Header Styling */
.ojas-card-header {
    font-weight: 600;
    font-size: 1rem;
    color: #2d3748;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f2f5;
}

/* Badge Styling */
.badge-soft {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    background-color: #ede9fe;
    color: #6d28d9;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}
.badge-soft.badge-primary {
    background-color: #dbeafe;
    color: #1e40af;
}
.badge-soft.badge-success {
    background-color: #dcfce7;
    color: #15803d;
}
.badge-soft.badge-warning {
    background-color: #fef3c7;
    color: #b45309;
}
.badge-soft.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}
.badge-soft.badge-info {
    background-color: #ecf0fe;
    color: #4c51bf;
}

/* Section Title Styling */
.section-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0;
}

/* Summary Card Styling - Enhanced */
.summary-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #667eea;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease-in-out;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}
.summary-card.primary {
    border-left-color: #667eea;
}
.summary-card.success {
    border-left-color: #48bb78;
}
.summary-card.warning {
    border-left-color: #ed8936;
}
.summary-card.danger {
    border-left-color: #f56565;
}

.summary-card .stat-label {
    font-size: 0.85rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.summary-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0.5rem 0;
}
.summary-card .stat-unit {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* Table Styling - Enhanced */
.recent-visits-table-wrapper,
.analytics-table-wrapper {
    overflow-x: auto;
}
.recent-visits-table-wrapper table,
.analytics-table-wrapper table {
    margin-bottom: 0;
}
.recent-visits-table-wrapper thead th,
.analytics-table-wrapper thead th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.recent-visits-table-wrapper tbody td,
.analytics-table-wrapper tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #4a5568;
}
.recent-visits-table-wrapper tbody tr,
.analytics-table-wrapper tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease-in-out;
}
.recent-visits-table-wrapper tbody tr:hover,
.analytics-table-wrapper tbody tr:hover {
    background-color: #f7fafc;
}

/* Progress Bar Styling */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.progress-bar-container .value {
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}
.progress {
    flex-grow: 1;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease-in-out;
}
.progress-bar.bg-success {
    background-color: #48bb78;
}
.progress-bar.bg-warning {
    background-color: #ed8936;
}
.progress-bar.bg-danger {
    background-color: #f56565;
}
.progress-bar.bg-info {
    background-color: #4299e1;
}

/* Filter Control Styling */
.filter-control label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.85rem;
}
.filter-control .form-control,
.filter-control .form-select {
    border-color: #cbd5e0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out;
}
.filter-control .form-control:focus,
.filter-control .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Button Styling - Enhanced */
.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
.btn-primary:hover {
    background-color: #5568d3;
    border-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-outline-secondary {
    color: #718096;
    border-color: #cbd5e0;
    font-weight: 500;
}
.btn-outline-secondary:hover {
    color: #2d3748;
    background-color: #f7fafc;
    border-color: #a0aec0;
}

/* Info Box / Alert Box Styling */
.info-box {
    padding: 1rem;
    background-color: #eff6ff;
    border-left: 4px solid #4299e1;
    border-radius: 0.5rem;
    color: #1e3a8a;
    font-size: 0.9rem;
}
.alert-box {
    padding: 1rem;
    background-color: #fef2f2;
    border-left: 4px solid #f56565;
    border-radius: 0.5rem;
    color: #742a2a;
    font-size: 0.9rem;
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0aec0;
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 1rem;
    margin: 0;
}

/* Filter Card Styling */
.filter-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.filter-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: #ccc;
}

.filter-card .card-title {
    color: #2d3748;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 0;
}

.form-label {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control,
.form-select {
    border: 1px solid #e0e0e0;
    border-radius: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:hover,
.form-select:hover {
    border-color: #999;
}

/* Responsive adjustments for filters */
@media (max-width: 992px) {
    .filter-card {
        padding: 1.5rem !important;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .filter-card {
        padding: 1rem !important;
    }
    
    .filter-card .card-title {
        font-size: 1rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Button styling for filters */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.3s ease;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    color: white;
}

.btn-secondary {
    background-color: #e0e0e0;
    border: 1px solid #d0d0d0;
    color: #4a5568;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #d0d0d0;
    border-color: #c0c0c0;
    color: #4a5568;
}

