/* Main Stylesheet for ABR File Exchange System */

:root {
    /* Color Palette */
    --bg: #0a0a0a;
    --surface: #141414;
    --surface2: #1e1e1e;
    --surface3: #2a2a2a;
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.15);
    
    --text: #ffffff;
    --text2: #a0a0a0;
    --text3: #626262;
    
    --green: #2d9e6b;
    --green-hover: #34b279;
    --green-light: rgba(45, 158, 107, 0.15);
    --green-text: #4ade9e;
    
    --red: #df4747;
    --red-hover: #ef5757;
    --red-light: rgba(223, 71, 71, 0.15);
    
    --blue: #3b82f6;
    --blue-light: rgba(59, 130, 246, 0.15);
    
    /* Layout & Spacing */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Elements */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    height: 100dvh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Generic Utilities */
.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text2) !important;
}

.text-sm {
    font-size: 13px !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border2);
}

/* Screens & Containers */
.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Login screen centers its card */
#login-screen.active {
    align-items: center;
    justify-content: center;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text2);
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-light);
}

select option {
    background: var(--surface2);
    color: var(--text);
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text3);
}

.checkboxes-grid {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: var(--green);
    color: var(--text);
}

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

.btn-secondary {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface3);
    border-color: var(--border2);
}

.btn-text {
    background: transparent;
    color: var(--text2);
    font-size: 13px;
    padding: 6px 12px;
}

.btn-text:hover {
    color: var(--text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-danger {
    background: var(--red-light);
    border-color: rgba(223, 71, 71, 0.2);
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

/* Login Card styling */
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    backdrop-filter: blur(10px);
}

.login-card .logo-container {
    margin-bottom: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-dots {
    display: flex;
    gap: 7px;
    margin-bottom: 9px;
}

.logo-dots span {
    width: 7px;
    height: 7px;
    background-color: var(--text);
    border-radius: 50%;
    display: inline-block;
}

.login-card .logo {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: lowercase;
    line-height: 1;
    margin-left: -3px;
}

.login-card form {
    text-align: left;
}

.login-card #relogin-change-user {
    margin-top: 16px;
}

/* Dashboard container */
.app-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex: 1;
    background: var(--bg);
}

/* Sidebar styling */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-top {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-top .logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.sidebar-top .logo-dots {
    gap: 5px;
    margin-bottom: 6px;
}

.sidebar-top .logo-dots span {
    width: 5px;
    height: 5px;
}

.sidebar-top .logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text);
    text-transform: lowercase;
    line-height: 1;
    margin-left: -3px;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text3);
    padding: 0 10px 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text2);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.menu-item.active {
    background: var(--green-light);
    color: var(--green-text);
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    display: inline-flex;
    justify-content: center;
}

.menu-icon-svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    background: var(--green);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text3);
    text-transform: lowercase;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text3);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    color: var(--red);
    background: var(--red-light);
}

.logout-icon {
    width: 18px;
    height: 18px;
}

/* Main Content Area styling */
.content-area {
    flex: 1;
    min-height: 0;
    height: 100%;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tab Switching animation/display */
.tab-content {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.15s ease-in-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    opacity: 1;
}

/* List/Table Container defaults */
.list-container {
    flex: 1;
    min-height: 0;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
}

.list-header {
    flex-shrink: 0;
}

.list-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.list-header .subtext {
    font-size: 13px;
    color: var(--text2);
}

.flex-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Tables */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}

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

.data-table th,
.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--surface);
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}

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

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.data-table td.actions-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Status markers in tables */
.status-pill {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.status-pill.new {
    background: var(--blue-light);
    color: var(--blue);
}

.status-pill.routed {
    background: var(--green-light);
    color: var(--green-text);
}

/* Chat Tab styling */
.chat-container {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 24px 30px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.chat-header .subtext {
    font-size: 12px;
    color: var(--text3);
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Message bubbles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    animation: messageFadeIn 0.3s ease-out;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.msg-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    position: relative;
    word-break: break-word;
}

.message.user .msg-bubble {
    background: var(--green-light);
    border: 1px solid rgba(45, 158, 107, 0.3);
    color: var(--text);
    border-bottom-right-radius: 4px;
}

.message.assistant .msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.msg-file-attach {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}

.msg-file-attach .file-icon {
    font-size: 16px;
}

.msg-meta {
    font-size: 10px;
    color: var(--text3);
    margin-top: 4px;
    align-self: flex-end;
}

.message.assistant .msg-meta {
    align-self: flex-start;
}

/* File Preview above Input */
.file-preview-bar {
    padding: 10px 30px;
    background: var(--surface2);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius);
}

.file-info-pill .file-name {
    font-size: 13px;
    font-weight: 500;
}

.file-info-pill .file-size {
    font-size: 11px;
    color: var(--text3);
}

.btn-close-pill {
    background: transparent;
    border: none;
    color: var(--text2);
    font-size: 20px;
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.btn-close-pill:hover {
    color: var(--red);
}

/* Chat input field */
.chat-input-area {
    padding: 20px 30px 30px;
    background: var(--bg);
    display: flex;
    align-items: center;
    gap: 16px;
}

.chat-attach-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text2);
    transition: var(--transition);
}

.chat-attach-btn:hover {
    background: var(--surface2);
    border-color: var(--border2);
    color: var(--text);
}

.chat-attach-btn svg {
    width: 20px;
    height: 20px;
}

.chat-input-area input[type="text"] {
    flex: 1;
    height: 48px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0 20px;
    font-size: 14px;
}

.chat-input-area input[type="text"]:focus {
    border-color: var(--green);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--green);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--green-hover);
    transform: translateY(-1px);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

/* Loading animations */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 8px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text3);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

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

/* Modals styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: modalFade 0.2s ease-out;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 460px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-card.modal-lg {
    max-width: 640px;
}

.modal-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.modal-header h3 {
    margin-bottom: 0;
}

.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text3);
    cursor: pointer;
    padding: 0 4px;
}

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

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inline-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.flex-1 {
    flex: 1;
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.max-h-300 {
    max-height: 300px;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

@keyframes modalFade {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Toast System styling */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    color: var(--text);
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: var(--transition);
}

.toast.error {
    border-left-color: var(--red);
}

.toast.info {
    border-left-color: var(--blue);
}

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

/* Admin lists layouts */
.admin-only {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 12px;
}


/* --- Dialogue Archive Tree & Calendar CSS --- */

.tree-node {
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.tree-node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.tree-node-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tree-node-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.tree-node-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    color: var(--text3);
}

.tree-node.expanded > .tree-node-header .tree-node-chevron {
    transform: rotate(90deg);
}

.tree-node-content {
    display: none;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
    padding: 12px 20px;
}

.tree-node.expanded > .tree-node-content {
    display: block;
}

/* Department Node styles */
.dept-node {
    margin: 8px 0;
    border-color: rgba(255, 255, 255, 0.05);
}

.dept-node-header {
    padding: 10px 16px;
    background: var(--bg);
}

/* User Node styles */
.user-node {
    margin: 6px 0;
    border: 1px dashed var(--border);
}

.user-node-header {
    padding: 8px 12px;
    background: transparent;
}

/* Mini Calendar CSS */
.mini-calendar-container {
    padding: 12px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    max-width: 320px;
}

.calendar-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    padding: 0 4px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.calendar-weekday {
    font-size: 10px;
    font-weight: 600;
    color: var(--text3);
    text-transform: uppercase;
    padding-bottom: 4px;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: default;
    user-select: none;
    transition: var(--transition);
}

.calendar-cell.day {
    background: transparent;
    border: none;
    color: var(--text3);
    opacity: 0.6;
}

.calendar-cell.empty-cell {
    background: transparent;
    border: none;
    color: transparent;
    pointer-events: none;
}

/* Calendar status colors */
.calendar-cell.filled {
    background: var(--surface3);
    border-color: var(--border2);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.calendar-cell.filled:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text2);
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.calendar-cell.unread-active {
    background: #2d9e6b;
    border-color: #4ade9e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    animation: pulse-green 2s infinite;
}

.calendar-cell.unread-active:hover {
    background: #34b279;
    box-shadow: 0 0 8px rgba(74, 222, 158, 0.5);
}

/* Selected calendar day styling */
.calendar-cell.selected-day {
    border-color: var(--text);
    outline: 1px solid var(--text);
}

/* Dialogues list under calendar */
.dialogues-day-list {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.dialogues-day-list-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dialogue-summary-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.dialogue-summary-row:hover {
    border-color: var(--border2);
    background: var(--surface3);
}

.dialogue-summary-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialogue-time {
    font-size: 11px;
    color: var(--text3);
    font-weight: 600;
}

.dialogue-summary-text-line {
    font-size: 12px;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialogue-summary-row.unread-row {
    border-left: 3px solid var(--green);
}

/* Dot indicator for tree counts */
.tree-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--surface3);
    color: var(--text2);
}

.tree-badge.has-unread {
    background: var(--green);
    color: #fff;
    font-weight: 600;
}


/* Admin Chats Layout */
.chats-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

.chats-sidebar {
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.chats-sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.chats-sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.chats-sidebar-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.users-list-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    overflow-y: auto;
    flex: 1;
}

.user-item-btn {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.user-item-btn:hover {
    background: var(--surface3);
    border-color: var(--border2);
}

.user-item-btn.active {
    background: var(--green-light);
    border-color: var(--green);
    color: var(--green-text);
}

.user-item-name {
    font-weight: 600;
    font-size: 13.5px;
}

.user-item-role {
    font-size: 11px;
    color: var(--text3);
    margin-top: 4px;
}

.chats-main {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.chat-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text3);
    text-align: center;
    padding: 40px;
}

.chat-placeholder svg {
    width: 64px;
    height: 64px;
    stroke: var(--text3);
}

.chat-placeholder p {
    font-size: 14px;
    max-width: 400px;
    line-height: 1.5;
}

/* Chat timeline dividers */
.chat-divider-session {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0 12px;
    color: var(--text3);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-divider-session::before,
.chat-divider-session::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 16px;
}

.chat-divider-date {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}

.chat-divider-date span {
    background: var(--surface3);
    color: var(--text2);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Interactive Attachments */
.msg-file-attach.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.msg-file-attach.clickable:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--green);
}


