@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0068FF;
    --primary-hover: #0056d6;
    --bg-light: #f4f6f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-bg: #0b1a30;
    --sidebar-active: rgba(0, 104, 255, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --header-height: 60px;
    --sidebar-width: 260px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}


/* Header styling */
.header {
    height: var(--header-height);
    background: linear-gradient(135deg, #0f1d33 0%, #1e293b 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}


.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

.header-logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-tool-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-tool-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 8px;
    font-weight: 700;
    border: 1px solid var(--primary);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.user-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    border: 2px solid rgba(255,255,255,0.8);
}

.user-profile-name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Layout columns */
.app-container {
    display: flex;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    width: 100%;
}

/* Sidebar styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: linear-gradient(180deg, #0b1a30 0%, #071222 100%);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}


.sidebar-account-panel {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
}

/* Accordion categories */
.menu-group {
    display: flex;
    flex-direction: column;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.group-header:hover {
    color: white;
    background: rgba(255,255,255,0.02);
}

.group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.group-title svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.arrow-icon {
    transition: transform 0.2s ease;
}

.menu-group.open .arrow-icon {
    transform: rotate(90deg);
}

/* Submenu items */
.submenu-list {
    list-style: none;
    display: none;
    flex-direction: column;
    padding-left: 0.5rem;
    background: rgba(0,0,0,0.15);
}

.menu-group.open .submenu-list {
    display: flex;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    margin: 0.1rem 0.5rem;
    transition: var(--transition);
}

.submenu-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
}

.submenu-item.active {
    color: white;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}


/* Main Content styling */
.main-content {
    flex-grow: 1;
    height: 100%;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Cards styling */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.15rem;
}

/* Action Buttons */
.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

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

.btn-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--error);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    border-radius: 6px;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.input-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.1);
}

textarea.input-control {
    resize: vertical;
    min-height: 80px;
}

/* Grid helper */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Tables styling */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

/* Tab contents SPA */
.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

/* Status colors and badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #e0f2fe; color: #075985; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.4rem;
}
.status-dot.active { background-color: var(--success); }
.status-dot.failed { background-color: var(--error); }
.status-dot.unlinked { background-color: var(--text-muted); }

/* Chat Hub layout (white theme) */
.chathub-container {
    display: grid;
    grid-template-columns: 280px 1fr auto;
    height: 100%;
    min-height: 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

/* Chat Info Sidebar (Notes & Reminders) */
.chat-info-sidebar {
    width: 280px;
    height: 100%;
    border-left: 1px solid var(--border-color);
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    min-height: 0;
    animation: slideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from { width: 0; opacity: 0; }
    to { width: 280px; opacity: 1; }
}

.info-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.info-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.info-tab-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.02);
}

.info-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #ffffff;
}

.info-sidebar-content {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.info-tab-pane {
    display: none;
    height: 100%;
    flex-direction: column;
    min-height: 0;
}

.info-tab-pane.active {
    display: flex;
}

/* Note items styling */
.note-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    position: relative;
    border-left: 3px solid #64748b;
}

.note-item-text {
    font-size: 0.8rem;
    color: var(--text-main);
    line-height: 1.4;
    word-break: break-word;
}

.note-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.btn-delete-note {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.1rem;
    font-weight: 500;
}

.btn-delete-note:hover {
    text-decoration: underline;
}

/* Reminder items styling */
.reminder-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--primary);
}

.reminder-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.reminder-item-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.reminder-item-repeat {
    font-size: 0.65rem;
    color: var(--success);
    margin-top: 0.2rem;
    font-weight: 500;
}

.reminder-item-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

.btn-delete-reminder {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
}

.btn-delete-reminder:hover {
    text-decoration: underline;
}

.input-small {
    padding: 0.4rem 0.5rem !important;
    font-size: 0.78rem !important;
    border-radius: 6px !important;
}

.conversations-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    height: 100%;
    min-height: 0;
}

.sidebar-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.conversations-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.chat-card:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.chat-card.active {
    background: #f0f7ff;
    border-left-color: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.05);
}


.chat-card .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-card-body {
    flex-grow: 1;
    overflow: hidden;
}

.chat-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

.chat-card-time {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.chat-card-preview {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fafafb;
    overflow: hidden;
    min-height: 0;
}

.chat-window-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
}

.chat-window-messages {
    flex-grow: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.chat-bubble {
    max-width: 65%;
    padding: 0.8rem 1.1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}

.chat-bubble.incoming {
    align-self: flex-start;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px 16px 16px 16px;
    color: #0f172a;
}

.chat-bubble.outgoing {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.bubble-meta {
    font-size: 0.65rem;
    color: rgba(0, 0, 0, 0.45);
    margin-top: 0.25rem;
    text-align: right;
    opacity: 0.75;
}

.chat-bubble.outgoing .bubble-meta {
    color: rgba(255, 255, 255, 0.85);
}


.chat-window-input-area {
    padding: 0.9rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
}

#chat-input {
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

#chat-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

#btn-chat-send {
    border-radius: 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    padding: 0.6rem 1.25rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    font-weight: 700;
}

#btn-chat-send:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.chat-window-input-area label[for="chat-files"] {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    border-radius: 50% !important;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
}

.chat-window-input-area label[for="chat-files"]:hover {
    background: #e2e8f0;
    color: #475569;
    transform: scale(1.05);
}

/* Micro-animations and hover transitions for recall message button */
.undo-msg-btn {
    transition: transform 0.2s ease, color 0.2s ease;
}
.undo-msg-btn:hover {
    color: #ef4444 !important;
    transform: scale(1.15) rotate(-30deg);
}


.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.5rem;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-close {
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.modal-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Toast Notifications Container */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-notification {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 250px;
    display: flex;
    align-items: center;
    animation: slideIn 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.toast-notification.success { border-left-color: var(--success); }
.toast-notification.error { border-left-color: var(--error); }
.toast-notification.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Bulk progress indicator */
.progress-container {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
}

/* Pagination component */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.pagination-btn {
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.pagination-btn:hover {
    background: #f8fafc;
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.action-link {
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.action-link.blue { color: var(--primary); }
.action-link.blue:hover { text-decoration: underline; }
.action-link.red { color: var(--error); }
.action-link.red:hover { text-decoration: underline; }
.action-link.grey { color: var(--text-muted); }
.action-link.grey:hover { text-decoration: underline; }
.action-link.green { color: var(--success); }
.action-link.green:hover { text-decoration: underline; }

/* Premium List Container & Items */
.list-wrapper {
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 550px;
    max-height: 600px;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
    cursor: pointer;
}

.list-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.list-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.list-item .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #ffffff;
    box-shadow: 0 0 0 1px var(--border-color);
}

.list-item .item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.list-item .item-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 20px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary);
}
input:checked + .slider:before {
    transform: translateX(18px);
}

/* Monitored group list select wrapper */
.group-checklist {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    background: #ffffff;
}
.group-checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}
.group-checklist-item:hover {
    background: #f1f5f9;
}
.group-checklist-item input {
    cursor: pointer;
}

/* Dynamic Scheduling Configuration Section */
.schedule-config-section {
    background: rgba(16, 185, 129, 0.04);
    border: 1px dashed rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.schedule-config-section label {
    color: #065f46;
}

.schedule-config-section input.enable-schedule-chk {
    accent-color: var(--success);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Notification Dropdown styles */
.notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 320px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

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

.notifications-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    background: #f8fafc;
}

.notifications-list {
    max-height: 350px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 104, 255, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.notification-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.notification-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.notification-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* Chat overview tab height containment */
#tab-chat-overview {
    height: calc(100vh - var(--header-height) - 3rem);
    min-height: 0;
    overflow: hidden;
}
#tab-chat-overview .card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Custom Searchable Dropdown Style */
.custom-select-container {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    text-align: left;
}

.custom-select-trigger:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.1);
    outline: none;
}

.custom-select-trigger::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 10px;
}

.custom-select-container.open .custom-select-trigger::after {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.25rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    display: none;
    flex-direction: column;
    max-height: 300px;
    overflow: hidden;
}

.custom-select-container.open .custom-select-dropdown {
    display: flex;
}

.custom-select-search-wrapper {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.custom-select-search {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
}

.custom-select-search:focus {
    border-color: var(--primary);
}

.custom-select-options {
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.custom-select-option {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.1s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    display: block;
    height: auto;
    min-height: 36px;
    box-sizing: border-box;
}

.custom-select-option:hover {
    background: #f1f5f9;
}

.custom-select-option.selected {
    background: #e0f2fe;
    color: var(--primary);
    font-weight: 600;
}

.custom-select-option.no-results {
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
    cursor: default;
}
.custom-select-option.no-results:hover {
    background: transparent;
}

/* Custom styling for Member Data Table */
.member-table-wrapper {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.member-data-table {
    border-collapse: collapse;
    width: 100%;
}
.member-data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 2px solid var(--border-color);
}
.member-data-table th, .member-data-table td {
    padding: 8px 10px;
    text-align: left;
}
.member-data-table tbody tr {
    transition: background 0.15s ease;
}
.member-data-table tbody tr:hover {
    background: #f1f5f9 !important;
}
.member-data-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}
.role-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}
.range-select-tool input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    outline: none;
    transition: var(--transition);
}
.range-select-tool input:focus {
    border-color: var(--primary);
}
.pagination-controls button {
    cursor: pointer;
    transition: var(--transition);
}
.pagination-controls button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Spinner Animation */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Profile Dropdown */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}
.profile-dropdown.show {
    display: block;
    animation: fadeInDown 0.2s ease;
}
.profile-dropdown-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
    color: var(--text-main) !important;
}
.profile-dropdown-item:hover {
    background: var(--bg-hover);
}
.profile-dropdown-item.text-danger {
    color: var(--error);
}
.profile-dropdown-divider {
    border-top: 1px solid var(--border-color);
    margin: 0.25rem 0;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile Card */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    max-width: 600px;
}
.profile-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.profile-info-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}
.profile-info-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Badge variants */
.badge-primary {
    background: var(--primary);
    color: white;
}
.badge-secondary {
    background: #64748b;
    color: white;
}

/* Single menu items (no submenu) */
.single-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem 0.75rem 0.75rem !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border-radius: 8px !important;
    margin: 0.1rem 0.5rem !important;
    transition: var(--transition) !important;
}

.single-menu-item:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.single-menu-item svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2px !important;
}

.single-menu-item.active {
    color: white !important;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}


/* ==================== RESPONSIVE MOBILE STYLING ==================== */
@media (max-width: 768px) {
    /* Card Title alignment on small screens */
    .card-title {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }
    
    .card-title div {
        width: 100% !important;
    }
    
    .card-title style, .card-title div + div, .card-title [style*="display:flex"] {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }
    
    /* Header modifications */
    .sidebar-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .header-logo-text {
        font-size: 1rem !important;
    }
    
    /* Layout */
    .app-container {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        z-index: 999;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: var(--header-height) 0 0 0;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(1px);
        z-index: 998;
        animation: fadeInMobile 0.2s ease;
    }
    
    @keyframes fadeInMobile {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Content Padding */
    .main-content {
        padding: 1rem;
        gap: 1rem;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Form grids stacking */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Card layouts */
    .card {
        padding: 1rem;
    }
    
    /* Tables horizontal scroll */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* ChatHub responsive layout */
    .chathub-container {
        grid-template-columns: 1fr !important;
    }
    
    /* Conversational state controls */
    .chathub-container .conversations-sidebar {
        display: flex;
        width: 100%;
    }
    
    .chathub-container .chat-window {
        display: none;
        width: 100%;
    }
    
    .chathub-container .chat-info-sidebar {
        display: none !important; /* hide info panel on mobile */
    }
    
    /* When a chat window is active on mobile */
    body.chat-window-active .chathub-container .conversations-sidebar {
        display: none !important;
    }
    
    body.chat-window-active .chathub-container .chat-window {
        display: flex !important;
    }
    
    body.chat-window-active #btn-chat-back {
        display: flex !important;
    }
    
    /* Hide some user elements in top header to save space */
    .user-profile-name {
        display: none !important;
    }
    
    .user-profile-badge {
        padding: 0.25rem !important;
    }
    
    /* Modal Card adjustments for phone screens */
    .modal-card {
        width: 95% !important;
        margin: 0.5rem !important;
        max-height: 90vh !important;
    }
    
    /* Custom controls padding */
    .btn {
        padding: 0.55rem 1rem !important;
    }
    
    .input-control {
        padding: 0.55rem 0.75rem !important;
    }
}
