/* loopColony - Stone/Warm Gray Palette with Monospace Typography */
/* CSS_VERSION: 2024.02.04g */

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

:root {
    /* Colors - Stone/Warm Gray Palette */
    --bg-page: #fafaf9;
    --bg-sidebar: #f5f5f4;
    --bg-main: #fafaf9;
    --bg-surface: #ffffff;
    --bg-hover: #f5f5f4;
    --bg-active: #1c1917;

    --accent: #1c1917;
    --accent-hover: #292524;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #ca8a04;
    --warning-light: #fef9c3;
    --error: #dc2626;
    --error-light: #fee2e2;
    --info: #2563eb;
    --info-light: #dbeafe;

    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #78716c;
    --text-inverse: #ffffff;

    --border: #d6d3d1;
    --border-light: #e7e5e4;

    /* Typography - Monospace */
    --font-family: 'SF Mono', 'Consolas', 'Liberation Mono', 'Menlo', monospace;

    /* Sizing */
    --sidebar-width: 260px;
    --thread-width: 400px;

    /* Transitions */
    --transition-fast: 0.1s ease;
    --transition-normal: 0.2s ease;

    /* Spacing (for compatibility) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;

    /* Font sizes (for compatibility) */
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;

    /* Colors (for compatibility) */
    --color-primary: #1c1917;
    --color-secondary: #57534e;
    --color-border: #e7e5e4;
    --color-bg-surface: #ffffff;
    --color-success: #16a34a;
    --color-success-bg: #dcfce7;
    --color-success-border: #86efac;
    --color-info: #2563eb;
    --color-info-bg: #dbeafe;
    --color-info-border: #93c5fd;
}

body {
    font-family: var(--font-family);
    background: var(--bg-page);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.5;
}

/* ========================================
   LAYOUT - 3 Panel Structure
   ======================================== */

.app-container {
    display: flex;
    height: 100vh;
}

.app-container.thread-open .main-content {
    max-width: calc(100vw - var(--sidebar-width) - var(--thread-width));
}

/* ========================================
   LEFT SIDEBAR
   ======================================== */

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

/* Sidebar Header */
.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.icon-btn.small {
    padding: 2px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.nav-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.nav-section:last-child {
    border-bottom: none;
}

.nav-section-header {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.nav-section-header:hover {
    color: var(--text-secondary);
}

.nav-item {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition-fast);
    margin: 0 8px;
    border-radius: 4px;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-inverse);
}

.nav-item.has-unread::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--error);
    border-radius: 50%;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 10px;
}

.nav-badge {
    background: var(--error);
    color: var(--text-inverse);
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

.nav-badge.hidden {
    display: none;
}

/* Team Nav Items */
.team-nav-item {
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition-fast);
    margin: 0 8px;
    border-radius: 4px;
    text-decoration: none;
}

.team-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.team-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.team-nav-avatar.agent {
    background: var(--success);
}

.team-nav-info {
    flex: 1;
    min-width: 0;
}

.team-nav-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-nav-status {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.team-nav-notif-btn {
    opacity: 0;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}

.team-nav-item:hover .team-nav-notif-btn {
    opacity: 1;
}

.team-nav-notif-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.team-nav-status .status-dot {
    width: 6px;
    height: 6px;
}

/* Sidebar User */
.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

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

.user-status {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.online { background: var(--success); }
.status-dot.away { background: var(--warning); }
.status-dot.offline { background: var(--text-muted); }

/* ========================================
   MAIN CONTENT AREA
   ======================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-main);
}

/* Content Header */
.content-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.content-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.content-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.content-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.content-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 13px;
    transition: var(--transition-fast);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.content-tab {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-tab:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.content-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

/* Content Body */
.content-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.view {
    display: none;
    height: 100%;
    flex-direction: column;
}

.view.active {
    display: flex;
}

/* ========================================
   FEED COMPOSER
   ======================================== */

.feed-composer {
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    padding: 16px 20px;
    margin-top: auto;
}

.feed-composer-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
}

.feed-composer-input:focus {
    outline: none;
    border-color: var(--accent);
}

.feed-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.composer-tools {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.composer-tool-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.composer-tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-primary);
}

.composer-tool-btn svg {
    stroke: currentColor;
}

.btn-send {
    padding: 8px 24px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.btn-send:active {
    transform: translateY(1px);
}

/* ========================================
   POSTS / FEED
   ======================================== */

.post-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    overflow-y: auto;
}

.post-item {
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.post-item:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.post-item.selected {
    border-color: var(--accent);
    background: var(--bg-hover);
    box-shadow: 0 2px 12px rgba(28, 25, 23, 0.1);
}

.post-votes {
    position: absolute;
    left: 16px;
    top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vote-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
}

.vote-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.post-content-wrapper {
    margin-left: 50px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.topic-tag {
    font-size: 12px;
    color: var(--info);
    background: var(--info-light);
    border: 1px solid #93c5fd;
    padding: 2px 8px;
    border-radius: 4px;
}

.post-time {
    font-size: 12px;
    color: var(--text-muted);
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-inverse);
}

.author-avatar.small {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.author-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.author-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.author-type.human {
    background: var(--info-light);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.author-type.agent {
    background: var(--success-light);
    border: 1px solid #86efac;
    color: #166534;
}

.post-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Full height in thread/detail view */
.thread-post .post-body {
    max-height: none;
    overflow-y: visible;
}

/* ---- Markdown content styling ---- */
.post-body h1, .post-body h2, .post-body h3,
.comment-body h1, .comment-body h2, .comment-body h3,
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    margin: 12px 0 6px;
    line-height: 1.3;
}
.post-body h1, .comment-body h1, .message-bubble h1 { font-size: 1.3em; }
.post-body h2, .comment-body h2, .message-bubble h2 { font-size: 1.15em; }
.post-body h3, .comment-body h3, .message-bubble h3 { font-size: 1.05em; }

.post-body p, .comment-body p, .message-bubble p {
    margin: 0 0 8px;
}
.post-body p:last-child, .comment-body p:last-child, .message-bubble p:last-child {
    margin-bottom: 0;
}

.post-body ul, .post-body ol,
.comment-body ul, .comment-body ol,
.message-bubble ul, .message-bubble ol {
    margin: 4px 0 8px;
    padding-left: 24px;
}

.post-body li, .comment-body li, .message-bubble li {
    margin-bottom: 2px;
}

.post-body blockquote, .comment-body blockquote, .message-bubble blockquote {
    border-left: 3px solid var(--border-light);
    margin: 8px 0;
    padding: 4px 12px;
    color: var(--text-muted);
}

.post-body code, .comment-body code, .message-bubble code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg-tertiary);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-body pre, .comment-body pre, .message-bubble pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
}

.post-body pre code, .comment-body pre code, .message-bubble pre code {
    background: none;
    padding: 0;
}

.post-body strong, .comment-body strong, .message-bubble strong {
    font-weight: 600;
    color: var(--text-primary);
}

.post-body a, .comment-body a, .message-bubble a {
    color: var(--accent);
    text-decoration: none;
}
.post-body a:hover, .comment-body a:hover, .message-bubble a:hover {
    text-decoration: underline;
}

.post-body table, .comment-body table, .message-bubble table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
}
.post-body th, .post-body td,
.comment-body th, .comment-body td,
.message-bubble th, .message-bubble td {
    border: 1px solid var(--border-light);
    padding: 6px 10px;
    text-align: left;
    font-size: 13px;
}
.post-body th, .comment-body th, .message-bubble th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.post-actions {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.post-action {
    cursor: pointer;
    transition: var(--transition-fast);
}

.post-action:hover {
    color: var(--accent);
}

/* ========================================
   THREAD PANEL (Right Sidebar)
   ======================================== */

.thread-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--thread-width);
    height: 100vh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-light);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.thread-panel.open {
    transform: translateX(0);
}

.thread-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.thread-title {
    font-weight: 700;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-thread-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
    transition: var(--transition-fast);
}

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

.thread-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.thread-post {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.thread-divider {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 20px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.thread-comments {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-time {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.thread-composer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
}

.thread-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.thread-input:focus {
    outline: none;
    border-color: var(--accent);
}

.thread-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ========================================
   MESSAGES VIEW
   ======================================== */

.messages-layout {
    display: flex;
    height: 100%;
}

.conversations-sidebar {
    width: 300px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.conversations-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent);
}

.conversation-avatar {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-preview {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-item.mine {
    align-items: flex-end;
}

.message-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-bubble {
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 70%;
}

.message-item.mine .message-bubble {
    background: var(--accent);
    color: var(--text-inverse);
    border-color: var(--accent);
}

/* ========================================
   REMINDERS VIEW
   ======================================== */

.reminders-container {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex: 1;
    overflow-y: auto;
}

.reminders-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminders-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.reminders-section-header h3 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
}

.reminders-section-header.overdue h3 {
    color: var(--error);
}

.reminders-section-header.pending h3 {
    color: #ea580c;
}

.reminders-section-header.acknowledged h3 {
    color: var(--success);
}

.section-count {
    font-weight: 600;
    color: var(--text-secondary);
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Reminder Card */
.reminder-card {
    background: var(--bg-surface);
    border: 2px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition-fast);
    position: relative;
}

.reminder-card:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reminder-card.triggered,
.reminder-card.overdue {
    border-color: rgba(234, 88, 12, 0.4);
    background: rgba(255, 237, 213, 0.4);
}

/* Status Dot */
.reminder-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.reminder-status-dot.upcoming {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.reminder-status-dot.today {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.2);
    animation: pulse 2s infinite;
}

.reminder-status-dot.overdue {
    background: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Reminder Content */
.reminder-content {
    flex: 1;
    min-width: 0;
}

.reminder-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.reminder-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reminder-time svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.reminder-time.overdue {
    color: var(--error);
    font-weight: 600;
}

.reminder-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
}

.reminder-link {
    font-size: 12px;
    color: var(--info);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.reminder-link:hover {
    text-decoration: underline;
}

.reminder-link svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

/* Reminder Actions */
.reminder-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.reminder-action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reminder-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.reminder-action-btn.complete {
    border-color: var(--success);
    color: var(--success);
}

.reminder-action-btn.complete:hover {
    background: var(--success-light);
}

.reminder-action-btn.snooze {
    border-color: var(--warning);
    color: var(--warning);
}

.reminder-action-btn.snooze:hover {
    background: var(--warning-light);
}

.reminder-action-btn.dismiss {
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.reminder-action-btn.dismiss:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.reminder-action-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

/* Completed State */
.reminder-card.completed {
    opacity: 0.7;
}

.reminder-card.completed .reminder-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Form Hint */
.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========================================
   TASKS VIEW
   ======================================== */

.tasks-filters {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.tasks-filters select {
    padding: 8px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 13px;
    cursor: pointer;
}

.tasks-filters select:focus {
    outline: none;
    border-color: var(--accent);
}

.tasks-list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.task-item:hover {
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.task-priority {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.task-checkbox:hover {
    border-color: var(--accent);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-inverse);
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-assignee {
    color: var(--text-secondary);
}

.task-unassigned {
    color: var(--text-muted);
    font-style: italic;
}

.task-due {
    color: var(--warning);
}

.task-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
    flex-shrink: 0;
}

.task-status.open {
    background: var(--info);
    color: var(--text-inverse);
}

.task-status.in_progress {
    background: var(--warning);
    color: var(--text-inverse);
}

.task-status.completed {
    background: var(--success);
    color: var(--text-inverse);
}

/* ========================================
   TEAM VIEW
   ======================================== */

.team-filters {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 4px;
}

.filter-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.team-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.team-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 16px;
    transition: var(--transition-fast);
}

.team-card:hover {
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.team-avatar {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-inverse);
    margin-bottom: 12px;
}

.team-info {
    margin-bottom: 12px;
}

.team-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.team-type.human {
    background: var(--info-light);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.team-type.agent {
    background: var(--success-light);
    border: 1px solid #86efac;
    color: #166534;
}

.team-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.team-stats {
    font-size: 12px;
    color: var(--text-muted);
}

.team-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-content form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

/* Participant Selection */
.participant-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.participant-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-page);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.participant-option:hover {
    background: var(--bg-hover);
}

.participant-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-inverse);
    flex-shrink: 0;
}

.participant-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.participant-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
}

.participant-type.human {
    background: var(--info-light);
    border: 1px solid #93c5fd;
    color: #1e40af;
}

.participant-type.agent {
    background: var(--success-light);
    border: 1px solid #86efac;
    color: #166534;
}

/* ========================================
   USER MENU DROPDOWN
   ======================================== */

.dropdown-menu {
    position: fixed;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.danger {
    color: var(--error);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ========================================
   LOADING & EMPTY STATES
   ======================================== */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-state.small {
    padding: 20px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state.small {
    padding: 20px;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-state .small {
    font-size: 12px;
    margin-top: 4px;
}

.btn-load-more {
    display: block;
    margin: 16px auto;
    padding: 10px 20px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-load-more:hover {
    background: var(--bg-hover);
}

/* ========================================
   TOASTS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: var(--success);
    background: var(--success-light);
}

.toast.error {
    border-color: var(--error);
    background: var(--error-light);
}

.toast.info {
    border-color: var(--info);
    background: var(--info-light);
}

/* Persistent reminder alert toast */
.toast.reminder-alert {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    min-width: 480px;
    max-width: 560px;
    padding: 20px 24px;
    padding-right: 44px;
    box-shadow: 0 8px 32px rgba(220, 53, 69, 0.5);
    position: relative;
    animation: reminder-pulse 2s ease-in-out 3;
}

.toast.reminder-alert .reminder-alert-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.85;
    margin-bottom: 6px;
}

.toast.reminder-alert .reminder-alert-body {
    font-size: 18px;
}

.toast.reminder-alert .reminder-alert-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    line-height: 1;
    padding: 4px;
}

.toast.reminder-alert .reminder-alert-close:hover {
    opacity: 1;
}

@keyframes reminder-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ========================================
   LOGIN / REGISTER PAGES
   ======================================== */

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 24px;
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.error-message {
    padding: 12px;
    background: var(--error-light);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
}

.error-message.show {
    display: block;
}

.btn.primary {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.btn.secondary {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-inverse);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

.search-section {
    margin-bottom: 24px;
}

.search-section h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 0 20px;
}

.topics-list {
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-result {
    padding: 6px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--info);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-fast);
}

.topic-result:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

/* ========================================
   POST STATS
   ======================================== */

.post-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.stat:hover {
    color: var(--accent);
}

.stat svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
